mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +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
8b1d3e61ba
commit
0b2cac89a5
1 changed files with 9 additions and 2 deletions
|
@ -119,6 +119,7 @@ static NSString *gnustep_is_flattened =
|
||||||
|
|
||||||
#if defined(__MINGW__)
|
#if defined(__MINGW__)
|
||||||
|
|
||||||
|
#include <sddl.h>
|
||||||
#include <lmaccess.h>
|
#include <lmaccess.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -946,6 +947,7 @@ static void InitialisePathUtilities(void)
|
||||||
unichar buf[1024];
|
unichar buf[1024];
|
||||||
SID_NAME_USE use;
|
SID_NAME_USE use;
|
||||||
SID sid;
|
SID sid;
|
||||||
|
LPTSTR str;
|
||||||
DWORD n = 1024;
|
DWORD n = 1024;
|
||||||
|
|
||||||
if (GetUserNameW(buf, &n) == 0 || buf[0] == '\0')
|
if (GetUserNameW(buf, &n) == 0 || buf[0] == '\0')
|
||||||
|
@ -954,12 +956,17 @@ static void InitialisePathUtilities(void)
|
||||||
format: @"Unable to determine current user name"];
|
format: @"Unable to determine current user name"];
|
||||||
}
|
}
|
||||||
n = sizeof(SID);
|
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
|
[NSException raise: NSInternalInconsistencyException
|
||||||
format: @"Unable to determine current account"];
|
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
|
#else
|
||||||
gnustepUserID = [[NSString alloc] initWithFormat: @"%ld", (long)getuid()];
|
gnustepUserID = [[NSString alloc] initWithFormat: @"%ld", (long)getuid()];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue