Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47623 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 9 +++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- dlls/ntoskrnl.exe/tests/driver.c | 2 ++ include/ddk/ntifs.h | 1 + 4 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 5818c769ec..d4571696bf 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -3903,3 +3903,12 @@ ULONG WINAPI ExSetTimerResolution(ULONG time, BOOLEAN set_resolution) FIXME("stub: %u %d\n", time, set_resolution); return KeQueryTimeIncrement(); } + +/*********************************************************************** + * IoGetRequestorProcess (NTOSKRNL.EXE.@) + */ +PEPROCESS WINAPI IoGetRequestorProcess(IRP *irp) +{ + TRACE("irp %p.\n", irp); + return irp->Tail.Overlay.Thread->kthread.process; +} diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 8322fd0947..8dce2d583b 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -406,7 +406,7 @@ @ stub IoGetInitialStack @ stub IoGetLowerDeviceObject @ stdcall IoGetRelatedDeviceObject(ptr) -@ stub IoGetRequestorProcess +@ stdcall IoGetRequestorProcess(ptr) @ stub IoGetRequestorProcessId @ stub IoGetRequestorSessionId @ stdcall IoGetStackLimits(ptr ptr) diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index 6ab3c622ae..0506011ce5 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -225,6 +225,8 @@ static void test_irp_struct(IRP *irp, DEVICE_OBJECT *device) ok(!irp->UserEvent, "UserEvent = %p\n", irp->UserEvent); ok(irp->Tail.Overlay.Thread == (PETHREAD)KeGetCurrentThread(), "IRP thread is not the current thread\n"); + + ok(IoGetRequestorProcess(irp) == IoGetCurrentProcess(), "processes didn't match\n"); }
static void test_mdl_map(void) diff --git a/include/ddk/ntifs.h b/include/ddk/ntifs.h index b287b06799..39636e8073 100644 --- a/include/ddk/ntifs.h +++ b/include/ddk/ntifs.h @@ -131,6 +131,7 @@ typedef struct _FS_FILTER_CALLBACKS
BOOLEAN WINAPI FsRtlIsNameInExpression(PUNICODE_STRING, PUNICODE_STRING, BOOLEAN, PWCH); DEVICE_OBJECT * WINAPI IoGetAttachedDevice(DEVICE_OBJECT*); +PEPROCESS WINAPI IoGetRequestorProcess(IRP*); NTSTATUS WINAPI ObOpenObjectByPointer(void*,ULONG,PACCESS_STATE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,HANDLE*); NTSTATUS WINAPI ObQueryNameString(PVOID,POBJECT_NAME_INFORMATION,ULONG,PULONG); BOOLEAN WINAPI PsIsSystemThread(PETHREAD);