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.

156 lines
2.7 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: security.h
  3. *
  4. * Copyright (c) 1991, Microsoft Corporation
  5. *
  6. * Define various winlogon security-related routines
  7. *
  8. * History:
  9. * 12-09-91 Davidc Created.
  10. \***************************************************************************/
  11. extern PSID gLocalSid; // Initialized in 'InitializeSecurityGlobals'
  12. extern PSID gAdminSid; // Initialized in 'InitializeSecurityGlobals'
  13. extern PSID pWinlogonSid; // Initialized in 'InitializeSecurityGlobals'
  14. PVOID
  15. FormatPasswordCredentials(
  16. IN PUNICODE_STRING UserName,
  17. IN PUNICODE_STRING Domain,
  18. IN PUNICODE_STRING Password,
  19. IN BOOLEAN Unlock,
  20. IN OPTIONAL PLUID LogonId,
  21. OUT PULONG Size
  22. );
  23. PVOID
  24. FormatSmartCardCredentials(
  25. IN PUNICODE_STRING Pin,
  26. IN PVOID SmartCardInfo,
  27. IN BOOLEAN Unlock,
  28. IN OPTIONAL PLUID LogonId,
  29. OUT PULONG Size
  30. );
  31. NTSTATUS
  32. WinLogonUser(
  33. IN HANDLE LsaHandle,
  34. IN ULONG AuthenticationPackage,
  35. IN SECURITY_LOGON_TYPE LogonType,
  36. IN PVOID AuthInfo,
  37. IN ULONG AuthInfoSize,
  38. IN PSID LogonSid,
  39. OUT PLUID LogonId,
  40. OUT PHANDLE LogonToken,
  41. OUT PQUOTA_LIMITS Quotas,
  42. OUT PVOID *ProfileBuffer,
  43. OUT PULONG ProfileBufferLength,
  44. OUT PNTSTATUS SubStatus,
  45. OUT POPTIMIZED_LOGON_STATUS OptimizedLogonStatus
  46. );
  47. BOOL
  48. UnlockLogon(
  49. PGLOBALS pGlobals,
  50. IN BOOL SmartCardUnlock,
  51. IN PWCHAR UserName,
  52. IN PWCHAR Domain,
  53. IN PUNICODE_STRING PasswordString,
  54. OUT PNTSTATUS Status,
  55. OUT PBOOL IsAdmin,
  56. OUT PBOOL IsLoggedOnUser,
  57. OUT PVOID *pProfileBuffer,
  58. OUT ULONG *pProfileBufferLength
  59. );
  60. BOOL
  61. EnablePrivilege(
  62. ULONG Privilege,
  63. BOOL Enable
  64. );
  65. BOOL
  66. TestTokenForAdmin(
  67. HANDLE Token
  68. );
  69. BOOL
  70. TestUserForAdmin(
  71. PGLOBALS pGlobals,
  72. IN PWCHAR UserName,
  73. IN PWCHAR Domain,
  74. IN PUNICODE_STRING PasswordString
  75. );
  76. BOOL
  77. TestUserPrivilege(
  78. HANDLE UserToken,
  79. ULONG Privilege
  80. );
  81. VOID
  82. HidePassword(
  83. PUCHAR Seed OPTIONAL,
  84. PUNICODE_STRING Password
  85. );
  86. VOID
  87. RevealPassword(
  88. PUNICODE_STRING HiddenPassword
  89. );
  90. VOID
  91. ErasePassword(
  92. PUNICODE_STRING Password
  93. );
  94. BOOL
  95. InitializeAuthentication(
  96. IN PGLOBALS pGlobals
  97. );
  98. HANDLE
  99. ImpersonateUser(
  100. PUSER_PROCESS_DATA UserProcessData,
  101. HANDLE ThreadHandle
  102. );
  103. BOOL
  104. StopImpersonating(
  105. HANDLE ThreadHandle
  106. );
  107. PSECURITY_DESCRIPTOR
  108. CreateUserThreadTokenSD(
  109. PSID UserSid,
  110. PSID WinlogonSid
  111. );
  112. VOID
  113. FreeSecurityDescriptor(
  114. PSECURITY_DESCRIPTOR SecurityDescriptor
  115. );
  116. VOID
  117. InitializeSecurityGlobals(
  118. VOID
  119. );
  120. VOID
  121. FreeSecurityGlobals(
  122. VOID
  123. );
  124. VOID
  125. HashPassword(
  126. PUNICODE_STRING Password,
  127. PUCHAR HashBuffer
  128. );