Commit 8657ad87 authored by Alexander Yaworsky's avatar Alexander Yaworsky Committed by Alexandre Julliard

Make RtlCreateUserThread fail if process handle is not for the current

process.
parent 9d590d50
......@@ -93,6 +93,8 @@ extern DWORD VIRTUAL_HandleFault(LPCVOID addr);
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,
......
......@@ -216,6 +216,12 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
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] );
......
......@@ -1028,7 +1028,7 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, DWORD total_size
*
* 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment