[PATCH 2/3] ntoskrnl: Always use OBJ_KERNEL_HANDLE when opening objects in winedevice.

Derek Lesho dlesho at codeweavers.com
Fri Jun 19 12:35:08 CDT 2020


Signed-off-by: Derek Lesho <dlesho at codeweavers.com>
---
 dlls/ntoskrnl.exe/ntoskrnl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 7604c13b56..818ff56d25 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -3235,7 +3235,7 @@ NTSTATUS WINAPI ObQueryNameString( void *object, OBJECT_NAME_INFORMATION *name,
 
     TRACE("object %p, name %p, size %u, ret_size %p.\n", object, name, size, ret_size);
 
-    if ((ret = ObOpenObjectByPointer( object, 0, NULL, 0, NULL, KernelMode, &handle )))
+    if ((ret = ObOpenObjectByPointer( object, OBJ_KERNEL_HANDLE, NULL, 0, NULL, KernelMode, &handle )))
         return ret;
     ret = NtQueryObject( handle, ObjectNameInformation, name, size, ret_size );
 
@@ -4189,7 +4189,7 @@ void * WINAPI PsGetProcessSectionBaseAddress(PEPROCESS process)
 
     TRACE("process %p.\n", process);
 
-    if ((status = ObOpenObjectByPointer(process, 0, NULL, PROCESS_ALL_ACCESS, NULL, KernelMode, &h)))
+    if ((status = ObOpenObjectByPointer(process, OBJ_KERNEL_HANDLE, NULL, PROCESS_ALL_ACCESS, NULL, KernelMode, &h)))
     {
         WARN("Error opening process object, status %#x.\n", status);
         return NULL;
-- 
2.26.2




More information about the wine-devel mailing list