Zebediah Figura : ntoskrnl.exe: Implement IoIs32bitProcess().

Alexandre Julliard julliard at winehq.org
Mon May 4 15:49:16 CDT 2020


Module: wine
Branch: master
Commit: 0e09d5ea74d1c4a2b780c27a66b227e7a406d9d9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0e09d5ea74d1c4a2b780c27a66b227e7a406d9d9

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Sun May  3 11:22:02 2020 -0500

ntoskrnl.exe: Implement IoIs32bitProcess().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49088
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntoskrnl.exe/ntoskrnl.c         | 12 ++++++++++++
 dlls/ntoskrnl.exe/ntoskrnl.exe.spec  |  1 +
 dlls/ntoskrnl.exe/ntoskrnl_private.h |  1 +
 include/ddk/wdm.h                    |  3 +++
 4 files changed, 17 insertions(+)

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index d1bdc33653..3013fe7eb9 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -2196,6 +2196,7 @@ static void *create_process_object( HANDLE handle )
     process->header.Type = 3;
     process->header.WaitListHead.Blink = INVALID_HANDLE_VALUE; /* mark as kernel object */
     NtQueryInformationProcess( handle, ProcessBasicInformation, &process->info, sizeof(process->info), NULL );
+    IsWow64Process( handle, &process->wow64 );
     return process;
 }
 
@@ -3935,6 +3936,17 @@ PEPROCESS WINAPI IoGetRequestorProcess(IRP *irp)
     return irp->Tail.Overlay.Thread->kthread.process;
 }
 
+#ifdef _WIN64
+/***********************************************************************
+ *           IoIs32bitProcess   (NTOSKRNL.EXE.@)
+ */
+BOOLEAN WINAPI IoIs32bitProcess(IRP *irp)
+{
+    TRACE("irp %p.\n", irp);
+    return irp->Tail.Overlay.Thread->kthread.process->wow64;
+}
+#endif
+
 /***********************************************************************
  *           RtlIsNtDdiVersionAvailable   (NTOSKRNL.EXE.@)
  */
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
index 14d95a47f8..8e3b127b16 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
@@ -416,6 +416,7 @@
 @ stdcall IoInitializeTimer(ptr ptr ptr)
 @ stdcall IoInvalidateDeviceRelations(ptr long)
 @ stub IoInvalidateDeviceState
+@ stdcall -arch=win64 IoIs32bitProcess(ptr)
 @ stub IoIsFileOriginRemote
 @ stub IoIsOperationSynchronous
 @ stub IoIsSystemThread
diff --git a/dlls/ntoskrnl.exe/ntoskrnl_private.h b/dlls/ntoskrnl.exe/ntoskrnl_private.h
index 256e945e6f..23f03c336d 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl_private.h
+++ b/dlls/ntoskrnl.exe/ntoskrnl_private.h
@@ -40,6 +40,7 @@ struct _EPROCESS
 {
     DISPATCHER_HEADER header;
     PROCESS_BASIC_INFORMATION info;
+    BOOL wow64;
 };
 
 struct _KTHREAD
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 60396779fc..db8073ebe3 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -1608,6 +1608,9 @@ void      WINAPI IoGetStackLimits(ULONG_PTR*,ULONG_PTR*);
 void      WINAPI IoInitializeIrp(IRP*,USHORT,CCHAR);
 VOID      WINAPI IoInitializeRemoveLockEx(PIO_REMOVE_LOCK,ULONG,ULONG,ULONG,ULONG);
 void      WINAPI IoInvalidateDeviceRelations(PDEVICE_OBJECT,DEVICE_RELATION_TYPE);
+#ifdef _WIN64
+BOOLEAN   WINAPI IoIs32bitProcess(IRP*);
+#endif
 NTSTATUS  WINAPI IoOpenDeviceRegistryKey(DEVICE_OBJECT*,ULONG,ACCESS_MASK,HANDLE*);
 void      WINAPI IoQueueWorkItem(PIO_WORKITEM,PIO_WORKITEM_ROUTINE,WORK_QUEUE_TYPE,void*);
 NTSTATUS  WINAPI IoRegisterDeviceInterface(PDEVICE_OBJECT,const GUID*,PUNICODE_STRING,PUNICODE_STRING);




More information about the wine-cvs mailing list