jwadsadmin.pas 9.8 KB

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