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.

121 lines
1.8 KiB

  1. /*
  2. * TSUtil.h
  3. *
  4. * General purpose utilities library. The entry points listed in this header
  5. * conform to the NT API style.
  6. */
  7. #ifndef __TERMSRV_INC_TSUTILNT_H__
  8. #define __TERMSRV_INC_TSUTILNT_H__
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /*
  13. * ACL Utilities
  14. */
  15. #ifdef _NTSEAPI_
  16. NTSTATUS NTAPI
  17. NtConvertAbsoluteToSelfRelative(
  18. OUT PSECURITY_DESCRIPTOR *ppSelfRelativeSd,
  19. IN PSECURITY_DESCRIPTOR pAbsoluteSd,
  20. IN PULONG pcbSelfRelativeSd OPTIONAL
  21. );
  22. NTSTATUS NTAPI
  23. NtConvertSelfRelativeToAbsolute(
  24. OUT PSECURITY_DESCRIPTOR *ppAbsoluteSd,
  25. IN PSECURITY_DESCRIPTOR pSelfRelativeSd
  26. );
  27. NTSTATUS NTAPI
  28. NtDestroySecurityDescriptor(
  29. IN OUT PSECURITY_DESCRIPTOR *ppSd
  30. );
  31. NTSTATUS NTAPI
  32. NtIsSecurityDescriptorAbsolute(
  33. IN PSECURITY_DESCRIPTOR pSd,
  34. OUT PBOOLEAN pfAbsolute
  35. );
  36. #endif
  37. /*
  38. * String Utilities
  39. */
  40. NTSTATUS NTAPI
  41. NtAllocateAndCopyStringA(
  42. PSTR *ppDestination,
  43. PCSTR pString
  44. );
  45. NTSTATUS NTAPI
  46. NtAllocateAndCopyStringW(
  47. PWSTR *ppDestination,
  48. PCWSTR pString
  49. );
  50. NTSTATUS NTAPI
  51. NtConvertAnsiToUnicode(
  52. PWSTR *ppUnicodeString,
  53. PCSTR pAnsiString
  54. );
  55. NTSTATUS NTAPI
  56. NtConvertUnicodeToAnsi(
  57. PSTR *ppAnsiString,
  58. PCWSTR pUnicodeString
  59. );
  60. /*
  61. * User Utilities
  62. */
  63. #ifdef _NTSEAPI_
  64. NTSTATUS NTAPI
  65. NtCreateAdminSid(
  66. OUT PSID *ppAdminSid
  67. );
  68. NTSTATUS NTAPI
  69. NtCreateSystemSid(
  70. OUT PSID *ppSystemSid
  71. );
  72. #endif
  73. /*
  74. * LSA Utilities
  75. */
  76. #ifdef _NTLSA_
  77. VOID NTAPI
  78. InitLsaString(
  79. IN PLSA_UNICODE_STRING pLsaString,
  80. IN PCWSTR pString
  81. );
  82. #endif
  83. /*
  84. * Miscellaneous Utilities
  85. */
  86. #ifndef __TERMSRV_INC_TSUTIL_H__
  87. #define GetCurrentConsoleId() (USER_SHARED_DATA->ActiveConsoleId)
  88. #define GetCurrentLogonId() (NtCurrentPeb()->LogonId)
  89. #endif
  90. #ifdef __cplusplus
  91. }
  92. #endif
  93. #endif // __TERMSRV_INC_TSUTILNT_H__