mingw fixups

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30999 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2010-07-19 08:54:38 +00:00
parent 02677e687b
commit 2789b9eb70

View file

@ -119,6 +119,7 @@ static NSString *gnustep_is_flattened =
#if defined(__MINGW__)
#include <sddl.h>
#include <lmaccess.h>
/*
@ -946,6 +947,7 @@ static void InitialisePathUtilities(void)
unichar buf[1024];
SID_NAME_USE use;
SID sid;
LPTSTR str;
DWORD n = 1024;
if (GetUserNameW(buf, &n) == 0 || buf[0] == '\0')
@ -954,12 +956,17 @@ static void InitialisePathUtilities(void)
format: @"Unable to determine current user name"];
}
n = sizeof(SID);
if (LookupAccountName(0, buf, &sid, &n, NULL, 0, &use) == 0)
if (LookupAccountNameW(0, buf, &sid, &n, NULL, 0, &use) == 0)
{
[NSException raise: NSInternalInconsistencyException
format: @"Unable to determine current account"];
}
gnustepUserID = [[NSString alloc] initWithFormat: @"%ld", (long)sid];
if (ConvertSidToStringSid(&sid, &str) == 0)
{
[NSException raise: NSInternalInconsistencyException
format: @"Unable to get current user ID string"];
}
gnustepUserID = [[NSString alloc] initWithUTF8String: str];
}
#else
gnustepUserID = [[NSString alloc] initWithFormat: @"%ld", (long)getuid()];