Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

654 lines
26 KiB

  1. #ifndef __dsclient_h
  2. #define __dsclient_h
  3. #ifndef __dsclintp_h ;internal
  4. #define __dsclintp_h ;internal
  5. //---------------------------------------------------------------------------//
  6. // CLSIDs exposed for the dsclient.
  7. //---------------------------------------------------------------------------//
  8. // this CLSID is used to signal that the DSOBJECTNAMEs structure originated
  9. // for the Microsoft DS.
  10. DEFINE_GUID(CLSID_MicrosoftDS, 0xfe1290f0, 0xcfbd, 0x11cf, 0xa3, 0x30, 0x0, 0xaa, 0x0, 0xc1, 0x6e, 0x65);
  11. #define CLSID_DsFolder CLSID_MicrosoftDS
  12. // this is the CLSID used by clients to get the IShellExtInit, IPropSheetExt
  13. // and IContextMenus exposed from dsuiext.dll.
  14. DEFINE_GUID(CLSID_DsPropertyPages, 0xd45d530, 0x764b, 0x11d0, 0xa1, 0xca, 0x0, 0xaa, 0x0, 0xc1, 0x6e, 0x65);
  15. DEFINE_GUID(CLSID_DsDomainTreeBrowser, 0x1698790a, 0xe2b4, 0x11d0, 0xb0, 0xb1, 0x00, 0xc0, 0x4f, 0xd8, 0xdc, 0xa6);
  16. DEFINE_GUID(IID_IDsBrowseDomainTree, 0x7cabcf1e, 0x78f5, 0x11d2, 0x96, 0xc, 0x0, 0xc0, 0x4f, 0xa3, 0x1a, 0x86);
  17. DEFINE_GUID(CLSID_DsDisplaySpecifier, 0x1ab4a8c0, 0x6a0b, 0x11d2, 0xad, 0x49, 0x0, 0xc0, 0x4f, 0xa3, 0x1a, 0x86);
  18. #define IID_IDsDisplaySpecifier CLSID_DsDisplaySpecifier
  19. DEFINE_GUID(CLSID_DsFolderProperties, 0x9e51e0d0, 0x6e0f, 0x11d2, 0x96, 0x1, 0x0, 0xc0, 0x4f, 0xa3, 0x1a, 0x86);
  20. #define IID_IDsFolderProperties CLSID_DsFolderProperties
  21. #ifndef GUID_DEFS_ONLY ;both
  22. #include "activeds.h"
  23. #include "iadsp.h" ;internal
  24. #include "comctrlp.h" ;internal
  25. //---------------------------------------------------------------------------//
  26. // Clipboard formats used within DSUI
  27. //---------------------------------------------------------------------------//
  28. //
  29. // CF_DSOBJECTS
  30. // ------------
  31. // This clipboard format defines the seleciton for an DS IShellFolder to the
  32. // shell extensions. All strings are stored as BSTR's, and an offset == 0
  33. // is used to indicate that the string is not present.
  34. //
  35. #define DSOBJECT_ISCONTAINER 0x00000001 // = 1 => object is a container
  36. #define DSOBJECT_READONLYPAGES 0x80000000 // = 1 => read only pages
  37. #define DSPROVIDER_UNUSED_0 0x00000001
  38. #define DSPROVIDER_UNUSED_1 0x00000002
  39. #define DSPROVIDER_UNUSED_2 0x00000004
  40. #define DSPROVIDER_UNUSED_3 0x00000008
  41. #define DSPROVIDER_ADVANCED 0x00000010 // = 1 => advanced mode
  42. #define CFSTR_DSOBJECTNAMES TEXT("DsObjectNames")
  43. typedef struct
  44. {
  45. DWORD dwFlags; // item flags
  46. DWORD dwProviderFlags; // flags for item provider
  47. DWORD offsetName; // offset to ADS path of the object
  48. DWORD offsetClass; // offset to object class name / == 0 not known
  49. } DSOBJECT, * LPDSOBJECT;
  50. typedef struct
  51. {
  52. CLSID clsidNamespace; // namespace identifier (indicates which namespace selection from)
  53. UINT cItems; // number of objects
  54. DSOBJECT aObjects[1]; // array of objects
  55. } DSOBJECTNAMES, * LPDSOBJECTNAMES;
  56. //
  57. // CF_DSDISPLAYSPECOPTIONS
  58. // -----------------------
  59. // When invoking an object referenced by a display specifier (context menu, property
  60. // page, etc) we call the IShellExtInit interface passing a IDataObject. This data
  61. // object supports the CF_DSDISPLAYSPECOPTIONS format to give out configuration
  62. // informaiton about admin/shell invocation.
  63. //
  64. // When interacting with dsuiext.dll the interfaces uses this clipboard format
  65. // to determine which display specifier attributes to address (admin/shell)
  66. // and pick up the values accordingly. If no format is suppoted then
  67. // dsuiext.dll defaults to shell.
  68. //
  69. #define CFSTR_DS_DISPLAY_SPEC_OPTIONS TEXT("DsDisplaySpecOptions")
  70. #define CFSTR_DSDISPLAYSPECOPTIONS CFSTR_DS_DISPLAY_SPEC_OPTIONS
  71. typedef struct _DSDISPLAYSPECOPTIONS
  72. {
  73. DWORD dwSize; // size of struct, for versioning
  74. DWORD dwFlags; // invocation flags
  75. DWORD offsetAttribPrefix; // offset to attribute prefix string.
  76. DWORD offsetUserName; // offset to UNICODE user name
  77. DWORD offsetPassword; // offset to UNICODE password
  78. DWORD offsetServer;
  79. DWORD offsetServerConfigPath;
  80. } DSDISPLAYSPECOPTIONS, * PDSDISPLAYSPECOPTIONS, * LPDSDISPLAYSPECOPTIONS;
  81. #define DS_PROP_SHELL_PREFIX L"shell"
  82. #define DS_PROP_ADMIN_PREFIX L"admin"
  83. #define DSDSOF_HASUSERANDSERVERINFO 0x00000001 // = 1 => user name/password are valid
  84. #define DSDSOF_SIMPLEAUTHENTICATE 0x00000002 // = 1 => don't use secure authentication to DS
  85. #define DSDSOF_DONTSIGNSEAL 0x00000004 // = 1 => don't sign+seal when opening DS objects
  86. #define DSDSOF_DSAVAILABLE 0x40000000 // = 1 => ignore DS available checks
  87. ;begin_internal
  88. #define DSDSOF_INVOKEDFROMWAB 0x80000000 // = 1 => invoked from WAB
  89. ;end_internal
  90. //
  91. // CF_DSPROPERTYPAGEINFO
  92. // ---------------------
  93. // When the property pages for an object are being displayed the parsed
  94. // display specifier string is passed to the page object via the IDataObject
  95. // in the following clipboard format.
  96. //
  97. // Within the display specifier for a property page, the format for a
  98. // Win32 extension is "n,{clsid}[,bla...]" we take the "bla" section and
  99. // pass it down.
  100. //
  101. #define CFSTR_DSPROPERTYPAGEINFO TEXT("DsPropPageInfo")
  102. typedef struct
  103. {
  104. DWORD offsetString; // offset to UNICODE string
  105. } DSPROPERTYPAGEINFO, * LPDSPROPERTYPAGEINFO;
  106. //
  107. // To sync property pages and the admin tools this message is broadcast
  108. //
  109. #define DSPROP_ATTRCHANGED_MSG TEXT("DsPropAttrChanged")
  110. //---------------------------------------------------------------------------//
  111. //---------------------------------------------------------------------------//
  112. //
  113. // IDsBrowseDomainTree
  114. // ===================
  115. // This interface returns a list of the domains from a given computer name
  116. // (or the current computer name if none is specified).
  117. //
  118. // NOTES:
  119. // 1) The structure returned by ::GetDomains should be free'd using
  120. // FreeDomains.
  121. //
  122. // 2) ::BrowseTo allocates a string on exit, this is allocated using
  123. // CoTaskMemAlloc, and therefore should be free'd using CoTaskMemFree.
  124. //
  125. //---------------------------------------------------------------------------//
  126. #define DBDTF_RETURNFQDN 0x00000001 // if not set, pszNCName will be blank
  127. #define DBDTF_RETURNMIXEDDOMAINS 0x00000002 // set it if you want downlevel trust domains too
  128. #define DBDTF_RETURNEXTERNAL 0x00000004 // set it if you want external trust domains too
  129. #define DBDTF_RETURNINBOUND 0x00000008 // set it if you want trusting domains
  130. #define DBDTF_RETURNINOUTBOUND 0x00000010 // set it if you want both trusted and trusting domains
  131. typedef struct _DOMAINDESC
  132. {
  133. LPWSTR pszName; // domain name (if no dns, use netbios)
  134. LPWSTR pszPath; // set to blank
  135. LPWSTR pszNCName; // FQDN, e.g.,DC=mydomain,DC=microsoft,DC=com
  136. LPWSTR pszTrustParent; // parent domain name (if no dns, use netbios)
  137. LPWSTR pszObjectClass; // Object class of the domain object referenced
  138. ULONG ulFlags; // Flags, from DS_TRUSTED_DOMAINS.Flags
  139. BOOL fDownLevel; // == 1 if downlevel domain
  140. struct _DOMAINDESC *pdChildList; // Children of this node
  141. struct _DOMAINDESC *pdNextSibling; // Siblings of this node
  142. } DOMAIN_DESC, DOMAINDESC, * PDOMAIN_DESC, * LPDOMAINDESC;
  143. typedef struct
  144. {
  145. DWORD dsSize;
  146. DWORD dwCount;
  147. DOMAINDESC aDomains[1];
  148. } DOMAIN_TREE, DOMAINTREE, * PDOMAIN_TREE, * LPDOMAINTREE;
  149. #undef INTERFACE
  150. #define INTERFACE IDsBrowseDomainTree
  151. DECLARE_INTERFACE_(IDsBrowseDomainTree, IUnknown)
  152. {
  153. // *** IUnknown methods ***
  154. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  155. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  156. STDMETHOD_(ULONG,Release)(THIS) PURE;
  157. // *** IDsBrowseDomainTree methods ***
  158. STDMETHOD(BrowseTo)(THIS_ HWND hwndParent, LPWSTR *ppszTargetPath, DWORD dwFlags) PURE;
  159. STDMETHOD(GetDomains)(THIS_ PDOMAIN_TREE *ppDomainTree, DWORD dwFlags) PURE;
  160. STDMETHOD(FreeDomains)(THIS_ PDOMAIN_TREE *ppDomainTree) PURE;
  161. STDMETHOD(FlushCachedDomains)(THIS) PURE;
  162. STDMETHOD(SetComputer)(THIS_ LPCWSTR pszComputerName, LPCWSTR pszUserName, LPCWSTR pszPassword) PURE;
  163. };
  164. //---------------------------------------------------------------------------//
  165. //---------------------------------------------------------------------------//
  166. //
  167. // IDsDisplaySpecifier
  168. // ===================
  169. // This interface gives client UI access to the display specifiers for
  170. // specific attributes.
  171. //
  172. //---------------------------------------------------------------------------//
  173. //
  174. // IDsDisplaySpecifier::SetServer flags
  175. //
  176. #define DSSSF_SIMPLEAUTHENTICATE 0x00000001 // = 1 => don't use secure authentication to DS
  177. #define DSSSF_DONTSIGNSEAL 0x00000002 // = 1 => don't use sign+seal when opening objects in the DS
  178. #define DSSSF_DSAVAILABLE 0x80000000 // = 1 => ignore DS available checks
  179. //
  180. // Flags for IDsDisplaySpecifier::GetIcon / GetIconLocation
  181. //
  182. #define DSGIF_ISNORMAL 0x0000000 // = icon is in normal state (default)
  183. #define DSGIF_ISOPEN 0x0000001 // = icon is in open state
  184. #define DSGIF_ISDISABLED 0x0000002 // = icon is in a disabled state
  185. #define DSGIF_ISMASK 0x000000f
  186. #define DSGIF_GETDEFAULTICON 0x0000010 // = 1 => if no icon then get default (from shell32.dll)
  187. #define DSGIF_DEFAULTISCONTAINER 0x0000020 // = 1 => if returning default icon, return it as a container
  188. //
  189. // Flags for IDsDisplaySpecifier::IsClassContainer
  190. //
  191. #define DSICCF_IGNORETREATASLEAF 0x00000001 // = 1 => igore the "treatAsLeaf" and use only schema information
  192. //
  193. // Callback function used for IDsDisplaySpecifier::EnumClassAttributes
  194. //
  195. #define DSECAF_NOTLISTED 0x00000001 // = 1 => hide from the field drop down in the query UI
  196. typedef HRESULT (CALLBACK *LPDSENUMATTRIBUTES)(LPARAM lParam, LPCWSTR pszAttributeName, LPCWSTR pszDisplayName, DWORD dwFlags);
  197. //
  198. // IDsDisplaySpecifier::GetClassCreationInfo information
  199. //
  200. #define DSCCIF_HASWIZARDDIALOG 0x00000001 // = 1 => return the wizard dialog CLSID
  201. #define DSCCIF_HASWIZARDPRIMARYPAGE 0x00000002 // = 1 => returning a primary wizard dlg CLSID
  202. typedef struct
  203. {
  204. DWORD dwFlags;
  205. CLSID clsidWizardDialog;
  206. CLSID clsidWizardPrimaryPage;
  207. DWORD cWizardExtensions; // how many extension CLSIDs?
  208. CLSID aWizardExtensions[1];
  209. } DSCLASSCREATIONINFO, * LPDSCLASSCREATIONINFO;
  210. //
  211. // IDsDisplaySpecifier - a COM object for interacting with display specifiers
  212. //
  213. #undef INTERFACE
  214. #define INTERFACE IDsDisplaySpecifier
  215. DECLARE_INTERFACE_(IDsDisplaySpecifier, IUnknown)
  216. {
  217. // *** IUnknown methods ***
  218. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  219. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  220. STDMETHOD_(ULONG,Release)(THIS) PURE;
  221. // *** IDsDisplaySpecifier methods ***
  222. STDMETHOD(SetServer)(THIS_ LPCWSTR pszServer, LPCWSTR pszUserName, LPCWSTR pszPassword, DWORD dwFlags) PURE;
  223. STDMETHOD(SetLanguageID)(THIS_ LANGID langid) PURE;
  224. STDMETHOD(GetDisplaySpecifier)(THIS_ LPCWSTR pszObjectClass, REFIID riid, void **ppv) PURE;
  225. STDMETHOD(GetIconLocation)(THIS_ LPCWSTR pszObjectClass, DWORD dwFlags, LPWSTR pszBuffer, INT cchBuffer, INT *presid) PURE;
  226. STDMETHOD_(HICON, GetIcon)(THIS_ LPCWSTR pszObjectClass, DWORD dwFlags, INT cxIcon, INT cyIcon) PURE;
  227. STDMETHOD(GetFriendlyClassName)(THIS_ LPCWSTR pszObjectClass, LPWSTR pszBuffer, INT cchBuffer) PURE;
  228. STDMETHOD(GetFriendlyAttributeName)(THIS_ LPCWSTR pszObjectClass, LPCWSTR pszAttributeName, LPWSTR pszBuffer, UINT cchBuffer) PURE;
  229. STDMETHOD_(BOOL, IsClassContainer)(THIS_ LPCWSTR pszObjectClass, LPCWSTR pszADsPath, DWORD dwFlags) PURE;
  230. STDMETHOD(GetClassCreationInfo)(THIS_ LPCWSTR pszObjectClass, LPDSCLASSCREATIONINFO* ppdscci) PURE;
  231. STDMETHOD(EnumClassAttributes)(THIS_ LPCWSTR pszObjectClass, LPDSENUMATTRIBUTES pcbEnum, LPARAM lParam) PURE;
  232. STDMETHOD_(ADSTYPE, GetAttributeADsType)(THIS_ LPCWSTR pszAttributeName) PURE;
  233. };
  234. //---------------------------------------------------------------------------//
  235. //
  236. // DsBrowseForContainer
  237. // --------------------
  238. // Provides a container browser similar to the SHBrowseForFolder, except
  239. // targetting the DS.
  240. //
  241. // In:
  242. // pInfo -> DSBROWSEINFO structure
  243. //
  244. // Out:
  245. // == IDOK/IDCANCEL depending on buttons, -1 if error
  246. //
  247. //---------------------------------------------------------------------------//
  248. typedef struct
  249. {
  250. DWORD cbStruct; // size of structure in bytes
  251. HWND hwndOwner; // dialog owner
  252. LPCWSTR pszCaption; // dialog caption text (can be NULL)
  253. LPCWSTR pszTitle; // displayed above the tree view control (can be NULL)
  254. LPCWSTR pszRoot; // ADS path to root (NULL == root of DS namespace)
  255. LPWSTR pszPath; // [in/out] initial selection & returned path (required)
  256. ULONG cchPath; // size of pszPath buffer in characters
  257. DWORD dwFlags;
  258. BFFCALLBACK pfnCallback; // callback function (see SHBrowseForFolder)
  259. LPARAM lParam; // passed to pfnCallback as lpUserData
  260. DWORD dwReturnFormat; // ADS_FORMAT_* (default is ADS_FORMAT_X500_NO_SERVER)
  261. LPCWSTR pUserName; // Username and Password to authenticate against DS with
  262. LPCWSTR pPassword;
  263. LPWSTR pszObjectClass; // UNICODE string for the object class
  264. ULONG cchObjectClass;
  265. } DSBROWSEINFOW, *PDSBROWSEINFOW;
  266. typedef struct
  267. {
  268. DWORD cbStruct;
  269. HWND hwndOwner;
  270. LPCSTR pszCaption;
  271. LPCSTR pszTitle;
  272. LPCWSTR pszRoot; // ADS paths are always UNICODE
  273. LPWSTR pszPath; // ditto
  274. ULONG cchPath;
  275. DWORD dwFlags;
  276. BFFCALLBACK pfnCallback;
  277. LPARAM lParam;
  278. DWORD dwReturnFormat;
  279. LPCWSTR pUserName; // Username and Password to authenticate against DS with
  280. LPCWSTR pPassword;
  281. LPWSTR pszObjectClass; // object class of the selected object
  282. ULONG cchObjectClass;
  283. } DSBROWSEINFOA, *PDSBROWSEINFOA;
  284. #ifdef UNICODE
  285. #define DSBROWSEINFO DSBROWSEINFOW
  286. #define PDSBROWSEINFO PDSBROWSEINFOW
  287. #else
  288. #define DSBROWSEINFO DSBROWSEINFOA
  289. #define PDSBROWSEINFO PDSBROWSEINFOA
  290. #endif
  291. // DSBROWSEINFO flags
  292. #define DSBI_NOBUTTONS 0x00000001 // NOT TVS_HASBUTTONS
  293. #define DSBI_NOLINES 0x00000002 // NOT TVS_HASLINES
  294. #define DSBI_NOLINESATROOT 0x00000004 // NOT TVS_LINESATROOT
  295. #define DSBI_CHECKBOXES 0x00000100 // TVS_CHECKBOXES
  296. #define DSBI_NOROOT 0x00010000 // don't include pszRoot in tree (its children become top level nodes)
  297. #define DSBI_INCLUDEHIDDEN 0x00020000 // display hidden objects
  298. #define DSBI_EXPANDONOPEN 0x00040000 // expand to the path specified in pszPath when opening the dialog
  299. #define DSBI_ENTIREDIRECTORY 0x00090000 // browse the entire directory (defaults to having DSBI_NOROOT set)
  300. #define DSBI_RETURN_FORMAT 0x00100000 // dwReturnFormat field is valid
  301. #define DSBI_HASCREDENTIALS 0x00200000 // pUserName & pPassword are valid
  302. #define DSBI_IGNORETREATASLEAF 0x00400000 // ignore the treat as leaf flag when calling IsClassContainer
  303. #define DSBI_SIMPLEAUTHENTICATE 0x00800000 // don't use secure authentication to DS
  304. #define DSBI_RETURNOBJECTCLASS 0x01000000 // return object class of selected object
  305. #define DSBI_DONTSIGNSEAL 0x02000000 // don't sign+seal communication with DS
  306. #define DSB_MAX_DISPLAYNAME_CHARS 64
  307. typedef struct
  308. {
  309. DWORD cbStruct;
  310. LPCWSTR pszADsPath; // ADS paths are always Unicode
  311. LPCWSTR pszClass; // ADS properties are always Unicode
  312. DWORD dwMask;
  313. DWORD dwState;
  314. DWORD dwStateMask;
  315. WCHAR szDisplayName[DSB_MAX_DISPLAYNAME_CHARS];
  316. WCHAR szIconLocation[MAX_PATH];
  317. INT iIconResID;
  318. } DSBITEMW, *PDSBITEMW;
  319. typedef struct
  320. {
  321. DWORD cbStruct;
  322. LPCWSTR pszADsPath; // ADS paths are always Unicode
  323. LPCWSTR pszClass; // ADS properties are always Unicode
  324. DWORD dwMask;
  325. DWORD dwState;
  326. DWORD dwStateMask;
  327. CHAR szDisplayName[DSB_MAX_DISPLAYNAME_CHARS];
  328. CHAR szIconLocation[MAX_PATH];
  329. INT iIconResID;
  330. } DSBITEMA, *PDSBITEMA;
  331. #ifdef UNICODE
  332. #define DSBITEM DSBITEMW
  333. #define PDSBITEM PDSBITEMW
  334. #else
  335. #define DSBITEM DSBITEMA
  336. #define PDSBITEM PDSBITEMA
  337. #endif
  338. // DSBITEM mask flags
  339. #define DSBF_STATE 0x00000001
  340. #define DSBF_ICONLOCATION 0x00000002
  341. #define DSBF_DISPLAYNAME 0x00000004
  342. // DSBITEM state flags
  343. #define DSBS_CHECKED 0x00000001
  344. #define DSBS_HIDDEN 0x00000002
  345. #define DSBS_ROOT 0x00000004
  346. //
  347. // this message is sent to the callback to see if it wants to insert or modify
  348. // the item that is about to be inserted into the view.
  349. //
  350. #define DSBM_QUERYINSERTW 100 // lParam = PDSBITEMW (state, icon & name may be modified). Return TRUE if handled.
  351. #define DSBM_QUERYINSERTA 101 // lParam = PDSBITEMA (state, icon & name may be modified). Return TRUE if handled.
  352. #ifdef UNICODE
  353. #define DSBM_QUERYINSERT DSBM_QUERYINSERTW
  354. #else
  355. #define DSBM_QUERYINSERT DSBM_QUERYINSERTA
  356. #endif
  357. //
  358. // Called before we change the state of the icon (on tree collapse/expand)
  359. //
  360. #define DSBM_CHANGEIMAGESTATE 102 // lParam = adspath. Return TRUE/FALSE top allow/disallow
  361. //
  362. // The dialog receives a WM_HELP
  363. //
  364. #define DSBM_HELP 103 // lParam == LPHELPINFO structure
  365. //
  366. // The dialog receives a WM_CONTEXTMENU, DSBID_xxx are the control ID's for this
  367. // dialog so that you can display suitable help.
  368. //
  369. #define DSBM_CONTEXTMENU 104 // lParam == window handle to retrieve help for
  370. ;begin_internal
  371. //
  372. // The Exchange group use the DsBrowseForContainer API to brows the Exchange
  373. // store, and other LDAP servers. To support them we issue this callback
  374. // which will request the filter they want to use and any other information.
  375. //
  376. typedef struct
  377. {
  378. DWORD dwFlags;
  379. LPWSTR pszFilter; // filter string to be used when searching the DS (== NULL for default)
  380. INT cchFilter;
  381. LPWSTR pszNameAttribute; // attribute to request to get the display name of objects in the DS (== NULL for default).
  382. INT cchNameAttribute;
  383. } DSBROWSEDATA, * PDSBROWSEDATA;
  384. #define DSBM_GETBROWSEDATA 105 // lParam -> DSBROWSEDATA structure. Return TRUE if handled
  385. ;end_internal
  386. //
  387. // These are the control IDs for the controls in the dialog. The callback can use
  388. // these to modify the contents of the dialog as required.
  389. //
  390. #define DSBID_BANNER 256
  391. #define DSBID_CONTAINERLIST 257
  392. //
  393. // API exported for browsing for containers.
  394. //
  395. STDAPI_(int) DsBrowseForContainerW(PDSBROWSEINFOW pInfo);
  396. STDAPI_(int) DsBrowseForContainerA(PDSBROWSEINFOA pInfo);
  397. #ifdef UNICODE
  398. #define DsBrowseForContainer DsBrowseForContainerW
  399. #else
  400. #define DsBrowseForContainer DsBrowseForContainerA
  401. #endif
  402. // NOTE: these are here to keep old clients building - remove soon
  403. STDAPI_(HICON) DsGetIcon(DWORD dwFlags, LPWSTR pszObjectClass, INT cxImage, INT cyImage);
  404. STDAPI DsGetFriendlyClassName(LPWSTR pszObjectClass, LPWSTR pszBuffer, UINT cchBuffer);
  405. ;begin_internal
  406. //---------------------------------------------------------------------------//
  407. //
  408. // IDsFolderProperties
  409. // ===================
  410. // This is a private interface used to override the "Properties" verb
  411. // displayed in the DS client UI.
  412. //
  413. // Below the {CLISD_NameSpace}\Classes\<class name>\PropertiesHandler is
  414. // defined a GUID we will create an instance of that interface and
  415. // display the relevant UI.
  416. //
  417. // dsfolder also supports this interface to allow the query UI to invoke
  418. // properties for a given selection.
  419. //
  420. //---------------------------------------------------------------------------//
  421. #undef INTERFACE
  422. #define INTERFACE IDsFolderProperties
  423. DECLARE_INTERFACE_(IDsFolderProperties, IUnknown)
  424. {
  425. // *** IUnknown methods ***
  426. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  427. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  428. STDMETHOD_(ULONG,Release) (THIS) PURE;
  429. // IDsFolder methods
  430. STDMETHOD(ShowProperties)(THIS_ HWND hwndParent, IDataObject* pDataObject) PURE;
  431. };
  432. //---------------------------------------------------------------------------//
  433. //---------------------------------------------------------------------------//
  434. // Private helper API's exported by 'dsuiext.dll'.
  435. //---------------------------------------------------------------------------//
  436. //
  437. // To communicate information to the IShellFolder::ParseDisplayName method
  438. // of the Directory namespace we pass a IBindCtx with a property bag
  439. // associated with it.
  440. //
  441. // The property bag is used to pass in extra information about the
  442. // objects we have selected.
  443. //
  444. #define DS_PDN_PROPERTYBAG L"DsNamespaceShellFolderParsePropertyBag"
  445. //
  446. // These are the properties passed to the objcts
  447. //
  448. #define DS_PDN_OBJECTLCASS L"objectClass"
  449. //---------------------------------------------------------------------------//
  450. // String DPA helpers, adding strings to a DPA calling LocalAllocString and
  451. // then the relevant DPA functions.
  452. //---------------------------------------------------------------------------//
  453. STDAPI StringDPA_InsertStringA(HDPA hdpa, INT i, LPCSTR pszString);
  454. STDAPI StringDPA_InsertStringW(HDPA hdpa, INT i, LPCWSTR pszString);
  455. STDAPI StringDPA_AppendStringA(HDPA hdpa, LPCSTR pszString, PUINT_PTR presult);
  456. STDAPI StringDPA_AppendStringW(HDPA hdpa, LPCWSTR pszString, PUINT_PTR presult);
  457. STDAPI_(VOID) StringDPA_DeleteString(HDPA hdpa, INT index);
  458. STDAPI_(VOID) StringDPA_Destroy(HDPA* pHDPA);
  459. #define StringDPA_GetStringA(hdpa, i) ((LPSTR)DPA_GetPtr(hdpa, i))
  460. #define StringDPA_GetStringW(hdpa, i) ((LPWSTR)DPA_GetPtr(hdpa, i))
  461. #ifndef UNICODE
  462. #define StringDPA_InsertString StringDPA_InsertStringA
  463. #define StringDPA_AppendString StringDPA_AppendStringA
  464. #define StringDPA_GetString StringDPA_GetStringA
  465. #else
  466. #define StringDPA_InsertString StringDPA_InsertStringW
  467. #define StringDPA_AppendString StringDPA_AppendStringW
  468. #define StringDPA_GetString StringDPA_GetStringW
  469. #endif
  470. //---------------------------------------------------------------------------//
  471. // Handle strings via LocalAlloc
  472. //---------------------------------------------------------------------------//
  473. STDAPI LocalAllocStringA(LPSTR* ppResult, LPCSTR pszString);
  474. STDAPI LocalAllocStringLenA(LPSTR* ppResult, UINT cLen);
  475. STDAPI_(VOID) LocalFreeStringA(LPSTR* ppString);
  476. STDAPI LocalQueryStringA(LPSTR* ppResult, HKEY hk, LPCTSTR lpSubKey);
  477. STDAPI LocalAllocStringW(LPWSTR* ppResult, LPCWSTR pString);
  478. STDAPI LocalAllocStringLenW(LPWSTR* ppResult, UINT cLen);
  479. STDAPI_(VOID) LocalFreeStringW(LPWSTR* ppString);
  480. STDAPI LocalQueryStringW(LPWSTR* ppResult, HKEY hk, LPCTSTR lpSubKey);
  481. STDAPI LocalAllocStringA2W(LPWSTR* ppResult, LPCSTR pszString);
  482. STDAPI LocalAllocStringW2A(LPSTR* ppResult, LPCWSTR pszString);
  483. #ifndef UNICODE
  484. #define LocalAllocString LocalAllocStringA
  485. #define LocalAllocStringLen LocalAllocStringLenA
  486. #define LocalFreeString LocalFreeStringA
  487. #define LocalQueryString LocalQueryStringA
  488. #define LocalAllocStringA2T LocalAllocString
  489. #define LocalAllocStringW2T LocalAllocStringW2A
  490. #else
  491. #define LocalAllocString LocalAllocStringW
  492. #define LocalAllocStringLen LocalAllocStringLenW
  493. #define LocalFreeString LocalFreeStringW
  494. #define LocalQueryString LocalQueryStringW
  495. #define LocalAllocStringA2T LocalAllocStringA2W
  496. #define LocalAllocStringW2T LocalAllocString
  497. #endif
  498. STDAPI_(VOID) PutStringElementA(LPSTR pszBuffer, UINT* pLen, LPCSTR pszElement);
  499. STDAPI_(VOID) PutStringElementW(LPWSTR pszszBuffer, UINT* pLen, LPCWSTR pszElement);
  500. STDAPI GetStringElementA(LPSTR pszString, INT index, LPSTR pszBuffer, INT cchBuffer);
  501. STDAPI GetStringElementW(LPWSTR pszString, INT index, LPWSTR pszBuffer, INT cchBuffer);
  502. #ifndef UNICODE
  503. #define PutStringElement PutStringElementA
  504. #define GetStringElement GetStringElementA
  505. #else
  506. #define PutStringElement PutStringElementW
  507. #define GetStringElement GetStringElementW
  508. #endif
  509. //---------------------------------------------------------------------------//
  510. // Utility stuff common to dsfolder, dsquery etc
  511. //---------------------------------------------------------------------------//
  512. STDAPI_(INT) FormatMsgBox(HWND hWnd, HINSTANCE hInstance, UINT uidTitle, UINT uidPrompt, UINT uType, ...);
  513. STDAPI FormatMsgResource(LPTSTR* ppString, HINSTANCE hInstance, UINT uID, ...);
  514. STDAPI FormatDirectoryName(LPTSTR* ppString, HINSTANCE hInstance, UINT uID);
  515. STDAPI StringFromSearchColumn(PADS_SEARCH_COLUMN pColumn, LPWSTR* ppBuffer);
  516. STDAPI ObjectClassFromSearchColumn(PADS_SEARCH_COLUMN pColumn, LPWSTR* ppBuffer);
  517. typedef HRESULT (CALLBACK * LPGETARRAYCONTENTCB)(DWORD dwIndex, BSTR bstrValue, LPVOID pData);
  518. STDAPI GetArrayContents(LPVARIANT pVariant, LPGETARRAYCONTENTCB pCB, LPVOID pData);
  519. STDAPI GetDisplayNameFromADsPath(LPCWSTR pszszPath, LPWSTR pszszBuffer, INT cchBuffer, IADsPathname *padp, BOOL fPrefix);
  520. STDAPI_(DWORD) CheckDsPolicy(LPCTSTR pszSubKey, LPCTSTR pszValue);
  521. STDAPI_(BOOL) ShowDirectoryUI(VOID);
  522. ;end_internal
  523. ;begin_both
  524. #endif // GUID_DEFS_ONLY
  525. #endif
  526. ;end_both