#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)
NTSYSCALLAPI
NTSTATUS
NTAPI
NtCreateProfile(
_Out_ PHANDLE ProfileHandle,
_In_opt_ HANDLE Process,
_In_ PVOID ProfileBase,
_In_ SIZE_T ProfileSize,
_In_ ULONG BucketSize,
_In_reads_bytes_(BufferSize) PULONG Buffer,
_In_ ULONG BufferSize,
_In_ KPROFILE_SOURCE ProfileSource,
_In_ KAFFINITY Affinity
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwCreateProfile(
_Out_ PHANDLE ProfileHandle,
_In_opt_ HANDLE Process,
_In_ PVOID ProfileBase,
_In_ SIZE_T ProfileSize,
_In_ ULONG BucketSize,
_In_reads_bytes_(BufferSize) PULONG Buffer,
_In_ ULONG BufferSize,
_In_ KPROFILE_SOURCE ProfileSource,
_In_ KAFFINITY Affinity
);
View code on GitHub
Function NtCreateProfile
creates Profile Object.
Profile Objects are used for application profiling. There're 24 profile counters defined in KPROFILE_SOURCE
enumeration type. Single Profile Object can be used to get information from one performance counter.
Result of call - HANDLE
to Profile Object.
HANDLE
to Process Object to profile. Not required if profiled code is placed in Kernel address space (above 0x80000000).
Start address of profiling.
Size of profiled memory block.
??? (cannot be less than 2).
Caller's allocated buffer for data.
Size of buffer, in bytes.
Identifier of performance counter. See KPROFILE_SOURCE
enumeration type for possible values.
Processor affinity mask. It defines processors to ask about performance counter.
Privilege for UserMode: SE_PROF_SINGLE_PROCESS_PRIVILEGE
Privilege for KernelMode: SE_SYSTEM_PROFILE_PRIVILEGE