[Wine-patches] [2/6] Receive ID of the process which calls IOCTL.

Alexander Morozov =?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Пт Ноя 14 13:43:17 MSK 2008


----------- следующая часть -----------
From ed5d28b5ddf8f659c1869e88672b13cef4d4a2b6 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Thu, 13 Nov 2008 18:44:32 +0300
Subject: [PATCH] Receive ID of the process which calls IOCTL.

---
 dlls/ntoskrnl.exe/ntoskrnl.c |    3 +++
 server/device.c              |    2 ++
 server/protocol.def          |    1 +
 3 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 19826b9..91c6ecb 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -64,6 +64,8 @@ struct IrpInstance
     IRP *irp;
 };
 
+static DWORD pid; /* ID of the process which calls IOCTL */
+
 #ifdef __i386__
 #define DEFINE_FASTCALL1_ENTRYPOINT( name ) \
     __ASM_GLOBAL_FUNC( name, \
@@ -249,6 +251,7 @@ NTSTATUS wine_ntoskrnl_main_loop( HANDLE stop_event )
             {
                 code     = reply->code;
                 ioctl    = reply->next;
+                pid      = reply->pid;
                 device   = reply->user_ptr;
                 in_size  = reply->in_size;
                 out_size = reply->out_size;
diff --git a/server/device.c b/server/device.c
index d424db4..72352af 100644
--- a/server/device.c
+++ b/server/device.c
@@ -33,6 +33,7 @@
 #include "handle.h"
 #include "request.h"
 #include "unicode.h"
+#include "process.h"
 
 struct ioctl_call
 {
@@ -613,6 +614,7 @@ DECL_HANDLER(get_next_device_request)
     {
         ioctl = LIST_ENTRY( ptr, struct ioctl_call, mgr_entry );
         reply->code = ioctl->code;
+        reply->pid = get_process_id( ioctl->thread->process );
         reply->user_ptr = ioctl->device->user_ptr;
         reply->in_size = ioctl->in_size;
         reply->out_size = ioctl->out_size;
diff --git a/server/protocol.def b/server/protocol.def
index 9fc5645..a10f23e 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -2971,6 +2971,7 @@ enum message_type
 @REPLY
     obj_handle_t next;            /* handle to the next ioctl */
     ioctl_code_t code;            /* ioctl code */
+    process_id_t pid;             /* process id */
     void*        user_ptr;        /* opaque ptr for the device */
     data_size_t  in_size;         /* total needed input size */
     data_size_t  out_size;        /* needed output size */
-- 
1.5.6.5.GIT



Подробная информация о списке рассылки Wine-patches