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.

133 lines
2.5 KiB

  1. /*
  2. File dsrights.h
  3. header for project that establishes a ras server
  4. in a domain.
  5. Paul Mayfield, 4/20/98
  6. */
  7. #include <nt.h>
  8. #include <ntrtl.h>
  9. #include <nturtl.h>
  10. #include <ntlsa.h>
  11. #include <ntmsv1_0.h>
  12. #include <crypt.h>
  13. #define INC_OLE2
  14. #include <windows.h>
  15. #include <lmcons.h>
  16. #include <lmapibuf.h>
  17. #include <lmaccess.h>
  18. #include <raserror.h>
  19. #include <string.h>
  20. #include <stdlib.h>
  21. #include <stdio.h>
  22. #include <locale.h>
  23. #include <tchar.h>
  24. #define SECURITY_WIN32
  25. #include <sspi.h>
  26. #include <activeds.h>
  27. #include <adsi.h>
  28. #include <ntdsapi.h>
  29. #include <dsrole.h>
  30. #include <dsgetdc.h>
  31. #include <accctrl.h>
  32. #include <aclapi.h>
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. DWORD DsrTraceInit();
  37. DWORD DsrTraceCleanup();
  38. DWORD DsrTraceEx (DWORD dwErr, LPSTR pszTrace, ...);
  39. #define DSR_ERROR(e) ((HRESULT_FACILITY((e)) == FACILITY_WIN32) ? HRESULT_CODE((e)) : (e));
  40. #define DSR_FREE(s) if ((s)) DsrFree ((s))
  41. #define DSR_RELEASE(s) if ((s)) (s)->Release();
  42. #define DSR_BREAK_ON_FAILED_HR(_hr) {if (FAILED((_hr))) break;}
  43. //
  44. // Typedefs
  45. //
  46. typedef struct _DSRINFO
  47. {
  48. PWCHAR pszMachineDN;
  49. PWCHAR pszGroupDN;
  50. } DSRINFO;
  51. //
  52. // Memory management routines
  53. //
  54. PVOID
  55. DsrAlloc (
  56. IN DWORD dwSize,
  57. IN BOOL bZero);
  58. DWORD
  59. DsrFree (
  60. IN PVOID pvBuf);
  61. //
  62. // Searches given domain for a computer account
  63. // with the given name and returns its ADsPath
  64. // if found.
  65. //
  66. DWORD
  67. DsrFindDomainComputer (
  68. IN PWCHAR pszDomain,
  69. IN PWCHAR pszComputer,
  70. OUT PWCHAR* ppszADsPath);
  71. //
  72. // Searches given domain for the well known
  73. // "RAS and IAS Servers" group and returns
  74. // its ADsPath if found.
  75. //
  76. DWORD
  77. DsrFindRasServersGroup (
  78. IN PWCHAR pszDomain,
  79. OUT PWCHAR* ppszADsPath);
  80. //
  81. // Adds or removes a given object from a given group.
  82. //
  83. DWORD
  84. DsrGroupAddRemoveMember(
  85. IN PWCHAR pszGroupDN,
  86. IN PWCHAR pszNewMemberDN,
  87. IN BOOL bAdd);
  88. //
  89. // Returns whether the given object is a member of
  90. // the given group.
  91. //
  92. DWORD
  93. DsrGroupIsMember(
  94. IN PWCHAR pszGroupDN,
  95. IN PWCHAR pszObjectName,
  96. OUT PBOOL pbIsMember);
  97. //
  98. // Sets the ACES in the given domain to enable nt4 servers
  99. //
  100. DWORD
  101. DsrDomainSetAccess(
  102. IN PWCHAR pszDomain,
  103. IN DWORD dwAccessFlags);
  104. //
  105. // Discovers whether security is such that nt4 ras servers
  106. // can authenticate.
  107. //
  108. DWORD
  109. DsrDomainQueryAccess(
  110. IN PWCHAR pszDomain,
  111. OUT LPDWORD lpdwAccessFlags);
  112. #ifdef __cplusplus
  113. }
  114. #endif