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.

204 lines
5.8 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. #define LSAP_ADDRESS_LENGTH 32
  96. //
  97. // Each API results in a data structure containing the parameters
  98. // of that API being transmitted to the LSA server. This data structure
  99. // (LSAP_API_MESSAGE) has a common header and a body which is dependent
  100. // upon the type of call being made. The following data structures are
  101. // the call-specific body formats.
  102. //
  103. typedef struct _LSAP_LOOKUP_PACKAGE_ARGS {
  104. ULONG AuthenticationPackage; // OUT parameter
  105. ULONG PackageNameLength;
  106. CHAR PackageName[LSAP_MAX_PACKAGE_NAME_LENGTH+1];
  107. } LSAP_LOOKUP_PACKAGE_ARGS, *PLSAP_LOOKUP_PACKAGE_ARGS;
  108. typedef struct _LSAP_LOGON_USER_ARGS {
  109. STRING_AU OriginName;
  110. SECURITY_LOGON_TYPE LogonType;
  111. ULONG AuthenticationPackage;
  112. PVOID_AU AuthenticationInformation;
  113. ULONG AuthenticationInformationLength;
  114. ULONG LocalGroupsCount;
  115. PVOID_AU LocalGroups;
  116. TOKEN_SOURCE SourceContext;
  117. NTSTATUS SubStatus; // OUT parameter
  118. PVOID_AU ProfileBuffer; // OUT parameter
  119. ULONG ProfileBufferLength; // OUT parameter
  120. ULONG DummySpacer; // Spacer to force LUID to 8 byte alignment
  121. LUID LogonId; // OUT parameter
  122. HANDLE_AU Token; // OUT parameter
  123. QUOTA_LIMITS Quotas; // OUT parameter
  124. CHAR IpAddress[LSAP_ADDRESS_LENGTH]; // At the end to avoid compat problems with clients
  125. // built with older versions of lsadll.lib
  126. } LSAP_LOGON_USER_ARGS, *PLSAP_LOGON_USER_ARGS;
  127. typedef struct _LSAP_CALL_PACKAGE_ARGS {
  128. ULONG AuthenticationPackage;
  129. PVOID_AU ProtocolSubmitBuffer;
  130. ULONG SubmitBufferLength;
  131. NTSTATUS ProtocolStatus; // OUT parameter
  132. PVOID_AU ProtocolReturnBuffer; // OUT parameter
  133. ULONG ReturnBufferLength; // OUT parameter
  134. } LSAP_CALL_PACKAGE_ARGS, *PLSAP_CALL_PACKAGE_ARGS;
  135. #define LSAP_AU_DATA_LENGTH(Size) ((Size) + 8)
  136. //
  137. // This is the message that gets sent for every LSA LPC call.
  138. //
  139. typedef struct _LSAP_AU_API_MESSAGE {
  140. PORT_MESSAGE PortMessage;
  141. union {
  142. LSAP_AU_REGISTER_CONNECT_INFO ConnectionRequest;
  143. struct {
  144. LSAP_AU_API_NUMBER ApiNumber;
  145. NTSTATUS ReturnedStatus;
  146. union {
  147. LSAP_LOOKUP_PACKAGE_ARGS LookupPackage;
  148. LSAP_LOGON_USER_ARGS LogonUser;
  149. LSAP_CALL_PACKAGE_ARGS CallPackage;
  150. } Arguments;
  151. };
  152. };
  153. } LSAP_AU_API_MESSAGE, *PLSAP_AU_API_MESSAGE;
  154. #endif // _AUP_