Authorization Functions


DSCreateSecurityPage Function

The DSCreateSecurityPage function creates a security property page for an Active Directory object. The resulting property page can be added to a property sheet.

Syntax

C++
HRESULT WINAPI DSCreateSecurityPage(
  __in      LPCWSTR pwszObjectPath,
  __in_opt  LPCWSTR pwszObjectClass,
  __in      DWORD dwFlags,
  __out     HPROPSHEETPAGE *phPage,
  __in_opt  PFNREADOBJECTSECURITY pfnReadSD,
  __in_opt  PFNWRITEOBJECTSECURITY pfnWriteSD,
  __in      LPARAM lpContext
);

Parameters

pwszObjectPath [in]

A pointer to a null-terminated wide character string that represents the full Active Directory path for the object.

pwszObjectClass [in, optional]

A pointer to a null-terminated wide character string that represents the object class. This value can be NULL.

dwFlags [in]

Flags used for the security property page. This parameter can be none or any combination of the following flags.

ValueMeaning
DSSI_READ_ONLY
0x00000001

The security properties are read-only.

DSSI_NO_ACCESS_CHECK
0x00000002

No access check is performed.

DSSI_NO_EDIT_SACL
0x00000004

The system access control list (SACL) property is read-only.

DSSI_NO_EDIT_OWNER
0x00000008

The object owner property is read-only.

DSSI_IS_ROOT
0x00000010

The object is a root object.

DSSI_NO_FILTER
0x00000020

TBD

DSSI_NO_READONLY_MESSAGE
0x00000040

TBD

 

phPage [out]

A pointer to a HPROPSHEETPAGE that returns the created security property page.

pfnReadSD [in, optional]

A pointer to a function used to read the security descriptor of the object. This value can be NULL. If pfnReadSD is not NULL, DSCreateSecurityPage calls the function referenced by pfnReadSD to retrieve the security descriptor of the object.

pfnWriteSD [in, optional]

A pointer to a function used to write the security descriptor of the object. This value can be NULL. If pfnWriteSD is not NULL, DSCreateSecurityPage calls the function referenced by pfnWriteSD to write the security descriptor of the object.

lpContext [in]

Context to pass to the functions identified by pfnReadSD or pfnWriteSD.

Return Value

If the function succeeds, the function returns S_OK.

If the function fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

Remarks

The function pointed to by pfnReadSD is defined as follows.

#include <windows.h>

typedef HRESULT (WINAPI *PFNREADOBJECTSECURITY)(
    LPCWSTR,               // Active Directory path of object
    SECURITY_INFORMATION,  // the security information to read
    PSECURITY_DESCRIPTOR*, // the returned security descriptor 
    LPARAM                 // context parameter
);

The DSCreateSecurityPage function will free the security descriptor returned in the third parameter above by a call to the LocalFree function.

The function pointed to by pfnWriteSD is defined as follows.

#include <windows.h>

typedef HRESULT (WINAPI *PFNWRITEOBJECTSECURITY)(
    LPCWSTR,              // Active Directory path of object
    SECURITY_INFORMATION, // the security information to write
    PSECURITY_DESCRIPTOR, // the security descriptor to write
    LPARAM                // context parameter
);

Requirements

Minimum supported clientNone supported
Minimum supported serverWindows Server 2003
HeaderDSSec.h
LibraryDSSec.lib
DLLDSSec.dll

See Also

Basic Security Property Page
ISecurityInformation

Send comments about this topic to Microsoft

Build date: 9/11/2009

Tags :


Page view tracker