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.

103 lines
5.8 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_DONTSIGNSEAL 0x20000000 // = 1 => don't sign seal (~ADS_USE_SIGNING | ADS_USE_SEALING)
  20. #define CLASSCACHE_DSAVAILABLE 0x40000000 // = 1 => set GDSIF_DSAVAILABLE when calling GetDisplaySpecifierEx
  21. #define CLASSCACHE_SIMPLEAUTHENTICATE 0x80000000 // = 1 => perform simple authentication (eg ~ADS_SECURE_AUTHENTICATION)
  22. typedef struct
  23. {
  24. LPWSTR pPageReference; // page reference in strange URL form
  25. } DSPROPERTYPAGE, * LPDSPROPERTYPAGE;
  26. typedef struct
  27. {
  28. LPWSTR pMenuReference; // menu reference stored in strange URL reference
  29. } DSMENUHANDLER, * LPDSMENUHANDLER;
  30. typedef struct
  31. {
  32. LPWSTR pName; // UNICODE atribute name
  33. LPWSTR pDisplayName; // UNICODE display name
  34. ADSTYPE dwADsType; // ADsType for the property
  35. DWORD dwFlags; // flags for attribute (from display specifier)
  36. } ATTRIBUTENAME, * LPATTRIBUTENAME;
  37. typedef struct
  38. {
  39. CRITICAL_SECTION csLock; // lock for this cache record
  40. LPWSTR pKey; // key string
  41. DWORD dwFlags; // cache entries we tried to cache
  42. DWORD dwCached; // fields which have been cached
  43. LPWSTR pObjectClass; // class name to find display specifier under
  44. LPWSTR pServer; // server name / == NULL if none specified
  45. LPWSTR pFriendlyClassName; // friendly class name
  46. HDSA hdsaPropertyPages; // property page list
  47. HDSA hdsaMenuHandlers; // list of menu handlers to bring in
  48. LPWSTR pIconName[DSGIF_ISMASK]; // icon names for the various states
  49. BOOL fIsContainer:1; // class is a conatiner
  50. BOOL fTreatAsLeaf:1; // treat this class as a leaf
  51. HDPA hdpaAttributeNames; // DPA containing the attribute names
  52. CLSID clsidWizardDialog; // CLSID of iface for creation dialog
  53. CLSID clsidWizardPrimaryPage; // CLSID of iface for wizards primary page
  54. HDSA hdsaWizardExtn; // DSA containing wizard extension pages
  55. } CLASSCACHEENTRY, * LPCLASSCACHEENTRY;
  56. typedef struct
  57. {
  58. DWORD dwFlags; // Cache attributes interested in
  59. LPWSTR pPath; // ADsPath of a reference object
  60. LPWSTR pObjectClass; // Object Class of the class we need information on
  61. LPWSTR pAttributePrefix; // Attribute prefixed used when reading display specifiers
  62. LPWSTR pServer; // Server name == NULL then we assume this is serverless
  63. LPWSTR pServerConfigPath; // Server config path == NULL then determine from the server name
  64. LPWSTR pUserName; // pUserName / pPassword passed to ADsOpenObject as credential information
  65. LPWSTR pPassword;
  66. LANGID langid; // lang ID to be used
  67. IDataObject* pDataObject; // IDataObject containing extra information
  68. } CLASSCACHEGETINFO, * LPCLASSCACHEGETINFO;
  69. //
  70. // Cache helper functions
  71. //
  72. INT _CompareAttributeNameCB(LPVOID p1, LPVOID p2, LPARAM lParam);
  73. VOID ClassCache_Init(VOID);
  74. HRESULT ClassCache_GetClassInfo(LPCLASSCACHEGETINFO pCacheInfo, LPCLASSCACHEENTRY* ppCacheEntry);
  75. VOID ClassCache_ReleaseClassInfo(LPCLASSCACHEENTRY* ppCacheEntry);
  76. VOID ClassCache_Discard(VOID);
  77. ADSTYPE ClassCache_GetADsTypeFromAttribute(LPCLASSCACHEGETINFO pccgi, LPCWSTR pAttributeName);
  78. HRESULT ClassCache_OpenObject(LPCWSTR pszPath, REFIID riid, void **ppv, LPCLASSCACHEGETINFO pccgi);
  79. HRESULT GetRootDSE(LPCWSTR pszUserName, LPCWSTR pszPassword, LPCWSTR pszServer, BOOL fSecure, IADs **ppads);
  80. HRESULT GetCacheInfoRootDSE(LPCLASSCACHEGETINFO pccgi, IADs **ppads);
  81. HRESULT GetDisplaySpecifier(LPCLASSCACHEGETINFO pccgi, REFIID riid, LPVOID* ppvObject);
  82. HRESULT GetServerAndCredentails(LPCLASSCACHEGETINFO pccgi);
  83. HRESULT GetAttributePrefix(LPWSTR* ppAttributePrefix, IDataObject* pDataObject);
  84. BOOL _IsClassContainer(LPCLASSCACHEENTRY pClassCacheEntry, BOOL fIgnoreTreatAsLeaf);
  85. HRESULT _GetIconLocation(LPCLASSCACHEENTRY pCacheEntry, DWORD dwFlags, LPWSTR pBuffer, INT cchBuffer, INT* piIndex);
  86. #endif