Source code of Windows XP (NT5)
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.

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