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

Function GetRarDataPath

Libraries/unrar/pathfn.cpp:239–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237
238#if defined(_WIN_ALL) && !defined(SFX_MODULE)
239void GetRarDataPath(wchar *Path,size_t MaxSize,bool Create)
240{
241 *Path=0;
242
243 HKEY hKey;
244 if (RegOpenKeyEx(HKEY_CURRENT_USER,L"Software\\WinRAR\\Paths",0,
245 KEY_QUERY_VALUE,&hKey)==ERROR_SUCCESS)
246 {
247 DWORD DataSize=(DWORD)MaxSize,Type;
248 RegQueryValueEx(hKey,L"AppData",0,&Type,(BYTE *)Path,&DataSize);
249 RegCloseKey(hKey);
250 }
251
252 if (*Path==0 || !FileExist(Path))
253 if (!GetAppDataPath(Path,MaxSize,Create))
254 {
255 GetModuleFileName(NULL,Path,(DWORD)MaxSize);
256 RemoveNameFromPath(Path);
257 }
258}
259#endif
260
261

Callers 1

EnumConfigPathsFunction · 0.85

Calls 3

FileExistFunction · 0.85
GetAppDataPathFunction · 0.85
RemoveNameFromPathFunction · 0.85

Tested by

no test coverage detected