mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 11:43:31 +00:00
Stub OpenThreadToken & OpenProcessToken for failure in Win9x mode.
This commit is contained in:
parent
cf1e858354
commit
c6ad2b6fc3
1 changed files with 16 additions and 0 deletions
|
@ -14,6 +14,20 @@
|
|||
DECLARE_DEBUG_CHANNEL(advapi)
|
||||
DECLARE_DEBUG_CHANNEL(security)
|
||||
|
||||
|
||||
static BOOL Wine_HasSecurity(void)
|
||||
{
|
||||
OSVERSIONINFOA osi;
|
||||
osi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
|
||||
GetVersionExA(&osi);
|
||||
if (osi.dwPlatformId != VER_PLATFORM_WIN32_NT) {
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
#define CallWin32ToNt(func) \
|
||||
{ NTSTATUS ret; \
|
||||
ret = (func); \
|
||||
|
@ -42,6 +56,7 @@ BOOL WINAPI
|
|||
OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess,
|
||||
HANDLE *TokenHandle )
|
||||
{
|
||||
if (!Wine_HasSecurity()) return FALSE;
|
||||
CallWin32ToNt(NtOpenProcessToken( ProcessHandle, DesiredAccess, TokenHandle ));
|
||||
}
|
||||
|
||||
|
@ -58,6 +73,7 @@ BOOL WINAPI
|
|||
OpenThreadToken( HANDLE ThreadHandle, DWORD DesiredAccess,
|
||||
BOOL OpenAsSelf, HANDLE *TokenHandle)
|
||||
{
|
||||
if (!Wine_HasSecurity()) return FALSE;
|
||||
CallWin32ToNt (NtOpenThreadToken(ThreadHandle, DesiredAccess, OpenAsSelf, TokenHandle));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue