MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / GetAppDataPath

Function GetAppDataPath

Libraries/unrar/pathfn.cpp:216–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214
215#if defined(_WIN_ALL) && !defined(SFX_MODULE)
216bool GetAppDataPath(wchar *Path,size_t MaxSize,bool Create)
217{
218 LPMALLOC g_pMalloc;
219 SHGetMalloc(&g_pMalloc);
220 LPITEMIDLIST ppidl;
221 *Path=0;
222 bool Success=false;
223 if (SHGetSpecialFolderLocation(NULL,CSIDL_APPDATA,&ppidl)==NOERROR &&
224 SHGetPathFromIDList(ppidl,Path) && *Path!=0)
225 {
226 AddEndSlash(Path,MaxSize);
227 wcsncatz(Path,L"WinRAR",MaxSize);
228 Success=FileExist(Path);
229 if (!Success && Create)
230 Success=MakeDir(Path,false,0)==MKDIR_SUCCESS;
231 }
232 g_pMalloc->Free(ppidl);
233 return Success;
234}
235#endif
236
237

Callers 1

GetRarDataPathFunction · 0.85

Calls 4

AddEndSlashFunction · 0.85
wcsncatzFunction · 0.85
FileExistFunction · 0.85
MakeDirFunction · 0.85

Tested by

no test coverage detected