Commit c6ad2b6f authored by Gerard Patel's avatar Gerard Patel Committed by Alexandre Julliard

Stub OpenThreadToken & OpenProcessToken for failure in Win9x mode.

parent cf1e8583
......@@ -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));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment