Fixed NtQueryInformationProcess to return correct information and

error code for ProcessDebugPort when no debugger is attached.
This commit is contained in:
Laurent Pinchart 2002-05-01 22:02:02 +00:00 committed by Alexandre Julliard
parent 0314a65a58
commit b50a532aff
1 changed files with 27 additions and 8 deletions

View File

@ -116,15 +116,34 @@ NTSTATUS WINAPI NtQueryInformationProcess(
IN ULONG ProcessInformationLength,
OUT PULONG ReturnLength)
{
FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength,ReturnLength
);
/* "These are not the debuggers you are looking for." */
if (ProcessInformationClass == ProcessDebugPort)
/* set it to 0 aka "no debugger" to satisfy copy protections */
memset(ProcessInformation,0,ProcessInformationLength);
NTSTATUS ret = STATUS_SUCCESS;
ULONG len = 0;
return 0;
switch (ProcessInformationClass) {
case ProcessDebugPort:
/* "These are not the debuggers you are looking for." */
/* set it to 0 aka "no debugger" to satisfy copy protections */
if (ProcessInformationLength == 4)
{
memset(ProcessInformation,0,ProcessInformationLength);
len = 4;
}
else
ret = STATUS_INFO_LENGTH_MISMATCH;
break;
default:
FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
ProcessHandle,ProcessInformationClass,
ProcessInformation,ProcessInformationLength,
ReturnLength
);
break;
}
if (ReturnLength)
*ReturnLength = len;
return ret;
}
/******************************************************************************