HyperDbg Debugger
Loading...
Searching...
No Matches
PlatformCpu.c File Reference

Implementation of cross platform APIs for CPU and processor queries. More...

#include "pch.h"

Functions

ULONG PlatformCpuGetActiveProcessorCount (VOID)
 Get the count of active logical processors.
ULONG PlatformCpuGetCurrentProcessorNumber (VOID)
 Get the current logical processor number.

Detailed Description

Implementation of cross platform APIs for CPU and processor queries.

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.19
Date
2026-05-09

Function Documentation

◆ PlatformCpuGetActiveProcessorCount()

ULONG PlatformCpuGetActiveProcessorCount ( VOID )

Get the count of active logical processors.

Returns
ULONG
25{
26#if defined(_WIN32) || defined(_WIN64)
27
28 return KeQueryActiveProcessorCount(0);
29
30#elif defined(__linux__)
31
32# error "Not yet implemented"
33
34#else
35
36# error "Unsupported platform"
37
38#endif
39}

◆ PlatformCpuGetCurrentProcessorNumber()

ULONG PlatformCpuGetCurrentProcessorNumber ( VOID )

Get the current logical processor number.

Returns
ULONG
48{
49#if defined(_WIN32) || defined(_WIN64)
50
51 return KeGetCurrentProcessorNumberEx(NULL);
52
53#elif defined(__linux__)
54
55# error "Not yet implemented"
56
57#else
58
59# error "Unsupported platform"
60
61#endif
62}