Process Hacker
secedit.h File Reference

Go to the source code of this file.

Data Structures

struct  _PH_ACCESS_ENTRY
 
struct  _PH_STD_OBJECT_SECURITY
 

Typedefs

typedef struct _PH_ACCESS_ENTRY PH_ACCESS_ENTRY
 
typedef struct _PH_ACCESS_ENTRYPPH_ACCESS_ENTRY
 
typedef struct
_PH_STD_OBJECT_SECURITY 
PH_STD_OBJECT_SECURITY
 
typedef struct
_PH_STD_OBJECT_SECURITY
PPH_STD_OBJECT_SECURITY
 

Functions

PHLIBAPI HPROPSHEETPAGE NTAPI PhCreateSecurityPage (_In_ PWSTR ObjectName, _In_ PPH_GET_OBJECT_SECURITY GetObjectSecurity, _In_ PPH_SET_OBJECT_SECURITY SetObjectSecurity, _In_opt_ PVOID Context, _In_ PPH_ACCESS_ENTRY AccessEntries, _In_ ULONG NumberOfAccessEntries)
 Creates a security editor page.
 
PHLIBAPI VOID NTAPI PhEditSecurity (_In_ HWND hWnd, _In_ PWSTR ObjectName, _In_ PPH_GET_OBJECT_SECURITY GetObjectSecurity, _In_ PPH_SET_OBJECT_SECURITY SetObjectSecurity, _In_opt_ PVOID Context, _In_ PPH_ACCESS_ENTRY AccessEntries, _In_ ULONG NumberOfAccessEntries)
 Displays a security editor dialog.
 
FORCEINLINE ACCESS_MASK PhGetAccessForGetSecurity (_In_ SECURITY_INFORMATION SecurityInformation)
 
FORCEINLINE ACCESS_MASK PhGetAccessForSetSecurity (_In_ SECURITY_INFORMATION SecurityInformation)
 
PHLIBAPI _Callback_ NTSTATUS NTAPI PhStdGetObjectSecurity (_Out_ PSECURITY_DESCRIPTOR *SecurityDescriptor, _In_ SECURITY_INFORMATION SecurityInformation, _In_opt_ PVOID Context)
 Retrieves the security descriptor of an object.
 
PHLIBAPI _Callback_ NTSTATUS NTAPI PhStdSetObjectSecurity (_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ SECURITY_INFORMATION SecurityInformation, _In_opt_ PVOID Context)
 Modifies the security descriptor of an object.
 
PHLIBAPI NTSTATUS NTAPI PhGetSeObjectSecurity (_In_ HANDLE Handle, _In_ ULONG ObjectType, _In_ SECURITY_INFORMATION SecurityInformation, _Out_ PSECURITY_DESCRIPTOR *SecurityDescriptor)
 
PHLIBAPI NTSTATUS NTAPI PhSetSeObjectSecurity (_In_ HANDLE Handle, _In_ ULONG ObjectType, _In_ SECURITY_INFORMATION SecurityInformation, _In_ PSECURITY_DESCRIPTOR SecurityDescriptor)
 
PHLIBAPI BOOLEAN NTAPI PhGetAccessEntries (_In_ PWSTR Type, _Out_ PPH_ACCESS_ENTRY *AccessEntries, _Out_ PULONG NumberOfAccessEntries)
 Gets access entries for an object type.
 
PHLIBAPI PPH_STRING NTAPI PhGetAccessString (_In_ ACCESS_MASK Access, _In_ PPH_ACCESS_ENTRY AccessEntries, _In_ ULONG NumberOfAccessEntries)
 Creates a string representation of an access mask.
 

Typedef Documentation

Function Documentation

PHLIBAPI HPROPSHEETPAGE NTAPI PhCreateSecurityPage ( _In_ PWSTR  ObjectName,
_In_ PPH_GET_OBJECT_SECURITY  GetObjectSecurity,
_In_ PPH_SET_OBJECT_SECURITY  SetObjectSecurity,
_In_opt_ PVOID  Context,
_In_ PPH_ACCESS_ENTRY  AccessEntries,
_In_ ULONG  NumberOfAccessEntries 
)

Creates a security editor page.

Parameters
ObjectNameThe name of the object.
GetObjectSecurityA callback function executed to retrieve the security descriptor of the object.
SetObjectSecurityA callback function executed to modify the security descriptor of the object.
ContextA user-defined value to pass to the callback functions.
AccessEntriesAn array of access mask descriptors.
NumberOfAccessEntriesThe number of elements in AccessEntries.

Definition at line 73 of file secedit.c.

