jwadsadmin.pas 9.8 KB

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