From f1b08404b8bd6143d0de47f6dc02330ef8d6b884 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 8 Feb 2015 17:47:43 +0100 Subject: [PATCH] Added patch to implement stubs for ntoskrnl.ObReferenceObjectByPointer and ntoskrnl.ObDereferenceObject. --- README.md | 3 +- debian/changelog | 1 + ...-stubs-for-ObReferenceObjectByPointe.patch | 94 +++++++++++++++++++ patches/ntoskrnl-Stubs/definition | 1 + patches/patchinstall.sh | 2 + 5 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 patches/ntoskrnl-Stubs/0005-ntoskrnl.exe-Add-stubs-for-ObReferenceObjectByPointe.patch diff --git a/README.md b/README.md index d6631a90..fc403153 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Wine. All those differences are also documented on the Included bug fixes and improvements =================================== -**Bugfixes and features included in the next upcoming release [19]:** +**Bugfixes and features included in the next upcoming release [20]:** * Add implementation for CreateThreadpool ([Wine Bug #35192](https://bugs.winehq.org/show_bug.cgi?id=35192)) * Add library override instead of closing winecfg when pressing ENTER over the combobox ([Wine Bug #12804](https://bugs.winehq.org/show_bug.cgi?id=12804)) @@ -52,6 +52,7 @@ Included bug fixes and improvements * Implement additional stubs for vcomp dlls ([Wine Bug #31640](https://bugs.winehq.org/show_bug.cgi?id=31640)) * Implement stub for ntoskrnl.IoGetAttachedDeviceReference * Implement stubs for ntoskrnl.Ex{Acquire,Release}FastMutexUnsafe +* Implement stubs for ntoskrnl.ObReferenceObjectByPointer and ntoskrnl.ObDereferenceObject * Implement threadpool timers ([Wine Bug #37306](https://bugs.winehq.org/show_bug.cgi?id=37306)) * Implement threadpool wait objects * Implement threadpool work items ([Wine Bug #32531](https://bugs.winehq.org/show_bug.cgi?id=32531)) diff --git a/debian/changelog b/debian/changelog index dc0582b8..006e7364 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ wine-staging (1.7.36) UNRELEASED; urgency=low * Added patch to make nvcuda.dll compatible with CUDA 7.0. * Added patch to implement stub for ntoskrnl.IoGetAttachedDeviceReference. * Added patch to implement stubs for ntoskrnl.Ex{Acquire,Release}FastMutexUnsafe. + * Added patch to implement stubs for ntoskrnl.ObReferenceObjectByPointer and ntoskrnl.ObDereferenceObject. * Removed patch to add additional tests for SLGetWindowsInformationDWORD (accepted upstream). * Removed patch to avoid filling KdHelp structure for usermode applications (accepted upstream). -- Sebastian Lackner Sun, 25 Jan 2015 05:58:36 +0100 diff --git a/patches/ntoskrnl-Stubs/0005-ntoskrnl.exe-Add-stubs-for-ObReferenceObjectByPointe.patch b/patches/ntoskrnl-Stubs/0005-ntoskrnl.exe-Add-stubs-for-ObReferenceObjectByPointe.patch new file mode 100644 index 00000000..e725780d --- /dev/null +++ b/patches/ntoskrnl-Stubs/0005-ntoskrnl.exe-Add-stubs-for-ObReferenceObjectByPointe.patch @@ -0,0 +1,94 @@ +From 787df5f7b3137d116141bbe4fdba664a06a9c5af Mon Sep 17 00:00:00 2001 +From: Alexander Morozov +Date: Fri, 30 Jan 2015 00:01:37 +0100 +Subject: ntoskrnl.exe: Add stubs for ObReferenceObjectByPointer and + ObDereferenceObject. + +--- + dlls/ntoskrnl.exe/ntoskrnl.c | 25 ++++++++++++++++++++++++- + dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 ++-- + include/ddk/wdm.h | 2 ++ + 3 files changed, 28 insertions(+), 3 deletions(-) + +diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c +index d33fe6f..0d6f730 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl.c ++++ b/dlls/ntoskrnl.exe/ntoskrnl.c +@@ -1720,6 +1720,29 @@ NTSTATUS WINAPI ObReferenceObjectByName( UNICODE_STRING *ObjectName, + return STATUS_NOT_IMPLEMENTED; + } + ++ ++/*********************************************************************** ++ * ObReferenceObjectByPointer (NTOSKRNL.EXE.@) ++ */ ++NTSTATUS WINAPI ObReferenceObjectByPointer(VOID *obj, ACCESS_MASK access, ++ POBJECT_TYPE type, ++ KPROCESSOR_MODE mode) ++{ ++ FIXME("(%p, %x, %p, %d): stub\n", obj, access, type, mode); ++ ++ return STATUS_NOT_IMPLEMENTED; ++} ++ ++ ++/*********************************************************************** ++ * ObDereferenceObject (NTOSKRNL.EXE.@) ++ */ ++void WINAPI ObDereferenceObject(VOID *obj) ++{ ++ FIXME("(%p): stub\n", obj); ++} ++ ++ + /*********************************************************************** + * ObfDereferenceObject (NTOSKRNL.EXE.@) + */ +@@ -1730,7 +1753,7 @@ void WINAPI __regs_ObfDereferenceObject( VOID *obj ) + void WINAPI ObfDereferenceObject( VOID *obj ) + #endif + { +- FIXME( "stub: %p\n", obj ); ++ ObDereferenceObject( obj ); + } + + +diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +index 2f08945..25624a6 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec ++++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +@@ -798,7 +798,7 @@ + @ stub ObCloseHandle + @ stub ObCreateObject + @ stub ObCreateObjectType +-@ stub ObDereferenceObject ++@ stdcall ObDereferenceObject(ptr) + @ stub ObDereferenceSecurityDescriptor + @ stub ObFindHandleForObject + @ stub ObGetObjectSecurity +@@ -811,7 +811,7 @@ + @ stub ObQueryObjectAuditingByHandle + @ stdcall ObReferenceObjectByHandle(long long ptr long ptr ptr) + @ stdcall ObReferenceObjectByName(ptr long ptr long ptr long ptr ptr) +-@ stub ObReferenceObjectByPointer ++@ stdcall ObReferenceObjectByPointer(ptr long ptr long) + @ stub ObReferenceSecurityDescriptor + @ stub ObReleaseObjectSecurity + @ stub ObSetHandleAttributes +diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h +index 121ca45..f2eb6a5 100644 +--- a/include/ddk/wdm.h ++++ b/include/ddk/wdm.h +@@ -1235,7 +1235,9 @@ PMDL WINAPI MmAllocatePagesForMdl(PHYSICAL_ADDRESS,PHYSICAL_ADDRESS,PHYSICA + void WINAPI MmFreeNonCachedMemory(PVOID,SIZE_T); + MM_SYSTEMSIZE WINAPI MmQuerySystemSize(void); + ++void WINAPI ObDereferenceObject(VOID*); + NTSTATUS WINAPI ObReferenceObjectByHandle(HANDLE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,PVOID*,POBJECT_HANDLE_INFORMATION); ++NTSTATUS WINAPI ObReferenceObjectByPointer(VOID*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE); + + POWER_STATE WINAPI PoSetPowerState(PDEVICE_OBJECT,POWER_STATE_TYPE,POWER_STATE); + NTSTATUS WINAPI PsCreateSystemThread(PHANDLE,ULONG,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PKSTART_ROUTINE,PVOID); +-- +2.2.2 + diff --git a/patches/ntoskrnl-Stubs/definition b/patches/ntoskrnl-Stubs/definition index 7df25a62..2ba5902c 100644 --- a/patches/ntoskrnl-Stubs/definition +++ b/patches/ntoskrnl-Stubs/definition @@ -1,3 +1,4 @@ Fixes: Add stub for ntoskrnl.KeWaitForMultipleObjects Fixes: Implement stub for ntoskrnl.IoGetAttachedDeviceReference Fixes: Implement stubs for ntoskrnl.Ex{Acquire,Release}FastMutexUnsafe +Fixes: Implement stubs for ntoskrnl.ObReferenceObjectByPointer and ntoskrnl.ObDereferenceObject diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 75ddbe4a..a9ebdd10 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -2338,11 +2338,13 @@ if test "$enable_ntoskrnl_Stubs" -eq 1; then patch_apply ntoskrnl-Stubs/0002-ntoskrnl.exe-add-KeWaitForMultipleObjects-stub.patch patch_apply ntoskrnl-Stubs/0003-ntoskrnl.exe-Add-stub-for-IoGetAttachedDeviceReferen.patch patch_apply ntoskrnl-Stubs/0004-ntoskrnl.exe-Add-stubs-for-ExAcquireFastMutexUnsafe-.patch + patch_apply ntoskrnl-Stubs/0005-ntoskrnl.exe-Add-stubs-for-ObReferenceObjectByPointe.patch ( echo '+ { "Sebastian Lackner", "include: Remove several duplicate definitions from ntdef.h.", 1 },'; echo '+ { "Austin English", "ntoskrnl.exe: add KeWaitForMultipleObjects stub.", 1 },'; echo '+ { "Alexander Morozov", "ntoskrnl.exe: Add stub for IoGetAttachedDeviceReference.", 1 },'; echo '+ { "Alexander Morozov", "ntoskrnl.exe: Add stubs for ExAcquireFastMutexUnsafe and ExReleaseFastMutexUnsafe.", 1 },'; + echo '+ { "Alexander Morozov", "ntoskrnl.exe: Add stubs for ObReferenceObjectByPointer and ObDereferenceObject.", 1 },'; ) >> "$patchlist" fi