Make RtlCreateUserThread fail if process handle is not for the current process
Alexander Yaworsky
yaworsky at migusoft.ru
Fri Sep 17 23:26:28 CDT 2004
Hello
ChangeLog:
Make RtlCreateUserThread fail if process handle is not for the current process
Index: dlls/ntdll/ntdll_misc.h
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/ntdll_misc.h,v
retrieving revision 1.48
diff -u -r1.48 ntdll_misc.h
--- dlls/ntdll/ntdll_misc.h 15 Jul 2004 22:07:21 -0000 1.48
+++ dlls/ntdll/ntdll_misc.h 18 Sep 2004 03:30:16 -0000
@@ -93,6 +93,8 @@
extern BOOL VIRTUAL_HasMapping( LPCVOID addr );
extern void VIRTUAL_UseLargeAddressSpace(void);
+extern BOOL is_current_process( HANDLE handle );
+
/* code pages */
extern int ntdll_umbstowcs(DWORD flags, const char* src, int srclen, WCHAR* dst, int dstlen);
extern int ntdll_wcstoumbs(DWORD flags, const WCHAR* src, int srclen, char* dst, int dstlen,
Index: dlls/ntdll/thread.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/thread.c,v
retrieving revision 1.21
diff -u -r1.21 thread.c
--- dlls/ntdll/thread.c 23 Aug 2004 18:52:54 -0000 1.21
+++ dlls/ntdll/thread.c 18 Sep 2004 03:30:18 -0000
@@ -216,6 +216,12 @@
int request_pipe[2];
NTSTATUS status;
+ if( ! is_current_process( process ) )
+ {
+ ERR("Unsupported on other process\n");
+ return STATUS_ACCESS_DENIED;
+ }
+
if (pipe( request_pipe ) == -1) return STATUS_TOO_MANY_OPENED_FILES;
fcntl( request_pipe[1], F_SETFD, 1 ); /* set close on exec flag */
wine_server_send_fd( request_pipe[0] );
Index: dlls/ntdll/virtual.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/virtual.c,v
retrieving revision 1.38
diff -u -r1.38 virtual.c
--- dlls/ntdll/virtual.c 18 Aug 2004 00:04:58 -0000 1.38
+++ dlls/ntdll/virtual.c 18 Sep 2004 03:30:24 -0000
@@ -1028,7 +1028,7 @@
*
* Check whether a process handle is for the current process.
*/
-static BOOL is_current_process( HANDLE handle )
+BOOL is_current_process( HANDLE handle )
{
BOOL ret = FALSE;
More information about the wine-patches
mailing list