Skip to content

Commit

Permalink
phnt: Fix availability of some functions (#2425)
Browse files Browse the repository at this point in the history
  • Loading branch information
xdqi authored Feb 17, 2025
1 parent 17d20e1 commit 0e3c183
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
5 changes: 4 additions & 1 deletion phnt/include/ntexapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ NtTranslateFilePath(
_Out_writes_bytes_opt_(*OutputFilePathLength) PFILE_PATH OutputFilePath,
_Inout_opt_ PULONG OutputFilePathLength
);
#endif

#if (PHNT_VERSION >= PHNT_WS03)
/**
* The NtAddDriverEntry routine adds a new driver entry to the system boot configuration.
*
Expand Down Expand Up @@ -6914,7 +6916,7 @@ NtQueryInformationAtom(
FLG_ENABLE_HANDLE_EXCEPTIONS)

// Licensing

#if (PHNT_VERSION >= PHNT_VISTA)
NTSYSCALLAPI
NTSTATUS
NTAPI
Expand All @@ -6925,6 +6927,7 @@ NtQueryLicenseValue(
_In_ ULONG DataSize,
_Out_ PULONG ResultDataSize
);
#endif

// Misc.

Expand Down
10 changes: 10 additions & 0 deletions phnt/include/ntmisc.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ typedef enum _SECURE_SETTING_VALUE_TYPE
SecureSettingValueTypeUnknown = 4
} SECURE_SETTING_VALUE_TYPE, *PSECURE_SETTING_VALUE_TYPE;

#if (PHNT_VERSION >= PHNT_REDSTONE)
// rev
NTSYSCALLAPI
NTSTATUS
Expand All @@ -82,7 +83,9 @@ NtQuerySecurityPolicy(
_Out_writes_bytes_opt_(*ValueSize) PVOID Value,
_Inout_ PULONG ValueSize
);
#endif

#if (PHNT_VERSION >= PHNT_20H1)
// rev
NTSYSCALLAPI
NTSTATUS
Expand Down Expand Up @@ -129,7 +132,9 @@ NtDirectGraphicsCall(
_Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
_Out_ PULONG ReturnLength
);
#endif

#if (PHNT_VERSION >= PHNT_WIN11_22H2)
// rev
NTSYSCALLAPI
NTSTATUS
Expand Down Expand Up @@ -163,6 +168,9 @@ NtSetInformationCpuPartition(
_Reserved_ ULONG,
_Reserved_ ULONG
);
#endif

#if (PHNT_VERSION >= PHNT_REDSTONE2)

// Process KeepAlive (also WakeCounter)

Expand All @@ -183,3 +191,5 @@ NtAcquireProcessActivityReference(
);

#endif

#endif
4 changes: 4 additions & 0 deletions phnt/include/ntpsapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -2245,6 +2245,7 @@ NtResumeThread(
_Out_opt_ PULONG PreviousSuspendCount
);

#if (PHNT_VERSION >= PHNT_WS03)
/**
* Retrieves the number of the current processor.
*
Expand All @@ -2256,6 +2257,7 @@ NTAPI
NtGetCurrentProcessorNumber(
VOID
);
#endif

#if (PHNT_VERSION >= PHNT_WIN7)
/**
Expand Down Expand Up @@ -3173,6 +3175,7 @@ typedef struct _PS_CREATE_INFO

// end_private

#if (PHNT_VERSION >= PHNT_VISTA)
/**
* Creates a new process and primary thread.
*
Expand Down Expand Up @@ -3258,6 +3261,7 @@ NtCreateThreadEx(
_In_ SIZE_T MaximumStackSize,
_In_opt_ PPS_ATTRIBUTE_LIST AttributeList
);
#endif

#endif

Expand Down
6 changes: 6 additions & 0 deletions phnt/include/ntregapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,7 @@ NtLoadKey2(
_In_ ULONG Flags
);

#if (PHNT_VERSION >= PHNT_WS03)
/**
* Loads a registry key from a file with extended options.
*
Expand All @@ -1016,6 +1017,7 @@ NtLoadKeyEx(
_Out_opt_ PHANDLE RootHandle,
_Reserved_ PVOID Reserved // previously PIO_STATUS_BLOCK
);
#endif

#if (PHNT_VERSION >= PHNT_20H1)
// rev by tyranid
Expand Down Expand Up @@ -1143,6 +1145,7 @@ NtUnloadKey(
_In_ POBJECT_ATTRIBUTES TargetKey
);

#if PHNT_VERSION >= PHNT_WS03
/**
* Unloads a registry key with additional flags.
*
Expand All @@ -1158,6 +1161,7 @@ NtUnloadKey2(
_In_ POBJECT_ATTRIBUTES TargetKey,
_In_ ULONG Flags
);
#endif

/**
* Unloads a registry key and optionally signals an event.
Expand Down Expand Up @@ -1255,6 +1259,7 @@ NtQueryOpenSubKeys(
_Out_ PULONG HandleCount
);

#if (PHNT_VERSION >= PHNT_WS03)
/**
* Queries the open subkeys of a registry key with additional information.
*
Expand All @@ -1274,6 +1279,7 @@ NtQueryOpenSubKeysEx(
_Out_writes_bytes_opt_(BufferLength) PVOID Buffer,
_Out_ PULONG RequiredSize
);
#endif

/**
* Initializes the registry.
Expand Down

0 comments on commit 0e3c183

Please sign in to comment.