[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    GetNumaHighestNodeNumber tests
From:       Chris Moeller <kode54 () gmail ! com>
Date:       2013-07-29 23:32:33
Message-ID: E85A2FE3-35D6-41DB-8607-75026CD995C9 () gmail ! com
[Download RAW message or body]

Here is a basic stand-alone test program, which I should probably learn how to \
implement into the standard testing array.

On my test Windows 7 system with a single processor (4 cores), it outputs the \
following:

Testing NtQuerySystemInformationSystemNumaHighestNodeNumber = 0x37, ...):
... with invalid size returned c0000004
... with valid size returned 0, HighestNodeNumber = 0, ResultLength = 4

Testing GetNumaHighestNodeNumber:
... returned 1, HighestNodeNumber = 0


["numantdll.c" (numantdll.c)]

#include <stdio.h>
#include <windows.h>

typedef enum _SYSTEM_INFORMATION_CLASS {
    SystemBasicInformation = 0,
    SystemCpuInformation = 1,
    SystemPerformanceInformation = 2,
    SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
    Unknown4,
    SystemProcessInformation = 5,
    Unknown6,
    Unknown7,
    SystemProcessorPerformanceInformation = 8,
    Unknown9,
    Unknown10,
    SystemModuleInformation = 11,
    Unknown12,
    Unknown13,
    Unknown14,
    Unknown15,
    SystemHandleInformation = 16,
    Unknown17,
    SystemPageFileInformation = 18,
    Unknown19,
    Unknown20,
    SystemCacheInformation = 21,
    Unknown22,
    SystemInterruptInformation = 23,
    SystemDpcBehaviourInformation = 24,
    SystemFullMemoryInformation = 25,
    SystemNotImplemented6 = 25,
    SystemLoadImage = 26,
    SystemUnloadImage = 27,
    SystemTimeAdjustmentInformation = 28,
    SystemTimeAdjustment = 28,
    SystemSummaryMemoryInformation = 29,
    SystemNotImplemented7 = 29,
    SystemNextEventIdInformation = 30,
    SystemNotImplemented8 = 30,
    SystemEventIdsInformation = 31,
    SystemCrashDumpInformation = 32,
    SystemExceptionInformation = 33,
    SystemCrashDumpStateInformation = 34,
    SystemKernelDebuggerInformation = 35,
    SystemContextSwitchInformation = 36,
    SystemRegistryQuotaInformation = 37,
    SystemCurrentTimeZoneInformation = 44,
    SystemTimeZoneInformation = 44,
    SystemLookasideInformation = 45,
    SystemSetTimeSlipEvent = 46,
    SystemCreateSession = 47,
    SystemDeleteSession = 48,
    SystemInvalidInfoClass4 = 49,
    SystemRangeStartInformation = 50,
    SystemVerifierInformation = 51,
    SystemAddVerifier = 52,
    SystemSessionProcessesInformation	= 53,
    Unknown54,
    SystemNumaHighestNodeNumber = 55,
    Unknown56,
    Unknown57,
    Unknown58,
    Unknown59,
    Unknown60,
    Unknown61,
    Unknown62,
    Unknown63,
    Unknown64,
    Unknown65,
    Unknown66,
    Unknown67,
    Unknown68,
    Unknown69,
    Unknown70,
    Unknown71,
    Unknown72,
    SystemLogicalProcessorInformation = 73,
    SystemInformationClassMax
} SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;

typedef NTSTATUS (WINAPI * pNtQuerySystemInformation)(
	IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
	OUT PVOID SystemInformation,
	IN ULONG Length,
	OUT PULONG ResultLength);

int main(void)
{
	ULONG HighestNodeNumber = ~0, ResultLength = ~0;

	HMODULE hntdll = GetModuleHandle("ntdll.dll");
	pNtQuerySystemInformation NtQuerySystemInformation = (pNtQuerySystemInformation) \
GetProcAddress(hntdll, "NtQuerySystemInformation");

	NTSTATUS status;
	BOOL bstatus;

	fprintf(stderr, "Testing NtQuerySystemInformationSystemNumaHighestNodeNumber = 0x37, \
...):\n");

	status = NtQuerySystemInformation(SystemNumaHighestNodeNumber, &HighestNodeNumber, \
sizeof(HighestNodeNumber) - 1, &ResultLength);

	fprintf(stderr, "... with invalid size returned %x", status);
	if (HighestNodeNumber != ~0) fprintf(stderr, ", HighestNodeNumber = %u", \
HighestNodeNumber);  if (ResultLength != ~0) fprintf(stderr, ", ResultLength = %u", \
ResultLength);  fprintf(stderr, "\n");

	HighestNodeNumber = ~0;
	ResultLength = ~0;

	status = NtQuerySystemInformation(SystemNumaHighestNodeNumber, &HighestNodeNumber, \
sizeof(HighestNodeNumber), &ResultLength);

	fprintf(stderr, "... with valid size returned %x", status);
	if (HighestNodeNumber != ~0 && ResultLength != ~0 && ResultLength >= 4) \
fprintf(stderr, ", HighestNodeNumber = %u", HighestNodeNumber);  if (ResultLength != \
~0) fprintf(stderr, ", ResultLength = %u", ResultLength);  fprintf(stderr, "\n");

	fprintf(stderr, "\nTesting GetNumaHighestNodeNumber:\n");

	bstatus = GetNumaHighestNodeNumber(&HighestNodeNumber);

	fprintf(stderr, "... returned %i, HighestNodeNumber = %u\n", bstatus, \
HighestNodeNumber);

	return 0;
}





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic