MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / TryThisBasePath

Function TryThisBasePath

src/windows/Main.cpp:83–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83bool TryThisBasePath()
84{
85 LPCTSTR p1 = NULL, p2 = NULL;
86 p1 = ConvertCppStringToTString(GetBasePath());
87 p2 = ConvertCppStringToTString(GetCachePath());
88
89 bool result = true;
90
91 // if these already exist, it's fine..
92 if (!CreateDirectory(p1, NULL) || !CreateDirectory(p2, NULL))
93 {
94 if (GetLastError() != ERROR_ALREADY_EXISTS)
95 result = false;
96 }
97
98 if (p1) free((void*)p1);
99 if (p2) free((void*)p2);
100
101 return result;
102}
103
104void SetupCachePathIfNeeded()
105{

Callers 1

SetupCachePathIfNeededFunction · 0.85

Calls 3

GetBasePathFunction · 0.85
GetCachePathFunction · 0.85

Tested by

no test coverage detected