1
{******************************************************************************}
3
{ AD Security Property Pages API interface Unit for Object Pascal }
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
6
{ Corporation. All Rights Reserved. }
8
{ The original file is: dssec.h, released Feb 2003. The original Pascal }
9
{ code is: DsSec.pas, released December 2003. The initial developer of the }
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
13
{ Marcel van Brakel. All Rights Reserved. }
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
17
{ You may retrieve the latest version of this file at the Project JEDI }
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net }
20
{ The contents of this file are used with permission, subject to the Mozilla }
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
22
{ in compliance with the License. You may obtain a copy of the License at }
23
{ http://www.mozilla.org/MPL/MPL-1.1.html }
25
{ Software distributed under the License is distributed on an "AS IS" basis, }
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
27
{ the specific language governing rights and limitations under the License. }
29
{ Alternatively, the contents of this file may be used under the terms of the }
30
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
31
{ provisions of the LGPL License are applicable instead of those above. }
32
{ If you wish to allow use of your version of this file only under the terms }
33
{ of the LGPL License and not to allow others to use your version of this file }
34
{ under the MPL, indicate your decision by deleting the provisions above and }
35
{ replace them with the notice and other provisions required by the LGPL }
36
{ License. If you do not delete the provisions above, a recipient may use }
37
{ your version of this file under either the MPL or the LGPL License. }
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
41
{******************************************************************************}
43
// $Id: jwadssec.pas,v 1.1 2005/04/04 07:56:10 marco Exp $
50
{$HPPEMIT '#include "dssec.h"'}
58
JwaWinType, JwaWinNT, JwaPrSht;
60
//+---------------------------------------------------------------------------
62
// Function: PFNREADOBJECTSECURITY
64
// Synopsis: Reads the security descriptor of a DS object
66
// Arguments: [IN LPCWSTR] -- ADS path of DS Object
67
// [IN SECURITY_INFORMATION] -- Which SD parts to read
68
// [OUT PSECURITY_DESCRIPTOR*] -- Return SD here. Caller frees with LocalFree
69
// [IN LPARAM] -- Context param
73
//----------------------------------------------------------------------------
75
// Function: PFNWRITEOBJECTSECURITY
77
// Synopsis: Writes a security descriptor to a DS object
79
// Arguments: [IN LPCWSTR] -- ADS path of DS Object
80
// [IN SECURITY_INFORMATION] -- Which SD parts to write
81
// [OUT PSECURITY_DESCRIPTOR] -- Security descriptor to write
82
// [IN LPARAM] -- Context param
86
//----------------------------------------------------------------------------
89
PFNREADOBJECTSECURITY = function(p1: LPCWSTR; p2: SECURITY_INFORMATION; p3: PPSECURITY_DESCRIPTOR; p4: LPARAM): HRESULT; stdcall;
90
{$EXTERNALSYM PFNREADOBJECTSECURITY}
91
PFNWRITEOBJECTSECURITY = function(p1: LPCWSTR; p2: SECURITY_INFORMATION; p3: PSECURITY_DESCRIPTOR; p4: LPARAM): HRESULT; stdcall;
92
{$EXTERNALSYM PFNWRITEOBJECTSECURITY}
95
DSSI_READ_ONLY = $00000001;
96
{$EXTERNALSYM DSSI_READ_ONLY}
97
DSSI_NO_ACCESS_CHECK = $00000002;
98
{$EXTERNALSYM DSSI_NO_ACCESS_CHECK}
99
DSSI_NO_EDIT_SACL = $00000004;
100
{$EXTERNALSYM DSSI_NO_EDIT_SACL}
101
DSSI_NO_EDIT_OWNER = $00000008;
102
{$EXTERNALSYM DSSI_NO_EDIT_OWNER}
103
DSSI_IS_ROOT = $00000010;
104
{$EXTERNALSYM DSSI_IS_ROOT}
105
DSSI_NO_FILTER = $00000020;
106
{$EXTERNALSYM DSSI_NO_FILTER}
107
DSSI_NO_READONLY_MESSAGE = $00000040;
108
{$EXTERNALSYM DSSI_NO_READONLY_MESSAGE}
110
//+---------------------------------------------------------------------------
112
// Function: DSCreateSecurityPage
114
// Synopsis: Creates a Security property page for a DS object
116
// Arguments: [IN pwszObjectPath] -- Full ADS path of DS object
117
// [IN pwszObjectClass] -- Class of the object (optional)
118
// [IN dwFlags] -- Combination of DSSI_* flags
119
// [OUT phPage] -- HPROPSHEETPAGE returned here
120
// [IN pfnReadSD] -- Optional function for reading SD
121
// [IN pfnWriteSD] -- Optional function for writing SD
122
// [IN LPARAM] -- Passed to pfnReadSD/pfnWriteSD
126
//----------------------------------------------------------------------------
128
function DSCreateSecurityPage(
129
pwszObjectPath: LPCWSTR;
130
pwszObjectClass: LPCWSTR;
132
out phPage: HPROPSHEETPAGE;
133
pfnReadSD: PFNREADOBJECTSECURITY;
134
pfnWriteSD: PFNWRITEOBJECTSECURITY;
135
lpContext:LPARAM): HRESULT; stdcall;
136
{$EXTERNALSYM DSCreateSecurityPage}
139
PFNDSCREATESECPAGE = function(
140
pwszObjectPath: LPCWSTR;
141
pwszObjectClass: LPCWSTR;
143
out phPage: HPROPSHEETPAGE;
144
pfnReadSD: PFNREADOBJECTSECURITY;
145
pfnWriteSD: PFNWRITEOBJECTSECURITY;
146
lpContext:LPARAM): HRESULT; stdcall;
147
{$EXTERNALSYM PFNDSCREATESECPAGE}
154
{$IFDEF DYNAMIC_LINK}
157
_DSCreateSecurityPage: Pointer;
159
function DSCreateSecurityPage;
161
GetProcedureAddress(_DSCreateSecurityPage, dssec, 'DSCreateSecurityPage');
165
JMP [_DSCreateSecurityPage]
171
function DSCreateSecurityPage; external dssec name 'DSCreateSecurityPage';
173
{$ENDIF DYNAMIC_LINK}
1
{******************************************************************************}
3
{ AD Security Property Pages API interface Unit for Object Pascal }
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
6
{ Corporation. All Rights Reserved. }
8
{ The original file is: dssec.h, released Feb 2003. The original Pascal }
9
{ code is: DsSec.pas, released December 2003. The initial developer of the }
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
13
{ Marcel van Brakel. All Rights Reserved. }
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
17
{ You may retrieve the latest version of this file at the Project JEDI }
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net }
20
{ The contents of this file are used with permission, subject to the Mozilla }
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
22
{ in compliance with the License. You may obtain a copy of the License at }
23
{ http://www.mozilla.org/MPL/MPL-1.1.html }
25
{ Software distributed under the License is distributed on an "AS IS" basis, }
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
27
{ the specific language governing rights and limitations under the License. }
29
{ Alternatively, the contents of this file may be used under the terms of the }
30
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
31
{ provisions of the LGPL License are applicable instead of those above. }
32
{ If you wish to allow use of your version of this file only under the terms }
33
{ of the LGPL License and not to allow others to use your version of this file }
34
{ under the MPL, indicate your decision by deleting the provisions above and }
35
{ replace them with the notice and other provisions required by the LGPL }
36
{ License. If you do not delete the provisions above, a recipient may use }
37
{ your version of this file under either the MPL or the LGPL License. }
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
41
{******************************************************************************}
49
{$HPPEMIT '#include "dssec.h"'}
57
JwaWinType, JwaWinNT, JwaPrSht;
59
//+---------------------------------------------------------------------------
61
// Function: PFNREADOBJECTSECURITY
63
// Synopsis: Reads the security descriptor of a DS object
65
// Arguments: [IN LPCWSTR] -- ADS path of DS Object
66
// [IN SECURITY_INFORMATION] -- Which SD parts to read
67
// [OUT PSECURITY_DESCRIPTOR*] -- Return SD here. Caller frees with LocalFree
68
// [IN LPARAM] -- Context param
72
//----------------------------------------------------------------------------
74
// Function: PFNWRITEOBJECTSECURITY
76
// Synopsis: Writes a security descriptor to a DS object
78
// Arguments: [IN LPCWSTR] -- ADS path of DS Object
79
// [IN SECURITY_INFORMATION] -- Which SD parts to write
80
// [OUT PSECURITY_DESCRIPTOR] -- Security descriptor to write
81
// [IN LPARAM] -- Context param
85
//----------------------------------------------------------------------------
88
PFNREADOBJECTSECURITY = function(p1: LPCWSTR; p2: SECURITY_INFORMATION; p3: PPSECURITY_DESCRIPTOR; p4: LPARAM): HRESULT; stdcall;
89
{$EXTERNALSYM PFNREADOBJECTSECURITY}
90
PFNWRITEOBJECTSECURITY = function(p1: LPCWSTR; p2: SECURITY_INFORMATION; p3: PSECURITY_DESCRIPTOR; p4: LPARAM): HRESULT; stdcall;
91
{$EXTERNALSYM PFNWRITEOBJECTSECURITY}
94
DSSI_READ_ONLY = $00000001;
95
{$EXTERNALSYM DSSI_READ_ONLY}
96
DSSI_NO_ACCESS_CHECK = $00000002;
97
{$EXTERNALSYM DSSI_NO_ACCESS_CHECK}
98
DSSI_NO_EDIT_SACL = $00000004;
99
{$EXTERNALSYM DSSI_NO_EDIT_SACL}
100
DSSI_NO_EDIT_OWNER = $00000008;
101
{$EXTERNALSYM DSSI_NO_EDIT_OWNER}
102
DSSI_IS_ROOT = $00000010;
103
{$EXTERNALSYM DSSI_IS_ROOT}
104
DSSI_NO_FILTER = $00000020;
105
{$EXTERNALSYM DSSI_NO_FILTER}
106
DSSI_NO_READONLY_MESSAGE = $00000040;
107
{$EXTERNALSYM DSSI_NO_READONLY_MESSAGE}
109
//+---------------------------------------------------------------------------
111
// Function: DSCreateSecurityPage
113
// Synopsis: Creates a Security property page for a DS object
115
// Arguments: [IN pwszObjectPath] -- Full ADS path of DS object
116
// [IN pwszObjectClass] -- Class of the object (optional)
117
// [IN dwFlags] -- Combination of DSSI_* flags
118
// [OUT phPage] -- HPROPSHEETPAGE returned here
119
// [IN pfnReadSD] -- Optional function for reading SD
120
// [IN pfnWriteSD] -- Optional function for writing SD
121
// [IN LPARAM] -- Passed to pfnReadSD/pfnWriteSD
125
//----------------------------------------------------------------------------
127
function DSCreateSecurityPage(
128
pwszObjectPath: LPCWSTR;
129
pwszObjectClass: LPCWSTR;
131
out phPage: HPROPSHEETPAGE;
132
pfnReadSD: PFNREADOBJECTSECURITY;
133
pfnWriteSD: PFNWRITEOBJECTSECURITY;
134
lpContext:LPARAM): HRESULT; stdcall;
135
{$EXTERNALSYM DSCreateSecurityPage}
138
PFNDSCREATESECPAGE = function(
139
pwszObjectPath: LPCWSTR;
140
pwszObjectClass: LPCWSTR;
142
out phPage: HPROPSHEETPAGE;
143
pfnReadSD: PFNREADOBJECTSECURITY;
144
pfnWriteSD: PFNWRITEOBJECTSECURITY;
145
lpContext:LPARAM): HRESULT; stdcall;
146
{$EXTERNALSYM PFNDSCREATESECPAGE}
153
{$IFDEF DYNAMIC_LINK}
156
_DSCreateSecurityPage: Pointer;
158
function DSCreateSecurityPage;
160
GetProcedureAddress(_DSCreateSecurityPage, dssec, 'DSCreateSecurityPage');
164
JMP [_DSCreateSecurityPage]
170
function DSCreateSecurityPage; external dssec name 'DSCreateSecurityPage';
172
{$ENDIF DYNAMIC_LINK}