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.

202 lines
5.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. aup.h
  5. Abstract:
  6. Local Security Authority definitions that are related to AUTHENTICATION
  7. services and are shared between the LSA server and LSA client stubs
  8. Author:
  9. Jim Kelly (JimK) 20-Feb-1991
  10. Revision History:
  11. --*/
  12. #ifndef _AUP_
  13. #define _AUP_
  14. #define LSAP_MAX_LOGON_PROC_NAME_LENGTH 127
  15. #define LSAP_MAX_PACKAGE_NAME_LENGTH 127
  16. //
  17. // Used for connecting to the LSA authentiction port.
  18. //
  19. #define LSAP_AU_KERNEL_CLIENT 0x1
  20. typedef struct _LSAP_AU_REGISTER_CONNECT_INFO {
  21. NTSTATUS CompletionStatus;
  22. ULONG SecurityMode;
  23. ULONG LogonProcessNameLength;
  24. CHAR LogonProcessName[LSAP_MAX_PACKAGE_NAME_LENGTH+1];
  25. } LSAP_AU_REGISTER_CONNECT_INFO, *PLSAP_AU_REGISTER_CONNECT_INFO;
  26. typedef struct _LSAP_AU_REGISTER_CONNECT_INFO_EX {
  27. NTSTATUS CompletionStatus;
  28. ULONG Security;
  29. ULONG LogonProcessNameLength;
  30. CHAR LogonProcessName[LSAP_MAX_PACKAGE_NAME_LENGTH+1];
  31. ULONG ClientMode;
  32. } LSAP_AU_REGISTER_CONNECT_INFO_EX, *PLSAP_AU_REGISTER_CONNECT_INFO_EX;
  33. typedef struct _LSAP_AU_REGISTER_CONNECT_RESP {
  34. NTSTATUS CompletionStatus;
  35. LSA_OPERATIONAL_MODE SecurityMode;
  36. ULONG PackageCount;
  37. UCHAR Reserved[ LSAP_MAX_PACKAGE_NAME_LENGTH + 1 ];
  38. } LSAP_AU_REGISTER_CONNECT_RESP, * PLSAP_AU_REGISTER_CONNECT_RESP;
  39. //
  40. // Conditional type definition for Wow64 environment. The LPC messages
  41. // are kept "native" size, so pointers are full size. The WOW environment
  42. // will do the thunking. LPC messages are defined with types that are
  43. // always the correct size using these "aliases".
  44. //
  45. #ifdef BUILD_WOW64
  46. #if 0
  47. typedef WCHAR __ptr64 * PWSTR_AU ;
  48. typedef VOID __ptr64 * PVOID_AU ;
  49. #else
  50. typedef ULONGLONG PWSTR_AU ;
  51. typedef ULONGLONG PVOID_AU ;
  52. #endif
  53. typedef struct _STRING_AU {
  54. USHORT Length ;
  55. USHORT MaximumLength ;
  56. PVOID_AU Buffer ;
  57. } STRING_AU, * PSTRING_AU ;
  58. typedef PVOID_AU HANDLE_AU ;
  59. #define SecpStringToLpc( L, S ) \
  60. (L)->Length = (S)->Length ; \
  61. (L)->MaximumLength = (S)->MaximumLength ; \
  62. (L)->Buffer = (PVOID_AU) (S)->Buffer ;
  63. #define SecpLpcStringToString( S, L ) \
  64. (S)->Length = (L)->Length ; \
  65. (S)->MaximumLength = (L)->MaximumLength ; \
  66. (S)->Buffer = (PCHAR) (L)->Buffer ;
  67. #else
  68. typedef PVOID PVOID_AU ;
  69. typedef PWSTR PWSTR_AU ;
  70. typedef STRING STRING_AU, *PSTRING_AU ;
  71. typedef HANDLE HANDLE_AU ;
  72. #define SecpStringToLpc( L, S ) \
  73. *(L) = *(S) ;
  74. #define SecpLpcStringToString( S, L ) \
  75. *(S) = *(L) ;
  76. #endif
  77. //
  78. // Message formats used by clients of the local security authority.
  79. // Note that:
  80. //
  81. // LsaFreeReturnBuffer() does not result in a call to the server.
  82. //
  83. // LsaRegisterLogonProcess() is handled completely by the
  84. // LPC port connection, and requires no API number.
  85. //
  86. // DeRegister Logon Process doesn't have a call-specific structure.
  87. //
  88. typedef enum _LSAP_AU_API_NUMBER {
  89. LsapAuLookupPackageApi,
  90. LsapAuLogonUserApi,
  91. LsapAuCallPackageApi,
  92. LsapAuDeregisterLogonProcessApi,
  93. LsapAuMaxApiNumber
  94. } LSAP_AU_API_NUMBER, *PLSAP_AU_API_NUMBER;
  95. //
  96. // Each API results in a data structure containing the parameters
  97. // of that API being transmitted to the LSA server. This data structure
  98. // (LSAP_API_MESSAGE) has a common header and a body which is dependent
  99. // upon the type of call being made. The following data structures are
  100. // the call-specific body formats.
  101. //
  102. typedef struct _LSAP_LOOKUP_PACKAGE_ARGS {
  103. ULONG AuthenticationPackage; // OUT parameter
  104. ULONG PackageNameLength;
  105. CHAR PackageName[LSAP_MAX_PACKAGE_NAME_LENGTH+1];
  106. } LSAP_LOOKUP_PACKAGE_ARGS, *PLSAP_LOOKUP_PACKAGE_ARGS;
  107. typedef struct _LSAP_LOGON_USER_ARGS {
  108. STRING_AU OriginName;
  109. SECURITY_LOGON_TYPE LogonType;
  110. ULONG AuthenticationPackage;
  111. PVOID_AU AuthenticationInformation;
  112. ULONG AuthenticationInformationLength;
  113. ULONG LocalGroupsCount;
  114. PVOID_AU LocalGroups;
  115. TOKEN_SOURCE SourceContext;
  116. NTSTATUS SubStatus; // OUT parameter
  117. PVOID_AU ProfileBuffer; // OUT parameter
  118. ULONG ProfileBufferLength; // OUT parameter
  119. ULONG DummySpacer; // Spacer to force LUID to 8 byte alignment
  120. LUID LogonId; // OUT parameter
  121. HANDLE_AU Token; // OUT parameter
  122. QUOTA_LIMITS Quotas; // OUT parameter
  123. } LSAP_LOGON_USER_ARGS, *PLSAP_LOGON_USER_ARGS;
  124. typedef struct _LSAP_CALL_PACKAGE_ARGS {
  125. ULONG AuthenticationPackage;
  126. PVOID_AU ProtocolSubmitBuffer;
  127. ULONG SubmitBufferLength;
  128. NTSTATUS ProtocolStatus; // OUT parameter
  129. PVOID_AU ProtocolReturnBuffer; // OUT parameter
  130. ULONG ReturnBufferLength; // OUT parameter
  131. } LSAP_CALL_PACKAGE_ARGS, *PLSAP_CALL_PACKAGE_ARGS;
  132. //
  133. // This is the message that gets sent for every LSA LPC call.
  134. //
  135. typedef struct _LSAP_AU_API_MESSAGE {
  136. PORT_MESSAGE PortMessage;
  137. union {
  138. LSAP_AU_REGISTER_CONNECT_INFO ConnectionRequest;
  139. struct {
  140. LSAP_AU_API_NUMBER ApiNumber;
  141. NTSTATUS ReturnedStatus;
  142. union {
  143. LSAP_LOOKUP_PACKAGE_ARGS LookupPackage;
  144. LSAP_LOGON_USER_ARGS LogonUser;
  145. LSAP_CALL_PACKAGE_ARGS CallPackage;
  146. } Arguments;
  147. };
  148. };
  149. } LSAP_AU_API_MESSAGE, *PLSAP_AU_API_MESSAGE;
  150. #endif // _AUP_