mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[NTDLL_APITEST] Add test for NtGetCurrentProcessorNumberEx
This commit is contained in:
@@ -62,6 +62,7 @@ list(APPEND SOURCE
|
||||
NtDuplicateToken.c
|
||||
NtFilterToken.c
|
||||
NtFreeVirtualMemory.c
|
||||
NtGetCurrentProcessorNumberEx.c
|
||||
NtImpersonateAnonymousToken.c
|
||||
NtLoadUnloadKey.c
|
||||
NtMapViewOfSection.c
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* PROJECT: ReactOS api tests
|
||||
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
||||
* PURPOSE: Tests for NtGetCurrentProcessorNumberEx
|
||||
* COPYRIGHT: Copyright 2025 Timo Kreuzer <[email protected]>
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
#include <winnls.h>
|
||||
|
||||
typedef
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
FN_NtGetCurrentProcessorNumberEx(
|
||||
_Out_ PPROCESSOR_NUMBER);
|
||||
|
||||
FN_NtGetCurrentProcessorNumberEx* pNtGetCurrentProcessorNumberEx;
|
||||
|
||||
START_TEST(NtGetCurrentProcessorNumberEx)
|
||||
{
|
||||
PROCESSOR_NUMBER ProcessorNumber;
|
||||
NTSTATUS Status;
|
||||
|
||||
HINSTANCE hinstNtdll = GetModuleHandleA("ntdll.dll");
|
||||
pNtGetCurrentProcessorNumberEx = (FN_NtGetCurrentProcessorNumberEx*)GetProcAddress(hinstNtdll, "NtGetCurrentProcessorNumberEx");
|
||||
if (!pNtGetCurrentProcessorNumberEx)
|
||||
{
|
||||
skip("NtGetCurrentProcessorNumberEx is not available\n");
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&ProcessorNumber, 0xAA, sizeof(ProcessorNumber));
|
||||
Status = pNtGetCurrentProcessorNumberEx(&ProcessorNumber);
|
||||
ok_eq_hex(Status, STATUS_SUCCESS);
|
||||
ok(ProcessorNumber.Group < 64, "Processor group is out of range");
|
||||
ok(ProcessorNumber.Number < 64, "Processor number is out of range");
|
||||
ok(ProcessorNumber.Reserved == 0, "Reserved field is not zero");
|
||||
|
||||
Status = pNtGetCurrentProcessorNumberEx(NULL);
|
||||
ok_eq_hex(Status, STATUS_ACCESS_VIOLATION);
|
||||
|
||||
Status = pNtGetCurrentProcessorNumberEx((PVOID)(ULONG_PTR)0xDEADDEADDEADDEADull);
|
||||
ok_eq_hex(Status, STATUS_ACCESS_VIOLATION);
|
||||
}
|
||||
Reference in New Issue
Block a user