Commit 97825b9c authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

ntdll: Return failure from RtlQueryProcessDebugInformation.

Some DRM call it with GetCurrentThreadId(), although they don't seem to mind about the result. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent e0a1bdf2
......@@ -114,7 +114,16 @@ NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(IN PDEBUG_BUFFER iBuf)
NTSTATUS WINAPI RtlQueryProcessDebugInformation(IN ULONG iProcessId, IN ULONG iDebugInfoMask, IN OUT PDEBUG_BUFFER iBuf)
{
NTSTATUS nts = STATUS_SUCCESS;
CLIENT_ID cid;
NTSTATUS status;
HANDLE process;
cid.UniqueProcess = ULongToHandle( iProcessId );
cid.UniqueThread = 0;
if ((status = NtOpenProcess( &process, PROCESS_QUERY_LIMITED_INFORMATION, NULL, &cid ))) return status;
NtClose( process );
FIXME("(%d, %x, %p): stub\n", iProcessId, iDebugInfoMask, iBuf);
iBuf->InfoClassMask = iDebugInfoMask;
......@@ -139,5 +148,5 @@ NTSTATUS WINAPI RtlQueryProcessDebugInformation(IN ULONG iProcessId, IN ULONG iD
}
TRACE("returns:%p\n", iBuf);
dump_DEBUG_BUFFER(iBuf);
return nts;
return status;
}
......@@ -132,6 +132,24 @@ static void InitFunctionPtrs(void)
ok(strlen(src) == 15, "Source must be 16 bytes long!\n");
}
static void test_RtlQueryProcessDebugInformation(void)
{
DEBUG_BUFFER *buffer;
NTSTATUS status;
buffer = RtlCreateQueryDebugBuffer( 0, 0 );
ok( buffer != NULL, "RtlCreateQueryDebugBuffer returned NULL" );
status = RtlQueryProcessDebugInformation( GetCurrentThreadId(), PDI_HEAPS | PDI_HEAP_BLOCKS, buffer );
ok( status == STATUS_INVALID_CID, "RtlQueryProcessDebugInformation returned %x\n", status );
status = RtlQueryProcessDebugInformation( GetCurrentProcessId(), PDI_HEAPS | PDI_HEAP_BLOCKS, buffer );
ok( !status, "RtlQueryProcessDebugInformation returned %x\n", status );
status = RtlDestroyQueryDebugBuffer( buffer );
ok( !status, "RtlDestroyQueryDebugBuffer returned %x\n", status );
}
#define COMP(str1,str2,cmplen,len) size = RtlCompareMemory(str1, str2, cmplen); \
ok(size == len, "Expected %ld, got %ld\n", size, (SIZE_T)len)
......@@ -3668,6 +3686,7 @@ START_TEST(rtl)
{
InitFunctionPtrs();
test_RtlQueryProcessDebugInformation();
test_RtlCompareMemory();
test_RtlCompareMemoryUlong();
test_RtlMoveMemory();
......
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