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.

101 lines
5.5 KiB

  1. #ifndef __cache_h
  2. #define __cache_h
  3. //
  4. // Class cache exports
  5. //
  6. #define CLASSCACHE_PROPPAGES 0x00000001 // = 1 => get property page list
  7. #define CLASSCACHE_CONTEXTMENUS 0x00000002 // = 1 => get context menu table
  8. #define CLASSCACHE_ICONS 0x00000004 // = 1 => get icon locations
  9. #define CLASSCACHE_CONTAINER 0x00000008 // = 1 => get container flag for class
  10. #define CLASSCACHE_FRIENDLYNAME 0x00000010 // = 1 => get friendly name of the class
  11. #define CLASSCACHE_ATTRIBUTENAMES 0x00000020 // = 1 => get attribute names of class
  12. #define CLASSCACHE_TREATASLEAF 0x00000040 // = 1 => get the treat as leaf flags
  13. #define CLASSCACHE_WIZARDDIALOG 0x00000080 // = 1 => get the creation wizard dialog CLSID
  14. #define CLASSCACHE_WIZARDPRIMARYPAGE 0x00000100 // = 1 => get the creation wizard primary CLSID
  15. #define CLASSCACHE_WIZARDEXTN 0x00000200 // = 1 => get the creation wizard extension CLSIDs
  16. #define CLASSCACHE_CREATIONINFO (CLASSCACHE_WIZARDDIALOG|CLASSCACHE_WIZARDPRIMARYPAGE|CLASSCACHE_WIZARDEXTN)
  17. #define CLASSCACHE_IMAGEMASK 0x000f0000 // mask + shift for getting image mask
  18. #define CLASSCACHE_IMAGEMASK_BIT 16
  19. #define CLASSCACHE_DSAVAILABLE 0x40000000 // = 1 => set GDSIF_DSAVAILABLE when calling GetDisplaySpecifierEx
  20. #define CLASSCACHE_SIMPLEAUTHENTICATE 0x80000000 // = 1 => perform simple authentication (eg ~ADS_SECURE_AUTHENTICATION)
  21. typedef struct
  22. {
  23. LPWSTR pPageReference; // page reference in strange URL form
  24. } DSPROPERTYPAGE, * LPDSPROPERTYPAGE;
  25. typedef struct
  26. {
  27. LPWSTR pMenuReference; // menu reference stored in strange URL reference
  28. } DSMENUHANDLER, * LPDSMENUHANDLER;
  29. typedef struct
  30. {
  31. LPWSTR pName; // UNICODE atribute name
  32. LPWSTR pDisplayName; // UNICODE display name
  33. ADSTYPE dwADsType; // ADsType for the property
  34. DWORD dwFlags; // flags for attribute (from display specifier)
  35. } ATTRIBUTENAME, * LPATTRIBUTENAME;
  36. typedef struct
  37. {
  38. CRITICAL_SECTION csLock; // lock for this cache record
  39. LPWSTR pKey; // key string
  40. DWORD dwFlags; // cache entries we tried to cache
  41. DWORD dwCached; // fields which have been cached
  42. LPWSTR pObjectClass; // class name to find display specifier under
  43. LPWSTR pServer; // server name / == NULL if none specified
  44. LPWSTR pFriendlyClassName; // friendly class name
  45. HDSA hdsaPropertyPages; // property page list
  46. HDSA hdsaMenuHandlers; // list of menu handlers to bring in
  47. LPWSTR pIconName[DSGIF_ISMASK]; // icon names for the various states
  48. BOOL fIsContainer:1; // class is a conatiner
  49. BOOL fTreatAsLeaf:1; // treat this class as a leaf
  50. HDPA hdpaAttributeNames; // DPA containing the attribute names
  51. CLSID clsidWizardDialog; // CLSID of iface for creation dialog
  52. CLSID clsidWizardPrimaryPage; // CLSID of iface for wizards primary page
  53. HDSA hdsaWizardExtn; // DSA containing wizard extension pages
  54. } CLASSCACHEENTRY, * LPCLASSCACHEENTRY;
  55. typedef struct
  56. {
  57. DWORD dwFlags; // Cache attributes interested in
  58. LPWSTR pPath; // ADsPath of a reference object
  59. LPWSTR pObjectClass; // Object Class of the class we need information on
  60. LPWSTR pAttributePrefix; // Attribute prefixed used when reading display specifiers
  61. LPWSTR pServer; // Server name == NULL then we assume this is serverless
  62. LPWSTR pServerConfigPath; // Server config path == NULL then determine from the server name
  63. LPWSTR pUserName; // pUserName / pPassword passed to ADsOpenObject as credential information
  64. LPWSTR pPassword;
  65. LANGID langid; // lang ID to be used
  66. IDataObject* pDataObject; // IDataObject containing extra information
  67. } CLASSCACHEGETINFO, * LPCLASSCACHEGETINFO;
  68. //
  69. // Cache helper functions
  70. //
  71. INT _CompareAttributeNameCB(LPVOID p1, LPVOID p2, LPARAM lParam);
  72. VOID ClassCache_Init(VOID);
  73. HRESULT ClassCache_GetClassInfo(LPCLASSCACHEGETINFO pCacheInfo, LPCLASSCACHEENTRY* ppCacheEntry);
  74. VOID ClassCache_ReleaseClassInfo(LPCLASSCACHEENTRY* ppCacheEntry);
  75. VOID ClassCache_Discard(VOID);
  76. ADSTYPE ClassCache_GetADsTypeFromAttribute(LPCLASSCACHEGETINFO pccgi, LPCWSTR pAttributeName);
  77. HRESULT GetRootDSE(LPCWSTR pszUserName, LPCWSTR pszPassword, LPCWSTR pszServer, BOOL fSecure, IADs **ppads);
  78. HRESULT GetCacheInfoRootDSE(LPCLASSCACHEGETINFO pccgi, IADs **ppads);
  79. HRESULT GetDisplaySpecifier(LPCLASSCACHEGETINFO pccgi, REFIID riid, LPVOID* ppvObject);
  80. HRESULT GetServerAndCredentails(LPCLASSCACHEGETINFO pccgi);
  81. HRESULT GetAttributePrefix(LPWSTR* ppAttributePrefix, IDataObject* pDataObject);
  82. BOOL _IsClassContainer(LPCLASSCACHEENTRY pClassCacheEntry, BOOL fIgnoreTreatAsLeaf);
  83. HRESULT _GetIconLocation(LPCLASSCACHEENTRY pCacheEntry, DWORD dwFlags, LPWSTR pBuffer, INT cchBuffer, INT* piIndex);
  84. #endif