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.

165 lines
2.7 KiB

  1. /*
  2. * TSUtil.h
  3. *
  4. * General purpose utilities library. The entry points listed in this header
  5. * conform to the Win32 API style.
  6. */
  7. #ifndef __TERMSRV_INC_TSUTIL_H__
  8. #define __TERMSRV_INC_TSUTIL_H__
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /*
  13. * Terminal Services Utilities
  14. */
  15. BOOL WINAPI
  16. IsFullTerminalServicesEnabled(
  17. VOID
  18. );
  19. BOOL WINAPI
  20. IsPersonalTerminalServicesEnabled(
  21. VOID
  22. );
  23. BOOL WINAPI
  24. IsTerminalServicesEnabled(
  25. VOID
  26. );
  27. BOOL WINAPI
  28. IsPersonalWorkstation(
  29. VOID
  30. );
  31. BOOL WINAPI
  32. IsAdvancedServer(
  33. VOID
  34. );
  35. /*
  36. * ACL Utilities
  37. */
  38. #if defined(__ACCESS_CONTROL__) && (defined(_WINNT_) || defined(_NTDEF_))
  39. BOOL WINAPI
  40. AddSidToObjectsSecurityDescriptor(
  41. IN HANDLE hObject,
  42. IN SE_OBJECT_TYPE ObjectType,
  43. IN PSID pSid,
  44. IN DWORD dwNewAccess,
  45. IN ACCESS_MODE AccessMode,
  46. IN DWORD dwInheritance
  47. );
  48. BOOL WINAPI
  49. AddSidToSecurityDescriptor(
  50. IN OUT PSECURITY_DESCRIPTOR *ppSd,
  51. IN PSID pSid,
  52. IN DWORD dwNewAccess,
  53. IN ACCESS_MODE AccessMode,
  54. IN DWORD dwInheritance
  55. );
  56. BOOL WINAPI
  57. ConvertAbsoluteToSelfRelative(
  58. OUT PSECURITY_DESCRIPTOR *ppSelfRelativeSd,
  59. IN PSECURITY_DESCRIPTOR pAbsoluteSd,
  60. IN PDWORD pcbSelfRelativeSd OPTIONAL
  61. );
  62. BOOL WINAPI
  63. ConvertSelfRelativeToAbsolute(
  64. OUT PSECURITY_DESCRIPTOR *ppAbsoluteSd,
  65. IN PSECURITY_DESCRIPTOR pSelfRelativeSd
  66. );
  67. BOOL WINAPI
  68. DestroySecurityDescriptor(
  69. IN OUT PSECURITY_DESCRIPTOR *ppSd
  70. );
  71. BOOL WINAPI
  72. IsSecurityDescriptorAbsolute(
  73. IN PSECURITY_DESCRIPTOR pSd
  74. );
  75. #endif
  76. /*
  77. * String Utilities
  78. */
  79. PSTR WINAPI
  80. AllocateAndCopyStringA(
  81. IN PCSTR pString
  82. );
  83. PWSTR WINAPI
  84. AllocateAndCopyStringW(
  85. IN PCWSTR pString
  86. );
  87. BOOL WINAPI
  88. ConvertAnsiToUnicode(
  89. OUT PWSTR *ppUnicodeString,
  90. IN PCSTR pAnsiString
  91. );
  92. BOOL WINAPI
  93. ConvertUnicodeToAnsi(
  94. OUT PSTR *ppAnsiString,
  95. IN PCWSTR pUnicodeString
  96. );
  97. /*
  98. * User Utilities
  99. */
  100. #ifdef _WINNT_
  101. BOOL WINAPI
  102. CreateAdminSid(
  103. OUT PSID *ppAdminSid
  104. );
  105. BOOL WINAPI
  106. CreateSystemSid(
  107. OUT PSID *ppSystemSid
  108. );
  109. BOOL WINAPI
  110. IsUserMember(
  111. IN PSID pSid
  112. );
  113. #endif
  114. /*
  115. * Miscellaneous Utilities
  116. */
  117. #ifndef __TERMSRV_INC_TSUTILNT_H__
  118. #define GetCurrentConsoleId() (USER_SHARED_DATA->ActiveConsoleId)
  119. #define GetCurrentLogonId() (NtCurrentPeb()->LogonId)
  120. #endif
  121. BOOL WINAPI
  122. LoadStringResourceW(
  123. IN HMODULE hModule,
  124. IN UINT uiResourceId,
  125. OUT PWSTR *ppString,
  126. OUT PDWORD pcchString OPTIONAL
  127. );
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif // __TERMSRV_INC_TSUTIL_H__