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.

129 lines
4.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: schema.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _SCHEMA_CACHE_H_
  11. #define _SCHEMA_CACHE_H_
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. //
  16. // Generic Mapping for DS, adapted from \nt\private\ds\src\inc\permit.h
  17. //
  18. #define DS_GENERIC_READ ((STANDARD_RIGHTS_READ) | \
  19. (ACTRL_DS_LIST) | \
  20. (ACTRL_DS_READ_PROP) | \
  21. (ACTRL_DS_LIST_OBJECT))
  22. #define DS_GENERIC_EXECUTE ((STANDARD_RIGHTS_EXECUTE) | \
  23. (ACTRL_DS_LIST))
  24. // Note, STANDARD_RIGHTS_WRITE is specifically NOT included here
  25. #define DS_GENERIC_WRITE ((ACTRL_DS_SELF) | \
  26. (ACTRL_DS_WRITE_PROP))
  27. #define DS_GENERIC_ALL ((STANDARD_RIGHTS_REQUIRED) | \
  28. (ACTRL_DS_CREATE_CHILD) | \
  29. (ACTRL_DS_DELETE_CHILD) | \
  30. (ACTRL_DS_DELETE_TREE) | \
  31. (ACTRL_DS_READ_PROP) | \
  32. (ACTRL_DS_WRITE_PROP) | \
  33. (ACTRL_DS_LIST) | \
  34. (ACTRL_DS_LIST_OBJECT) | \
  35. (ACTRL_DS_CONTROL_ACCESS) | \
  36. (ACTRL_DS_SELF))
  37. //
  38. // Flags for SchemaCache_Get****ID
  39. //
  40. #define IDC_CLASS_NO_CREATE 0x00000001
  41. #define IDC_CLASS_NO_DELETE 0x00000002
  42. #define IDC_CLASS_NO_INHERIT 0x00000004
  43. #define IDC_PROP_NO_READ IDC_CLASS_NO_CREATE
  44. #define IDC_PROP_NO_WRITE IDC_CLASS_NO_DELETE
  45. #define OTL_ADDED_TO_LIST 0x00000008
  46. #define IDC_CLASS_NONE (IDC_CLASS_NO_CREATE | IDC_CLASS_NO_DELETE | IDC_CLASS_NO_INHERIT)
  47. #define IDC_PROP_NONE (IDC_PROP_NO_READ | IDC_PROP_NO_WRITE)
  48. #define SCHEMA_COMMON_PERM 0x80000000
  49. #define SCHEMA_NO_FILTER 0x40000000
  50. #define SCHEMA_CLASS 0x20000000
  51. //
  52. //Purpose: Used to store information about aux class
  53. //
  54. typedef struct _AUX_INFO{
  55. GUID guid; //Object Type Guid of class
  56. WCHAR pszClassName[ANYSIZE_ARRAY]; //class Name
  57. }AUX_INFO, *PAUX_INFO;
  58. //
  59. //Purpose: Used to cache Access information passed to get access right
  60. //
  61. typedef struct _ACCESS_INFO{
  62. GUID ObjectTypeGuid;
  63. DWORD dwFlags;
  64. BOOL bLocalFree;
  65. PSI_ACCESS pAccess;
  66. ULONG cAccesses;
  67. ULONG iDefaultAccess;
  68. }ACCESS_INFO, *PACCESS_INFO;
  69. HRESULT SchemaCache_Create(LPCTSTR pszServer);
  70. void SchemaCache_Destroy(void);
  71. HRESULT SchemaCache_GetInheritTypes(LPCGUID pguidObjectType,
  72. DWORD dwFlags,
  73. PSI_INHERIT_TYPE *ppInheritTypes,
  74. ULONG *pcInheritTypes);
  75. HRESULT SchemaCache_GetAccessRights(LPCGUID pguidObjectType,
  76. LPCTSTR pszClassName, // optional (faster if provided)
  77. HDPA hAuxList,
  78. LPCTSTR pszSchemaPath,
  79. DWORD dwFlags, // 0, SI_ADVANCED, or SI_ADVANCED | SI_EDIT_PROPERTIES
  80. PACCESS_INFO* ppAccesInfo);
  81. HRESULT Schema_BindToObject(LPCTSTR pszSchemaPath,
  82. LPCTSTR pszName,
  83. REFIID riid,
  84. LPVOID *ppv);
  85. HRESULT Schema_GetObjectID(IADs *pObj, LPGUID pGUID);
  86. HRESULT Schema_GetDefaultSD( GUID *pSchemaGuid,
  87. PSID pDomainSid,
  88. PSID pRootDomainSid,
  89. PSECURITY_DESCRIPTOR *ppSD = NULL );
  90. HRESULT Schema_GetObjectTypeList(GUID *pSchamaGuid,
  91. HDPA hAuxList,
  92. LPCWSTR pszSchemaPath,
  93. DWORD dwFlags,
  94. POBJECT_TYPE_LIST *ppObjectTypeList,
  95. DWORD * pObjectTypeListCount);
  96. HRESULT Schema_GetObjectTypeGuid(LPCWSTR pszClassName, LPGUID pGuid);
  97. AUTHZ_RESOURCE_MANAGER_HANDLE Schema_GetAUTHZ_RM();
  98. bool DoesPathContainServer(LPCWSTR pszPath);
  99. HRESULT OpenDSObject (LPTSTR lpPath, LPTSTR lpUserName, LPTSTR lpPassword, DWORD dwFlags, REFIID riid, void FAR * FAR * ppObject);
  100. void
  101. DestroyDPA(HDPA hList);
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105. #endif // _SCHEMA_CACHE_H_