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.

107 lines
2.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows NT Security
  4. // Copyright (C) Microsoft Corporation, 1997 - 1998
  5. //
  6. // File: dsctx.h
  7. //
  8. // Contents: NT Marta DS object context class
  9. //
  10. // History: 4-1-1999 kirtd Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #if !defined(__DSCTX_H__)
  14. #define __DSCTX_H__
  15. #include <windows.h>
  16. #include <ds.h>
  17. #include <ldapsp.h>
  18. #include <assert.h>
  19. #include <ntldap.h>
  20. #include <rpc.h>
  21. #include <rpcndr.h>
  22. #include <ntdsapi.h>
  23. #include <ole2.h>
  24. //
  25. // CDsObjectContext. This represents a DS object to the NT Marta
  26. // infrastructure
  27. //
  28. class CDsObjectContext
  29. {
  30. public:
  31. //
  32. // Construction
  33. //
  34. CDsObjectContext ();
  35. ~CDsObjectContext ();
  36. DWORD InitializeByName (LPCWSTR pObjectName, ACCESS_MASK AccessMask);
  37. //
  38. // Dispatch methods
  39. //
  40. DWORD AddRef ();
  41. DWORD Release ();
  42. DWORD GetDsObjectProperties (
  43. PMARTA_OBJECT_PROPERTIES pProperties
  44. );
  45. DWORD GetDsObjectRights (
  46. SECURITY_INFORMATION SecurityInfo,
  47. PSECURITY_DESCRIPTOR* ppSecurityDescriptor
  48. );
  49. DWORD SetDsObjectRights (
  50. SECURITY_INFORMATION SecurityInfo,
  51. PSECURITY_DESCRIPTOR pSecurityDescriptor
  52. );
  53. DWORD GetDsObjectGuid (
  54. GUID* pGuid
  55. );
  56. private:
  57. //
  58. // Reference count
  59. //
  60. DWORD m_cRefs;
  61. //
  62. // LDAP URL components
  63. //
  64. LDAP_URL_COMPONENTS m_LdapUrlComponents;
  65. //
  66. // LDAP binding handle
  67. //
  68. LDAP* m_pBinding;
  69. };
  70. DWORD
  71. MartaReadDSObjSecDesc(IN PLDAP pLDAP,
  72. IN LPWSTR pszObject,
  73. IN SECURITY_INFORMATION SeInfo,
  74. OUT PSECURITY_DESCRIPTOR *ppSD);
  75. DWORD
  76. MartaStampSD(IN LPWSTR pszObject,
  77. IN ULONG cSDSize,
  78. IN SECURITY_INFORMATION SeInfo,
  79. IN PSECURITY_DESCRIPTOR pSD,
  80. IN PLDAP pLDAP);
  81. #define SD_PROP_NAME L"nTSecurityDescriptor"
  82. #endif