Process Hacker
secedit.c File Reference
#include <phgui.h>
#include <secedit.h>
#include <seceditp.h>

Go to the source code of this file.

Functions

FORCEINLINE VOID PhpSecurityEditorInitialization (VOID)
 
HPROPSHEETPAGE 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.
 
VOID 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.
 
ISecurityInformation * PhSecurityInformation_Create (_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)
 
HRESULT STDMETHODCALLTYPE PhSecurityInformation_QueryInterface (_In_ ISecurityInformation *This, _In_ REFIID Riid, _Out_ PVOID *Object)
 
ULONG STDMETHODCALLTYPE PhSecurityInformation_AddRef (_In_ ISecurityInformation *This)
 
ULONG STDMETHODCALLTYPE PhSecurityInformation_Release (_In_ ISecurityInformation *This)
 
HRESULT STDMETHODCALLTYPE PhSecurityInformation_GetObjectInformation (_In_ ISecurityInformation *This, _Out_ PSI_OBJECT_INFO ObjectInfo)
 
HRESULT STDMETHODCALLTYPE PhSecurityInformation_GetSecurity (_In_ ISecurityInformation *This, _In_ SECURITY_INFORMATION RequestedInformation, _Out_ PSECURITY_DESCRIPTOR *SecurityDescriptor, _In_ BOOL Default)
 
HRESULT STDMETHODCALLTYPE PhSecurityInformation_SetSecurity (_In_ ISecurityInformation *This, _In_ SECURITY_INFORMATION SecurityInformation, _In_ PSECURITY_DESCRIPTOR SecurityDescriptor)
 
HRESULT STDMETHODCALLTYPE PhSecurityInformation_GetAccessRights (_In_ ISecurityInformation *This, _In_ const GUID *ObjectType, _In_ ULONG Flags, _Out_ PSI_ACCESS *Access, _Out_ PULONG Accesses, _Out_ PULONG DefaultAccess)
 
HRESULT STDMETHODCALLTYPE PhSecurityInformation_MapGeneric (_In_ ISecurityInformation *This, _In_ const GUID *ObjectType, _In_ PUCHAR AceFlags, _Inout_ PACCESS_MASK Mask)
 
HRESULT STDMETHODCALLTYPE PhSecurityInformation_GetInheritTypes (_In_ ISecurityInformation *This, _Out_ PSI_INHERIT_TYPE *InheritTypes, _Out_ PULONG InheritTypesCount)
 
HRESULT STDMETHODCALLTYPE PhSecurityInformation_PropertySheetPageCallback (_In_ ISecurityInformation *This, _In_ HWND hwnd, _In_ UINT uMsg, _In_ SI_PAGE_TYPE uPage)
 
NTSTATUS PhpGetObjectSecurityWithTimeout (_In_ HANDLE Handle, _In_ SECURITY_INFORMATION SecurityInformation, _Out_ PSECURITY_DESCRIPTOR *SecurityDescriptor)
 
_Callback_ NTSTATUS PhStdGetObjectSecurity (_Out_ PSECURITY_DESCRIPTOR *SecurityDescriptor, _In_ SECURITY_INFORMATION SecurityInformation, _In_opt_ PVOID Context)
 Retrieves the security descriptor of an object.
 
_Callback_ NTSTATUS PhStdSetObjectSecurity (_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ SECURITY_INFORMATION SecurityInformation, _In_opt_ PVOID Context)
 Modifies the security descriptor of an object.
 
NTSTATUS PhGetSeObjectSecurity (_In_ HANDLE Handle, _In_ ULONG ObjectType, _In_ SECURITY_INFORMATION SecurityInformation, _Out_ PSECURITY_DESCRIPTOR *SecurityDescriptor)
 
NTSTATUS PhSetSeObjectSecurity (_In_ HANDLE Handle, _In_ ULONG ObjectType, _In_ SECURITY_INFORMATION SecurityInformation, _In_ PSECURITY_DESCRIPTOR SecurityDescriptor)
 

Function Documentation

HPROPSHEETPAGE 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.

VOID 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.

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

Definition at line 510 of file secedit.c.

NTSTATUS PhpGetObjectSecurityWithTimeout ( _In_ HANDLE  Handle,
_In_ SECURITY_INFORMATION  SecurityInformation,
_Out_ PSECURITY_DESCRIPTOR *  SecurityDescriptor 
)

Definition at line 361 of file secedit.c.

FORCEINLINE VOID PhpSecurityEditorInitialization ( VOID  )

Definition at line 45 of file secedit.c.

ULONG STDMETHODCALLTYPE PhSecurityInformation_AddRef ( _In_ ISecurityInformation *  This)

Definition at line 208 of file secedit.c.

ISecurityInformation* PhSecurityInformation_Create ( _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 
)

Definition at line 150 of file secedit.c.

HRESULT STDMETHODCALLTYPE PhSecurityInformation_GetAccessRights ( _In_ ISecurityInformation *  This,
_In_ const GUID *  ObjectType,
_In_ ULONG  Flags,
_Out_ PSI_ACCESS *  Access,
_Out_ PULONG  Accesses,
_Out_ PULONG  DefaultAccess 
)

Definition at line 314 of file secedit.c.

HRESULT STDMETHODCALLTYPE PhSecurityInformation_GetInheritTypes ( _In_ ISecurityInformation *  This,
_Out_ PSI_INHERIT_TYPE *  InheritTypes,
_Out_ PULONG  InheritTypesCount 
)

Definition at line 342 of file secedit.c.

HRESULT STDMETHODCALLTYPE PhSecurityInformation_GetObjectInformation ( _In_ ISecurityInformation *  This,
_Out_ PSI_OBJECT_INFO  ObjectInfo 
)

Definition at line 240 of file secedit.c.

HRESULT STDMETHODCALLTYPE PhSecurityInformation_GetSecurity ( _In_ ISecurityInformation *  This,
_In_ SECURITY_INFORMATION  RequestedInformation,
_Out_ PSECURITY_DESCRIPTOR *  SecurityDescriptor,
_In_ BOOL  Default 
)

Definition at line 261 of file secedit.c.

HRESULT STDMETHODCALLTYPE PhSecurityInformation_MapGeneric ( _In_ ISecurityInformation *  This,
_In_ const GUID *  ObjectType,
_In_ PUCHAR  AceFlags,
_Inout_ PACCESS_MASK  Mask 
)

Definition at line 332 of file secedit.c.

HRESULT STDMETHODCALLTYPE PhSecurityInformation_PropertySheetPageCallback ( _In_ ISecurityInformation *  This,
_In_ HWND  hwnd,
_In_ UINT  uMsg,
_In_ SI_PAGE_TYPE  uPage 
)

Definition at line 351 of file secedit.c.

HRESULT STDMETHODCALLTYPE PhSecurityInformation_QueryInterface ( _In_ ISecurityInformation *  This,
_In_ REFIID  Riid,
_Out_ PVOID *  Object 
)

Definition at line 188 of file secedit.c.

ULONG STDMETHODCALLTYPE PhSecurityInformation_Release ( _In_ ISecurityInformation *  This)

Definition at line 219 of file secedit.c.

HRESULT STDMETHODCALLTYPE PhSecurityInformation_SetSecurity ( _In_ ISecurityInformation *  This,
_In_ SECURITY_INFORMATION  SecurityInformation,
_In_ PSECURITY_DESCRIPTOR  SecurityDescriptor 
)

Definition at line 293 of file secedit.c.

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

Definition at line 540 of file secedit.c.

_Callback_ NTSTATUS 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.

_Callback_ NTSTATUS 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.