Make RtlCreateUserThread fail if process handle is not for the current
process.
This commit is contained in:
parent
9d590d5059
commit
8657ad8704
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue