mirror of
https://github.com/vxunderground/VX-API
synced 2026-06-06 16:54:55 +00:00
42 lines
772 B
C++
42 lines
772 B
C++
#include "Win32Helper.h"
|
|
|
|
BOOL CreateLocalAppDataObjectPathW(PWCHAR pBuffer, PWCHAR Path, DWORD Size, BOOL bDoesObjectExist)
|
|
{
|
|
if (pBuffer == NULL)
|
|
return FALSE;
|
|
|
|
if (GetEnvironmentVariableW(L"LOCALAPPDATA", pBuffer, Size) == 0)
|
|
return FALSE;
|
|
|
|
if (StringConcatW(pBuffer, Path) == 0)
|
|
return FALSE;
|
|
|
|
if (bDoesObjectExist)
|
|
{
|
|
if (!IsPathValidW(pBuffer))
|
|
return FALSE;
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
BOOL CreateLocalAppDataObjectPathA(PCHAR pBuffer, PCHAR Path, DWORD Size, BOOL bDoesObjectExist)
|
|
{
|
|
if (pBuffer == NULL)
|
|
return FALSE;
|
|
|
|
if (GetEnvironmentVariableA("LOCALAPPDATA", pBuffer, Size) == 0)
|
|
return FALSE;
|
|
|
|
if (StringConcatA(pBuffer, Path) == 0)
|
|
return FALSE;
|
|
|
|
if (bDoesObjectExist)
|
|
{
|
|
if (!IsPathValidA(pBuffer))
|
|
return FALSE;
|
|
}
|
|
|
|
return TRUE;
|
|
}
|