mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 08:26:27 +00:00
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:
parent
02677e687b
commit
2789b9eb70
1 changed files with 9 additions and 2 deletions
|
@ -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()];
|
||||
|
|
Loading…
Reference in a new issue