wine-staging/patches/ntoskrnl-Stubs/0013-ntoskrnl.exe-Implement-NtBuildNumber.patch

70 lines
2.5 KiB
Diff
Raw Normal View History

From 16d5776424063d794c42609a06d3a010d191dee3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 6 Jun 2017 21:08:51 +0200
Subject: ntoskrnl.exe: Implement NtBuildNumber.
---
dlls/ntoskrnl.exe/ntoskrnl.c | 11 +++++++++--
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 9332c3ef2a6..0a5c22fc8c0 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -52,6 +52,7 @@ WINE_DECLARE_DEBUG_CHANNEL(plugplay);
BOOLEAN KdDebuggerEnabled = FALSE;
ULONG InitSafeBootMode = 0;
+USHORT NtBuildNumber = 0;
extern LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs );
@@ -2657,6 +2658,13 @@ NTSTATUS WINAPI IoAcquireRemoveLockEx(PIO_REMOVE_LOCK lock, PVOID tag,
return STATUS_NOT_IMPLEMENTED;
}
+static void ntoskrnl_init(void)
+{
+ LARGE_INTEGER count;
+
+ KeQueryTickCount( &count ); /* initialize the global KeTickCount */
+ NtBuildNumber = NtCurrentTeb()->Peb->OSBuildNumber;
+}
/*****************************************************
* DllMain
@@ -2664,7 +2672,6 @@ NTSTATUS WINAPI IoAcquireRemoveLockEx(PIO_REMOVE_LOCK lock, PVOID tag,
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
{
static void *handler;
- LARGE_INTEGER count;
switch(reason)
{
@@ -2673,7 +2680,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
#if defined(__i386__) || defined(__x86_64__)
handler = RtlAddVectoredExceptionHandler( TRUE, vectored_handler );
#endif
- KeQueryTickCount( &count ); /* initialize the global KeTickCount */
+ ntoskrnl_init();
break;
case DLL_PROCESS_DETACH:
if (reserved) break;
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
index aaa0d879219..1c862255dee 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
@@ -740,7 +740,7 @@
@ stdcall NtAllocateLocallyUniqueId(ptr) ntdll.NtAllocateLocallyUniqueId
@ stdcall NtAllocateUuids(ptr ptr ptr ptr) ntdll.NtAllocateUuids
@ stdcall NtAllocateVirtualMemory(long ptr long ptr long long) ntdll.NtAllocateVirtualMemory
-@ stub NtBuildNumber
+@ extern NtBuildNumber
@ stdcall NtClose(long) ntdll.NtClose
@ stdcall NtConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) ntdll.NtConnectPort
@ stdcall NtCreateEvent(ptr long ptr long long) ntdll.NtCreateEvent
--
2.13.1