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.

140 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1996, 1997 Microsoft Corporation
  3. Module Name:
  4. secmisc.h
  5. Abstract:
  6. This module contains miscellaneous security routines for the Protected
  7. Storage.
  8. Author:
  9. Scott Field (sfield) 25-Mar-97
  10. --*/
  11. #ifndef __SECMISC_H__
  12. #define __SECMISC_H__
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. //
  17. // Textual Sids of interesting accounts on WinNT
  18. //
  19. #define TEXTUAL_SID_LOCAL_SYSTEM L"S-1-5-18"
  20. #define TEXTUAL_SID_LOCAL_SERVICE L"S-1-5-19"
  21. #define TEXTUAL_SID_NETWORK_SERVICE L"S-1-5-20"
  22. BOOL
  23. GetUserHKEYEx(
  24. IN LPCWSTR szUser,
  25. IN DWORD dwDesiredAccess,
  26. IN OUT HKEY *hKeyUser,
  27. IN BOOL fCheckDefault // check .Default registry hive ?
  28. );
  29. BOOL
  30. GetUserHKEY(
  31. IN LPCWSTR szUser,
  32. IN DWORD dwDesiredAccess,
  33. IN OUT HKEY *hKeyUser
  34. );
  35. BOOL
  36. GetUserTextualSid(
  37. IN HANDLE hUserToken, // optional
  38. IN OUT LPWSTR lpBuffer,
  39. IN OUT LPDWORD nSize
  40. );
  41. BOOL
  42. GetTextualSid(
  43. IN PSID pSid, // binary Sid
  44. IN OUT LPWSTR TextualSid, // buffer for Textual representaion of Sid
  45. IN OUT LPDWORD dwBufferLen // required/provided TextualSid buffersize
  46. );
  47. BOOL
  48. GetThreadAuthenticationId(
  49. IN HANDLE hThread,
  50. IN OUT PLUID AuthenticationId
  51. );
  52. BOOL
  53. GetTokenAuthenticationId(
  54. IN HANDLE hToken,
  55. IN OUT PLUID AuthenticationId
  56. );
  57. BOOL
  58. GetTokenUserSid(
  59. IN HANDLE hToken, // token to query
  60. IN OUT PSID *ppUserSid // resultant user sid
  61. );
  62. BOOL
  63. SetRegistrySecurity(
  64. IN HKEY hKey
  65. );
  66. BOOL
  67. SetPrivilege(
  68. HANDLE hToken, // token handle
  69. LPCWSTR Privilege, // Privilege to enable/disable
  70. BOOL bEnablePrivilege // to enable or disable privilege
  71. );
  72. BOOL
  73. SetCurrentPrivilege(
  74. LPCWSTR Privilege, // Privilege to enable/disable
  75. BOOL bEnablePrivilege // to enable or disable privilege
  76. );
  77. BOOL
  78. IsAdministrator(
  79. VOID
  80. );
  81. BOOL
  82. IsLocal(
  83. VOID
  84. );
  85. BOOL
  86. IsDelegating(
  87. IN HANDLE hToken // token to query, open for at least TOKEN_QUERY access
  88. );
  89. BOOL
  90. IsUserSidInDomain(
  91. IN PSID pSidDomain, // domain Sid
  92. IN PSID pSidUser // user Sid
  93. );
  94. BOOL
  95. IsDomainController(
  96. VOID
  97. );
  98. LONG
  99. SecureRegDeleteValueU(
  100. IN HKEY hKey, // handle of key
  101. IN LPCWSTR lpValueName // address of value name
  102. );
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif // __SECMISC_H__