jwadsadmin.pas 10 KB

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