PHLIBAPI VOID NTAPI PhEditSecurity ( _In_ HWND  hWnd,
_In_ PWSTR  ObjectName,
_In_ PPH_GET_OBJECT_SECURITY  GetObjectSecurity,
_In_ PPH_SET_OBJECT_SECURITY  SetObjectSecurity,
_In_opt_ PVOID  Context,
_In_ PPH_ACCESS_ENTRY  AccessEntries,
_In_ ULONG  NumberOfAccessEntries 
)

Displays a security editor dialog.

Parameters
hWndThe parent window of the dialog.
ObjectNameThe name of the object.
GetObjectSecurityA callback function executed to retrieve the security descriptor of the object.
SetObjectSecurityA callback function executed to modify the security descriptor of the object.
ContextA user-defined value to pass to the callback functions.
AccessEntriesAn array of access mask descriptors.
NumberOfAccessEntriesThe number of elements in AccessEntries.

Definition at line 119 of file secedit.c.

PHLIBAPI BOOLEAN NTAPI PhGetAccessEntries ( _In_ PWSTR  Type,
_Out_ PPH_ACCESS_ENTRY AccessEntries,
_Out_ PULONG  NumberOfAccessEntries 
)

Gets access entries for an object type.

Parameters
TypeThe name of the object type.
AccessEntriesA variable which receives an array of access entry structures. You must free the buffer with PhFree() when you no longer need it.
NumberOfAccessEntriesA variable which receives the number of access entry structures returned in AccessEntries.

Definition at line 612 of file secdata.c.

FORCEINLINE ACCESS_MASK PhGetAccessForGetSecurity ( _In_ SECURITY_INFORMATION  SecurityInformation)

Definition at line 47 of file secedit.h.

FORCEINLINE ACCESS_MASK PhGetAccessForSetSecurity ( _In_ SECURITY_INFORMATION  SecurityInformation)

Definition at line 70 of file secedit.h.

PHLIBAPI PPH_STRING NTAPI PhGetAccessString ( _In_ ACCESS_MASK  Access,
_In_ PPH_ACCESS_ENTRY  AccessEntries,
_In_ ULONG  NumberOfAccessEntries 
)

Creates a string representation of an access mask.

Parameters
AccessThe access mask.
AccessEntriesAn array of access entry structures. You can call PhGetAccessEntries() to retrieve the access entry structures for a standard object type.
NumberOfAccessEntriesThe number of elements in AccessEntries.
Returns
The string representation of Access.

Definition at line 723 of file secdata.c.

PHLIBAPI NTSTATUS NTAPI PhGetSeObjectSecurity ( _In_ HANDLE  Handle,
_In_ ULONG  ObjectType,
_In_ SECURITY_INFORMATION  SecurityInformation,
_Out_ PSECURITY_DESCRIPTOR *  SecurityDescriptor 
)

Definition at line 510 of file secedit.c.

PHLIBAPI NTSTATUS NTAPI PhSetSeObjectSecurity ( _In_ HANDLE  Handle,
_In_ ULONG  ObjectType,
_In_ SECURITY_INFORMATION  SecurityInformation,
_In_ PSECURITY_DESCRIPTOR  SecurityDescriptor 
)

Definition at line 540 of file secedit.c.

PHLIBAPI _Callback_ NTSTATUS NTAPI PhStdGetObjectSecurity ( _Out_ PSECURITY_DESCRIPTOR *  SecurityDescriptor,
_In_ SECURITY_INFORMATION  SecurityInformation,
_In_opt_ PVOID  Context 
)

Retrieves the security descriptor of an object.

Parameters
SecurityDescriptorA variable which receives a pointer to the security descriptor of the object. The security descriptor must be freed using PhFree() when no longer needed.
SecurityInformationThe security information to retrieve.
ContextA pointer to a PH_STD_OBJECT_SECURITY structure describing the object.
Remarks
This function may be used for the GetObjectSecurity callback in PhCreateSecurityPage() or PhEditSecurity().

Definition at line 423 of file secedit.c.

PHLIBAPI _Callback_ NTSTATUS NTAPI PhStdSetObjectSecurity ( _In_ PSECURITY_DESCRIPTOR  SecurityDescriptor,
_In_ SECURITY_INFORMATION  SecurityInformation,
_In_opt_ PVOID  Context 
)

Modifies the security descriptor of an object.

Parameters
SecurityDescriptorA security descriptor containing security information to set.
SecurityInformationThe security information to retrieve.
ContextA pointer to a PH_STD_OBJECT_SECURITY structure describing the object.
Remarks
This function may be used for the SetObjectSecurity callback in PhCreateSecurityPage() or PhEditSecurity().

Definition at line 475 of file secedit.c.