ReactOS 0.4.17-dev-470-gf9e3448
NtGetCurrentProcessorNumberEx.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: Tests for NtGetCurrentProcessorNumberEx
5 * COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
6 */
7
8#include "precomp.h"
9#include <winnls.h>
10
11typedef
16
18
20{
21 PROCESSOR_NUMBER ProcessorNumber;
23
24 HINSTANCE hinstNtdll = GetModuleHandleA("ntdll.dll");
25 pNtGetCurrentProcessorNumberEx = (FN_NtGetCurrentProcessorNumberEx*)GetProcAddress(hinstNtdll, "NtGetCurrentProcessorNumberEx");
27 {
28 skip("NtGetCurrentProcessorNumberEx is not available\n");
29 return;
30 }
31
32 memset(&ProcessorNumber, 0xAA, sizeof(ProcessorNumber));
33 Status = pNtGetCurrentProcessorNumberEx(&ProcessorNumber);
35 ok(ProcessorNumber.Group < 64, "Processor group is out of range");
36 ok(ProcessorNumber.Number < 64, "Processor number is out of range");
37 ok(ProcessorNumber.Reserved == 0, "Reserved field is not zero");
38
41
42 Status = pNtGetCurrentProcessorNumberEx((PVOID)(ULONG_PTR)0xDEADDEADDEADDEADull);
44}
FN_NtGetCurrentProcessorNumberEx * pNtGetCurrentProcessorNumberEx
NTSTATUS NTAPI FN_NtGetCurrentProcessorNumberEx(_Out_ PPROCESSOR_NUMBER)
#define ok_eq_hex(value, expected)
Definition: apitest.h:134
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
#define STATUS_ACCESS_VIOLATION
Status
Definition: gdiplustypes.h:24
#define _Out_
Definition: no_sal2.h:160
* PPROCESSOR_NUMBER
Definition: ntbasedef.h:654
PROCESSOR_NUMBER
Definition: ntbasedef.h:654
NTSTATUS NTAPI NtGetCurrentProcessorNumberEx(_Out_ PPROCESSOR_NUMBER ProcessorNumber)
Definition: processor.c:55
#define memset(x, y, z)
Definition: compat.h:39
#define STATUS_SUCCESS
Definition: shellext.h:65
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65