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.

160 lines
2.5 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. /*
  32. * ACL Utilities
  33. */
  34. #if defined(__ACCESS_CONTROL__) && (defined(_WINNT_) || defined(_NTDEF_))
  35. BOOL WINAPI
  36. AddSidToObjectsSecurityDescriptor(
  37. IN HANDLE hObject,
  38. IN SE_OBJECT_TYPE ObjectType,
  39. IN PSID pSid,
  40. IN DWORD dwNewAccess,
  41. IN ACCESS_MODE AccessMode,
  42. IN DWORD dwInheritance
  43. );
  44. BOOL WINAPI
  45. AddSidToSecurityDescriptor(
  46. IN OUT PSECURITY_DESCRIPTOR *ppSd,
  47. IN PSID pSid,
  48. IN DWORD dwNewAccess,
  49. IN ACCESS_MODE AccessMode,
  50. IN DWORD dwInheritance
  51. );
  52. BOOL WINAPI
  53. ConvertAbsoluteToSelfRelative(
  54. OUT PSECURITY_DESCRIPTOR *ppSelfRelativeSd,
  55. IN PSECURITY_DESCRIPTOR pAbsoluteSd,
  56. IN PDWORD pcbSelfRelativeSd OPTIONAL
  57. );
  58. BOOL WINAPI
  59. ConvertSelfRelativeToAbsolute(
  60. OUT PSECURITY_DESCRIPTOR *ppAbsoluteSd,
  61. IN PSECURITY_DESCRIPTOR pSelfRelativeSd
  62. );
  63. BOOL WINAPI
  64. DestroySecurityDescriptor(
  65. IN OUT PSECURITY_DESCRIPTOR *ppSd
  66. );
  67. BOOL WINAPI
  68. IsSecurityDescriptorAbsolute(
  69. IN PSECURITY_DESCRIPTOR pSd
  70. );
  71. #endif
  72. /*
  73. * String Utilities
  74. */
  75. PSTR WINAPI
  76. AllocateAndCopyStringA(
  77. IN PCSTR pString
  78. );
  79. PWSTR WINAPI
  80. AllocateAndCopyStringW(
  81. IN PCWSTR pString
  82. );
  83. BOOL WINAPI
  84. ConvertAnsiToUnicode(
  85. OUT PWSTR *ppUnicodeString,
  86. IN PCSTR pAnsiString
  87. );
  88. BOOL WINAPI
  89. ConvertUnicodeToAnsi(
  90. OUT PSTR *ppAnsiString,
  91. IN PCWSTR pUnicodeString
  92. );
  93. /*
  94. * User Utilities
  95. */
  96. #ifdef _WINNT_
  97. BOOL WINAPI
  98. CreateAdminSid(
  99. OUT PSID *ppAdminSid
  100. );
  101. BOOL WINAPI
  102. CreateSystemSid(
  103. OUT PSID *ppSystemSid
  104. );
  105. BOOL WINAPI
  106. IsUserMember(
  107. IN PSID pSid
  108. );
  109. #endif
  110. /*
  111. * Miscellaneous Utilities
  112. */
  113. #ifndef __TERMSRV_INC_TSUTILNT_H__
  114. #define GetCurrentConsoleId() (USER_SHARED_DATA->ActiveConsoleId)
  115. #define GetCurrentLogonId() (NtCurrentPeb()->LogonId)
  116. #endif
  117. BOOL WINAPI
  118. LoadStringResourceW(
  119. IN HMODULE hModule,
  120. IN UINT uiResourceId,
  121. OUT PWSTR *ppString,
  122. OUT PDWORD pcchString OPTIONAL
  123. );
  124. #ifdef __cplusplus
  125. }
  126. #endif
  127. #endif // __TERMSRV_INC_TSUTIL_H__