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.

126 lines
2.0 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. NTSTATUS NTAPI
  73. NtCreateAnonymousSid(
  74. PSID *ppAnonymousSid
  75. );
  76. #endif
  77. /*
  78. * LSA Utilities
  79. */
  80. #ifdef _NTLSA_
  81. VOID NTAPI
  82. InitLsaString(
  83. IN PLSA_UNICODE_STRING pLsaString,
  84. IN PCWSTR pString
  85. );
  86. #endif
  87. /*
  88. * Miscellaneous Utilities
  89. */
  90. #ifndef __TERMSRV_INC_TSUTIL_H__
  91. #define GetCurrentConsoleId() (USER_SHARED_DATA->ActiveConsoleId)
  92. #define GetCurrentLogonId() (NtCurrentPeb()->LogonId)
  93. #endif
  94. #ifdef __cplusplus
  95. }
  96. #endif
  97. #endif // __TERMSRV_INC_TSUTILNT_H__