Specify correct access rights in NtOpenProcess when sending control events.

svn path=/trunk/; revision=14249
This commit is contained in:
Filip Navara 2005-03-21 08:32:22 +00:00
parent fd19aa00e6
commit 07647a0b62

View file

@ -94,7 +94,8 @@ ConioConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData)
/* using OpenProcess is not optimal due to HANDLE vs. DWORD PIDs... */ /* using OpenProcess is not optimal due to HANDLE vs. DWORD PIDs... */
Status = NtOpenProcess(&Process, Status = NtOpenProcess(&Process,
PROCESS_DUP_HANDLE, PROCESS_DUP_HANDLE | PROCESS_VM_OPERATION |
PROCESS_VM_WRITE | PROCESS_CREATE_THREAD,
&ObjectAttributes, &ObjectAttributes,
&ClientId); &ClientId);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -110,7 +111,7 @@ ConioConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData)
(PVOID) Event, 0, NULL); (PVOID) Event, 0, NULL);
if (NULL == Thread) if (NULL == Thread)
{ {
DPRINT1("Failed thread creation\n"); DPRINT1("Failed thread creation (Error: 0x%x)\n", GetLastError());
CloseHandle(Process); CloseHandle(Process);
return; return;
} }