| 214 | |
| 215 | #if defined(_WIN_ALL) && !defined(SFX_MODULE) |
| 216 | bool 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 |
no test coverage detected