~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to packages/extra/winunits/jwadssec.pas

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{******************************************************************************}
2
 
{                                                                              }
3
 
{ AD Security Property Pages API interface Unit for Object Pascal              }
4
 
{                                                                              }
5
 
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
6
 
{ Corporation. All Rights Reserved.                                            }
7
 
{                                                                              }
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).               }
11
 
{                                                                              }
12
 
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
13
 
{ Marcel van Brakel. All Rights Reserved.                                      }
14
 
{                                                                              }
15
 
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
16
 
{                                                                              }
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              }
19
 
{                                                                              }
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                                      }
24
 
{                                                                              }
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.    }
28
 
{                                                                              }
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.          }
38
 
{                                                                              }
39
 
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
40
 
{                                                                              }
41
 
{******************************************************************************}
42
 
 
43
 
// $Id: jwadssec.pas,v 1.1 2005/04/04 07:56:10 marco Exp $
44
 
 
45
 
unit JwaDsSec;
46
 
 
47
 
{$WEAKPACKAGEUNIT}
48
 
 
49
 
{$HPPEMIT ''}
50
 
{$HPPEMIT '#include "dssec.h"'}
51
 
{$HPPEMIT ''}
52
 
 
53
 
{$I jediapilib.inc}
54
 
 
55
 
interface
56
 
 
57
 
uses
58
 
  JwaWinType, JwaWinNT, JwaPrSht;
59
 
 
60
 
//+---------------------------------------------------------------------------
61
 
//
62
 
//  Function:   PFNREADOBJECTSECURITY
63
 
//
64
 
//  Synopsis:   Reads the security descriptor of a DS object
65
 
//
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
70
 
//
71
 
//  Return:     HRESULT
72
 
//
73
 
//----------------------------------------------------------------------------
74
 
//
75
 
//  Function:   PFNWRITEOBJECTSECURITY
76
 
//
77
 
//  Synopsis:   Writes a security descriptor to a DS object
78
 
//
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
83
 
//
84
 
//  Return:     HRESULT
85
 
//
86
 
//----------------------------------------------------------------------------
87
 
 
88
 
type
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}
93
 
 
94
 
const
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}
109
 
 
110
 
//+---------------------------------------------------------------------------
111
 
//
112
 
//  Function:   DSCreateSecurityPage
113
 
//
114
 
//  Synopsis:   Creates a Security property page for a DS object
115
 
//
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
123
 
//
124
 
//  Return:     HRESULT
125
 
//
126
 
//----------------------------------------------------------------------------
127
 
 
128
 
function DSCreateSecurityPage(
129
 
  pwszObjectPath: LPCWSTR;
130
 
  pwszObjectClass: LPCWSTR;
131
 
  dwFlags: DWORD;
132
 
  out phPage: HPROPSHEETPAGE;
133
 
  pfnReadSD: PFNREADOBJECTSECURITY;
134
 
  pfnWriteSD: PFNWRITEOBJECTSECURITY;
135
 
  lpContext:LPARAM): HRESULT; stdcall;
136
 
{$EXTERNALSYM DSCreateSecurityPage}
137
 
 
138
 
type
139
 
  PFNDSCREATESECPAGE = function(
140
 
    pwszObjectPath: LPCWSTR;
141
 
    pwszObjectClass: LPCWSTR;
142
 
    dwFlags: DWORD;
143
 
    out phPage: HPROPSHEETPAGE;
144
 
    pfnReadSD: PFNREADOBJECTSECURITY;
145
 
    pfnWriteSD: PFNWRITEOBJECTSECURITY;
146
 
    lpContext:LPARAM): HRESULT; stdcall;
147
 
  {$EXTERNALSYM PFNDSCREATESECPAGE}
148
 
 
149
 
implementation
150
 
 
151
 
const
152
 
  dssec = 'dssec.dll';
153
 
 
154
 
{$IFDEF DYNAMIC_LINK}
155
 
 
156
 
var
157
 
  _DSCreateSecurityPage: Pointer;
158
 
 
159
 
function DSCreateSecurityPage;
160
 
begin
161
 
  GetProcedureAddress(_DSCreateSecurityPage, dssec, 'DSCreateSecurityPage');
162
 
  asm
163
 
        MOV     ESP, EBP
164
 
        POP     EBP
165
 
        JMP     [_DSCreateSecurityPage]
166
 
  end;
167
 
end;
168
 
 
169
 
{$ELSE}
170
 
 
171
 
function DSCreateSecurityPage; external dssec name 'DSCreateSecurityPage';
172
 
 
173
 
