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.

221 lines
4.0 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. All rights reserved
  4. Module Name:
  5. lsasspi.hxx
  6. Abstract:
  7. lsa sspi
  8. Author:
  9. Larry Zhu (LZhu) December 1, 2001 Created
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. --*/
  14. #ifndef LSASSPI_HXX
  15. #define LSASSPI_HXX
  16. /*
  17. include ntsecapi.h before this header file
  18. #include <ntsecapi.h>
  19. */
  20. PCSTR
  21. LogonType2Str(
  22. IN ULONG LogonType
  23. );
  24. PCSTR
  25. ImpLevel2Str(
  26. IN ULONG Level
  27. );
  28. NTSTATUS
  29. GetLsaHandleAndPackageId(
  30. IN PCSTR pszPackageNameA,
  31. OUT HANDLE* pLsaHandle,
  32. OUT ULONG* pPackageId
  33. );
  34. NTSTATUS
  35. GetLsaHandleAndPackageIdEx(
  36. IN PCSTR pszPackageNameA,
  37. OUT HANDLE* pLsaHandle,
  38. OUT ULONG* pPackageId,
  39. OUT BOOLEAN* pbWasTcbPrivEnabled,
  40. OUT BOOLEAN* pbIsImpersonating
  41. );
  42. NTSTATUS
  43. GetSystemToken(
  44. OUT HANDLE* phSystemToken
  45. );
  46. NTSTATUS
  47. FindAndOpenWinlogon(
  48. OUT HANDLE* phWinlogon
  49. );
  50. HRESULT
  51. CreateProcessAsUserEx(
  52. IN HANDLE hToken,
  53. IN UNICODE_STRING* pApplication
  54. );
  55. NTSTATUS
  56. Impersonate(
  57. IN OPTIONAL HANDLE hToken
  58. );
  59. HRESULT
  60. GetProcessToken(
  61. IN HANDLE hProcess,
  62. OUT HANDLE* phProcessToken
  63. );
  64. HRESULT
  65. GetProcessTokenByProcessId(
  66. IN ULONG ProcessID,
  67. OUT HANDLE* phToken
  68. );
  69. HRESULT
  70. GetProcessTokenWithNullDACL(
  71. IN HANDLE hProcess,
  72. OUT HANDLE* phProcessToken
  73. );
  74. NTSTATUS
  75. GetProcessHandleByCid(
  76. IN ULONG ProcessID,
  77. OUT HANDLE* phToken
  78. );
  79. NTSTATUS
  80. CheckUserToken(
  81. IN HANDLE hToken
  82. );
  83. VOID
  84. DebugPrintSidFriendlyName(
  85. IN ULONG Level,
  86. IN PCSTR pszBanner,
  87. IN PSID pSid
  88. );
  89. typedef struct _SECURITY_LOGON_SESSION_DATA_OLD {
  90. ULONG Size;
  91. LUID LogonId;
  92. LSA_UNICODE_STRING UserName;
  93. LSA_UNICODE_STRING LogonDomain;
  94. LSA_UNICODE_STRING AuthenticationPackage;
  95. ULONG LogonType;
  96. ULONG Session;
  97. PSID Sid;
  98. LARGE_INTEGER LogonTime;
  99. } SECURITY_LOGON_SESSION_DATA_OLD, * PSECURITY_LOGON_SESSION_DATA_OLD;
  100. VOID
  101. DebugPrintLogonSessionData(
  102. IN ULONG Level,
  103. IN SECURITY_LOGON_SESSION_DATA* pLogonSessionData
  104. );
  105. HRESULT
  106. CheckUserData(
  107. VOID
  108. );
  109. typedef
  110. NTSTATUS
  111. (* PFuncLsaGetLogonSessionData)(
  112. IN PLUID LogonId,
  113. OUT PSECURITY_LOGON_SESSION_DATA * ppLogonSessionData
  114. );
  115. typedef
  116. NTSTATUS
  117. (* PFuncLsaRegisterLogonProcess)(
  118. IN PLSA_STRING LogonProcessName,
  119. OUT PHANDLE LsaHandle,
  120. OUT PLSA_OPERATIONAL_MODE SecurityMode
  121. );
  122. typedef
  123. NTSTATUS
  124. (* PFuncLsaLookupAuthenticationPackage)(
  125. IN HANDLE LsaHandle,
  126. IN PLSA_STRING PackageName,
  127. OUT PULONG AuthenticationPackage
  128. );
  129. typedef
  130. NTSTATUS
  131. (* PFuncLsaLogonUser)(
  132. IN HANDLE LsaHandle,
  133. IN PLSA_STRING OriginName,
  134. IN SECURITY_LOGON_TYPE LogonType,
  135. IN ULONG AuthenticationPackage,
  136. IN PVOID AuthenticationInformation,
  137. IN ULONG AuthenticationInformationLength,
  138. IN PTOKEN_GROUPS LocalGroups OPTIONAL,
  139. IN PTOKEN_SOURCE SourceContext,
  140. OUT PVOID *ProfileBuffer,
  141. OUT PULONG ProfileBufferLength,
  142. OUT PLUID LogonId,
  143. OUT PHANDLE Token,
  144. OUT PQUOTA_LIMITS Quotas,
  145. OUT PNTSTATUS SubStatus
  146. );
  147. typedef
  148. NTSTATUS
  149. (* PFuncLsaFreeReturnBuffer)(
  150. IN PVOID Buffer
  151. );
  152. typedef
  153. NTSTATUS
  154. (* PFuncLsaConnectUntrusted)(
  155. OUT PHANDLE LsaHandle
  156. );
  157. typedef
  158. NTSTATUS
  159. (* PFuncLsaDeregisterLogonProcess)(
  160. IN HANDLE LsaHandle
  161. );
  162. typedef
  163. NTSTATUS
  164. (* PFuncLsaCallAuthenticationPackage)(
  165. IN HANDLE LsaHandle,
  166. IN ULONG AuthenticationPackage,
  167. IN PVOID ProtocolSubmitBuffer,
  168. IN ULONG SubmitBufferLength,
  169. OUT PVOID* ProtocolReturnBuffer,
  170. OUT PULONG ReturnBufferLength,
  171. OUT PNTSTATUS ProtocolStatus
  172. );
  173. FARPROC
  174. WINAPI
  175. DelayLoadFailureHook(
  176. LPCSTR pszDllName,
  177. LPCSTR pszProcName
  178. );
  179. #endif // #ifndef LSASSPI_HXX