Possible win95 fix

git-svn-id: https://svn.eduke32.com/eduke32@632 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-03-07 21:59:10 +00:00
parent aa5360a235
commit a735c3d1ac

View file

@ -335,10 +335,13 @@ char *Bgetcwd(char *buf, bsize_t size)
char *Bgethomedir(void)
{
#ifdef _WIN32
FARPROC aSHGetSpecialFolderPathA;
TCHAR appdata[MAX_PATH];
if (SUCCEEDED(SHGetSpecialFolderPathA(NULL, appdata, CSIDL_APPDATA, FALSE)))
return strdup(appdata);
aSHGetSpecialFolderPathA = GetProcAddress(GetModuleHandle("shell32.dll"), "SHGetSpecialFolderPathA");
if (aSHGetSpecialFolderPathA != NULL)
if (SUCCEEDED(aSHGetSpecialFolderPathA(NULL, appdata, CSIDL_APPDATA, FALSE)))
return strdup(appdata);
return NULL;
#elif defined __APPLE__
FSRef ref;