{$ENDIF DYNAMIC_LINK}
174
 
 
175
 
end.
 
1
{******************************************************************************}
 
2
{                                                                              }
 
3
{ AD Security Property Pages API interface Unit for Object Pascal              }
 
4
{                                                                              }
 
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
 
6
{ Corporation. All Rights Reserved.                                            }
 
7
{                                                                              }
 
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).               }
 
11
{                                                                              }
 
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
 
13
{ Marcel van Brakel. All Rights Reserved.                                      }
 
14
{                                                                              }
 
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
 
16
{                                                                              }
 
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              }
 
19
{                                                                              }
 
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                                      }
 
24
{                                                                              }
 
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.    }
 
28
{                                                                              }
 
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.          }
 
38
{                                                                              }
 
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
 
40
{                                                                              }
 
41
{******************************************************************************}
 
42
 
 
43
 
 
44
unit JwaDsSec;
 
45
 
 
46
{$WEAKPACKAGEUNIT}
 
47
 
 
48
{$HPPEMIT ''}
 
49
{$HPPEMIT '#include "dssec.h"'}
 
50
{$HPPEMIT ''}
 
51
 
 
52
{$I jediapilib.inc}
 
53
 
 
54
interface
 
55
 
 
56
uses
 
57
  JwaWinType, JwaWinNT, JwaPrSht;
 
58
 
 
59
//+---------------------------------------------------------------------------
 
60
//
 
61
//  Function:   PFNREADOBJECTSECURITY
 
62
//
 
63
//  Synopsis:   Reads the security descriptor of a DS object
 
64
//
 
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
 
69
//
 
70
//  Return:     HRESULT
 
71
//
 
72
//----------------------------------------------------------------------------
 
73
//
 
74
//  Function:   PFNWRITEOBJECTSECURITY
 
75
//
 
76
//  Synopsis:   Writes a security descriptor to a DS object
 
77
//
 
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
 
82
//
 
83
//  Return:     HRESULT
 
84
//
 
85
//----------------------------------------------------------------------------
 
86
 
 
87
type
 
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}
 
92
 
 
93
const
 
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}
 
108
 
 
109
//+---------------------------------------------------------------------------
 
110
//
 
111
//  Function:   DSCreateSecurityPage
 
112
//
 
113
//  Synopsis:   Creates a Security property page for a DS object
 
114
//
 
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
 
122
//
 
123
//  Return:     HRESULT
 
124
//
 
125
//----------------------------------------------------------------------------
 
126
 
 
127
function DSCreateSecurityPage(
 
128
  pwszObjectPath: LPCWSTR;
 
129
  pwszObjectClass: LPCWSTR;
 
130
  dwFlags: DWORD;
 
131
  out phPage: HPROPSHEETPAGE;
 
132
  pfnReadSD: PFNREADOBJECTSECURITY;
 
133
  pfnWriteSD: PFNWRITEOBJECTSECURITY;
 
134
  lpContext:LPARAM): HRESULT; stdcall;
 
135
{$EXTERNALSYM DSCreateSecurityPage}
 
136
 
 
137
type
 
138
  PFNDSCREATESECPAGE = function(
 
139
    pwszObjectPath: LPCWSTR;
 
140
    pwszObjectClass: LPCWSTR;
 
141
    dwFlags: DWORD;
 
142
    out phPage: HPROPSHEETPAGE;
 
143
    pfnReadSD: PFNREADOBJECTSECURITY;
 
144
    pfnWriteSD: PFNWRITEOBJECTSECURITY;
 
145
    lpContext:LPARAM): HRESULT; stdcall;
 
146
  {$EXTERNALSYM PFNDSCREATESECPAGE}
 
147
 
 
148
implementation
 
149
 
 
150
const
 
151
  dssec = 'dssec.dll';
 
152
 
 
153
{$IFDEF DYNAMIC_LINK}
 
154
 
 
155
var
 
156
  _DSCreateSecurityPage: Pointer;
 
157
 
 
158
function DSCreateSecurityPage;
 
159
begin
 
160
  GetProcedureAddress(_DSCreateSecurityPage, dssec, 'DSCreateSecurityPage');
 
161
  asm
 
162
        MOV     ESP, EBP
 
163
        POP     EBP
 
164
        JMP     [_DSCreateSecurityPage]
 
165
  end;
 
166
end;
 
167
 
 
168
{$ELSE}
 
169
 
 
170
function DSCreateSecurityPage; external dssec name 'DSCreateSecurityPage';
 
171
 
 
172
{$ENDIF DYNAMIC_LINK}
 
173
 
 
174
end.