NtGetCurrentProcessorNumber - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTPSAPI_H
//
// Threads
//
#if (PHNT_MODE != PHNT_MODE_KERNEL)

/**
 * Retrieves the number of the current processor.
 *
 * \return ULONG The number of the current processor.
 * \sa https://learn.microsoft.com/en-us/windows/win32/procthread/ntgetcurrentprocessornumber
 */
NTSYSCALLAPI
ULONG
NTAPI
NtGetCurrentProcessorNumber(
    VOID
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
ULONG
NTAPI
ZwGetCurrentProcessorNumber(
    VOID
    );

#endif

View code on GitHub
ULONG WINAPI NtGetCurrentProcessorNumber(void);
View the official Win32 development documentation

NtDoc

This function is documented in Windows SDK.

Win32 development documentation (ntgetcurrentprocessornumber)

NtGetCurrentProcessorNumber function

[NtGetCurrentProcessorNumber may be altered or unavailable in future versions of Windows. Applications should use the GetCurrentProcessorNumber function instead.]

Retrieves the number of the processor the current thread was running on during the call to this function.

Parameters

This function has no parameters.

Return value

The function returns the current processor number.

Remarks

This function is used to provide information for estimating process performance.

This function has no associated import library. You must use the LoadLibrary and GetProcAddress functions to dynamically link to Ntdll.dll.

Requirements

Requirement Value
DLL
Ntdll.dll

See also

Multiple Processors

Process and Thread Functions

Processes