Skip to content

Commit

Permalink
Add PhCreateSecurityDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
dmex committed Nov 21, 2023
1 parent 0cdbc7a commit 730347e
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions phlib/include/phnative.h
Original file line number Diff line number Diff line change
Expand Up @@ -982,11 +982,7 @@ PhFreeSid(
_In_ _Post_invalid_ PSID Sid
)
{
#if (PHNT_NATIVE_SID)
return !RtlFreeSid(Sid);
#else
return !!RtlFreeHeap(RtlProcessHeap(), 0, Sid);
#endif
return !!RtlFreeSid(Sid);
}

// rev from RtlFreeUnicodeString (dmex)
Expand All @@ -997,11 +993,20 @@ PhFreeUnicodeString(
_Inout_ _At_(UnicodeString->Buffer, _Frees_ptr_opt_ _Post_invalid_) PUNICODE_STRING UnicodeString
)
{
#ifdef PHNT_INLINE_FREE_UNICODE_STRING
RtlFreeUnicodeString(UnicodeString);
#else
RtlFreeHeap(RtlProcessHeap(), 0, UnicodeString->Buffer);
#endif
}

FORCEINLINE
NTSTATUS
NTAPI
PhCreateSecurityDescriptor(
_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor,
_In_ BYTE Revision
)
{
memset(SecurityDescriptor, 0, sizeof(PISECURITY_DESCRIPTOR));
((PISECURITY_DESCRIPTOR)SecurityDescriptor)->Revision = Revision;
return STATUS_SUCCESS;
}

FORCEINLINE
Expand Down Expand Up @@ -3486,7 +3491,7 @@ NTSTATUS
NTAPI
PhEnumProcessEnclaves(
_In_ HANDLE ProcessHandle,
_In_ PVOID LdrpEnclaveList,
_In_ PVOID LdrEnclaveList,
_In_ PPH_ENUM_PROCESS_ENCLAVES_CALLBACK Callback,
_In_opt_ PVOID Context
);
Expand Down

0 comments on commit 730347e

Please sign in to comment.