1 {******************************************************************************}
2 {                                                                              }
3 { Directory Services Admin 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: dsadmin.h, released June 2000. The original Pascal     }
9 { code is: dsadmin.pas, released December 2000. 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: JwaDSAdmin.pas,v 1.8 2007/09/05 11:58:49 dezipaitor Exp $
44 
45 {$IFNDEF JWA_OMIT_SECTIONS}
46 unit JwaDSAdmin;
47 
48 {$WEAKPACKAGEUNIT}
49 {$ENDIF JWA_OMIT_SECTIONS}
50 
51 {$HPPEMIT ''}
52 {$HPPEMIT '#include "dsadmin.h"'}
53 {$HPPEMIT ''}
54 
55 {$IFNDEF JWA_OMIT_SECTIONS}
56 {$I jediapilib.inc}
57 
58 interface
59 
60 uses
61   JwaActiveX, JwaAdsTLB, JwaPrSht, JwaWinType;
62 {$ENDIF JWA_OMIT_SECTIONS}
63 
64 {$IFNDEF JWA_IMPLEMENTATIONSECTION}
65 
66 //
67 // CoClass for the Object creation dialog object
68 //
69 // {E301A009-F901-11d2-82B9-00C04F68928B}
70 
71 const
72   CLSID_DsAdminCreateObj: TGUID = (
73     D1:$e301a009; D2:$f901; D3:$11d2; D4:($82, $b9, $0, $c0, $4f, $68, $92, $8b));
74   {$EXTERNALSYM CLSID_DsAdminCreateObj}
75 
76 //
77 // Interface GUIDs
78 //
79 
80 // {53554A38-F902-11d2-82B9-00C04F68928B}
81 
82   IID_IDsAdminCreateObj: TGUID = (
83     D1:$53554a38; D2:$f902; D3:$11d2; D4:($82, $b9, $0, $c0, $4f, $68, $92, $8b));
84   {$EXTERNALSYM IID_IDsAdminCreateObj}
85 
86 // {F2573587-E6FC-11d2-82AF-00C04F68928B}
87 
88   IID_IDsAdminNewObj: TGUID = (
89     D1:$f2573587; D2:$e6fc; D3:$11d2; D4:($82, $af, $0, $c0, $4f, $68, $92, $8b));
90   {$EXTERNALSYM IID_IDsAdminNewObj}
91 
92 // {BE2B487E-F904-11d2-82B9-00C04F68928B}
93 
94   IID_IDsAdminNewObjPrimarySite: TGUID = (
95     D1:$be2b487e; D2:$f904; D3:$11d2; D4:($82, $b9, $0, $c0, $4f, $68, $92, $8b));
96   {$EXTERNALSYM IID_IDsAdminNewObjPrimarySite}
97 
98 // {6088EAE2-E7BF-11d2-82AF-00C04F68928B}
99 
100   IID_IDsAdminNewObjExt: TGUID = (
101     D1:$6088eae2; D2:$e7bf; D3:$11d2; D4:($82, $af, $0, $c0, $4f, $68, $92, $8b));
102   {$EXTERNALSYM IID_IDsAdminNewObjExt}
103 
104 // {E4A2B8B3-5A18-11d2-97C1-00A0C9A06D2D}
105 
106   IID_IDsAdminNotifyHandler: TGUID = (
107     D1:$e4a2b8b3; D2:$5a18; D3:$11d2; D4:($97, $c1, $0, $a0, $c9, $a0, $6d, $2d));
108   {$EXTERNALSYM IID_IDsAdminNotifyHandler}
109 
110 // ----------------------------------------------------------------------------
111 //
112 // Interface: IDsAdminCreateObj
113 //
114 // Implemented by the object (implemented by the system) CLSID_DsAdminCreateObj
115 //
116 // Used by: any client needing to invoke the creation UI
117 //
118 
119 type
120   IDsAdminCreateObj = interface (IUnknown)
121   ['{53554A38-F902-11d2-82B9-00C04F68928B}']
Initializenull122     function Initialize(pADsContainerObj: IADsContainer; pADsCopySource: IADS;
123       lpszClassName: LPCWSTR): HRESULT; stdcall;
CreateModalnull124     function CreateModal(hwndParent: HWND; out ppADsObj: IADS): HRESULT; stdcall;
125   end;
126   {$EXTERNALSYM IDsAdminCreateObj}
127 
128 //---------------------------------------------------------------------------
129 //
130 // Interface: IDsAdminNewObj
131 //
132 // Implemented by: DS Admin
133 //
134 // Used by: creation extension in proc server (both primary and regular)
135 //
136 
137   IDsAdminNewObj = interface (IUnknown)
138   ['{F2573587-E6FC-11d2-82AF-00C04F68928B}']
SetButtonsnull139     function SetButtons(nCurrIndex: ULONG; bValid: BOOL): HRESULT; stdcall;
GetPageCountsnull140     function GetPageCounts(var pnTotal, pnStartIndex: LONG): HRESULT; stdcall;
141   end;
142   {$EXTERNALSYM IDsAdminNewObj}
143 
144 //---------------------------------------------------------------------------
145 //
146 // Interface: IDsAdminNewObjPrimarySite
147 //
148 // Implemented by: DS Admin
149 //
150 // Used by: creation extension in proc server (primary only)
151 //
152 
153   IDsAdminNewObjPrimarySite = interface (IUnknown)
154   ['{BE2B487E-F904-11d2-82B9-00C04F68928B}']
CreateNewnull155     function CreateNew(pszName: LPCWSTR): HRESULT; stdcall;
Commitnull156     function Commit: HRESULT; stdcall;
157   end;
158   {$EXTERNALSYM IDsAdminNewObjPrimarySite}
159 
160 //
161 // struct passed to IDsAdminNewObjExt::Initialize()
162 //
163 // it contains information regarding UI look
164 //
165 
166   LPDSA_NEWOBJ_DISPINFO = ^DSA_NEWOBJ_DISPINFO;
167   {$EXTERNALSYM LPDSA_NEWOBJ_DISPINFO}
168   DSA_NEWOBJ_DISPINFO = record
169     dwSize: DWORD;               // size of struct, for versioning
170     hObjClassIcon: HICON;        // class icon for the object to be created
171     lpszWizTitle: LPWSTR;        // title of the wizard
172     lpszContDisplayName: LPWSTR; // container display name (canonical name)
173   end;
174   {$EXTERNALSYM DSA_NEWOBJ_DISPINFO}
175   TDsaNewObjDispInfo = DSA_NEWOBJ_DISPINFO;
176   PDsaNewObjDispInfo = LPDSA_NEWOBJ_DISPINFO;
177 
178 //
179 // context flags passed to IDsAdminNewObjExt::OnError() and to IDsAdminNewObjExt::WriteData()
180 //
181 
182 const
183   DSA_NEWOBJ_CTX_PRECOMMIT  = $00000001; // before SetInfo()
184   {$EXTERNALSYM DSA_NEWOBJ_CTX_PRECOMMIT}
185   DSA_NEWOBJ_CTX_COMMIT     = $00000002; // SetInfo(), commit phase
186   {$EXTERNALSYM DSA_NEWOBJ_CTX_COMMIT}
187   DSA_NEWOBJ_CTX_POSTCOMMIT = $00000003; // after SetInfo()
188   {$EXTERNALSYM DSA_NEWOBJ_CTX_POSTCOMMIT}
189   DSA_NEWOBJ_CTX_CLEANUP    = $00000004; // on post commit fail
190   {$EXTERNALSYM DSA_NEWOBJ_CTX_CLEANUP}
191 
192 //---------------------------------------------------------------------------
193 //
194 // Interface: IDsAdminNewObjExt
195 //
196 // Implemented by: creation extension in proc server (both primary and regular)
197 //
198 // Used by: DS Admin
199 //
200 
201 type
202   IDsAdminNewObjExt = interface (IUnknown)
203   ['{6088EAE2-E7BF-11d2-82AF-00C04F68928B}']
Initializenull204     function Initialize(pADsContainerObj: IADsContainer; pADsCopySource: IADs;
205       lpszClassName: LPCWSTR; pDsAdminNewObj: IDsAdminNewObj;
206       const pDispInfo: DSA_NEWOBJ_DISPINFO): HRESULT; stdcall;
AddPagesnull207     function AddPages(lpfnAddPage: LPFNADDPROPSHEETPAGE; lParam: LPARAM): HRESULT; stdcall;
SetObjectnull208     function SetObject(pADsObj: IADs): HRESULT; stdcall;
WriteDatanull209     function WriteData(hWnd: HWND; uContext: ULONG): HRESULT; stdcall;
OnErrornull210     function OnError(hWnd: HWND; hr: HRESULT; uContext: ULONG): HRESULT; stdcall;
GetSummaryInfonull211     function GetSummaryInfo(out pBstrText: WideString): HRESULT; stdcall;
212   end;
213   {$EXTERNALSYM IDsAdminNewObjExt}
214 
215 //
216 // Notification opcodes for IDsAdminNotifyHandler
217 //
218 
219 const
220   DSA_NOTIFY_DEL  = $00000001; // delete
221   {$EXTERNALSYM DSA_NOTIFY_DEL}
222   DSA_NOTIFY_REN  = $00000002; // rename
223   {$EXTERNALSYM DSA_NOTIFY_REN}
224   DSA_NOTIFY_MOV  = $00000004; // move
225   {$EXTERNALSYM DSA_NOTIFY_MOV}
226   DSA_NOTIFY_PROP = $00000008; // property change
227   {$EXTERNALSYM DSA_NOTIFY_PROP}
228 
229   DSA_NOTIFY_ALL = (DSA_NOTIFY_DEL or DSA_NOTIFY_REN or DSA_NOTIFY_MOV or
230     DSA_NOTIFY_PROP);
231   {$EXTERNALSYM DSA_NOTIFY_ALL}
232 
233 //
234 // flags to handle additional data
235 //
236 
237   DSA_NOTIFY_FLAG_ADDITIONAL_DATA       = $00000002; // process additional extension data?
238   {$EXTERNALSYM DSA_NOTIFY_FLAG_ADDITIONAL_DATA}
239   DSA_NOTIFY_FLAG_FORCE_ADDITIONAL_DATA = $00000001; // operation forced
240   {$EXTERNALSYM DSA_NOTIFY_FLAG_FORCE_ADDITIONAL_DATA}
241 
242 //---------------------------------------------------------------------------
243 //
244 // Interface: IDsAdminNotifyHandler
245 //
246 // Implemented by: notification handler in proc server
247 //
248 // Used by: DS Admin
249 //
250 
251 type
252   IDsAdminNotifyHandler = interface (IUnknown)
253   ['{E4A2B8B3-5A18-11d2-97C1-00A0C9A06D2D}']
Initializenull254     function Initialize(pExtraInfo: IDataObject; puEventFlags: PULONG): HRESULT; stdcall;
Begin_null255     function Begin_(uEvent: ULONG; pArg1, pArg2: IDataObject; puFlags: ULONG;
256       out pBstr: WideString): HRESULT; stdcall;
Notifynull257     function Notify(nItem: ULONG; uFlags: ULONG): HRESULT; stdcall;
End_null258     function End_: HRESULT; stdcall;
259   end;
260   {$EXTERNALSYM IDsAdminNotifyHandler}
261 {$ENDIF JWA_IMPLEMENTATIONSECTION}
262 
263 {$IFNDEF JWA_OMIT_SECTIONS}
264 implementation
265 //uses ...
266 {$ENDIF JWA_OMIT_SECTIONS}
267 
268 
269 {$IFNDEF JWA_INTERFACESECTION}
270 //your implementation here
271 {$ENDIF JWA_INTERFACESECTION}
272 
273 
274 {$IFNDEF JWA_OMIT_SECTIONS}
275 end.
276 {$ENDIF JWA_OMIT_SECTIONS}
277 
278 
279