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.

187 lines
5.4 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation 2001
  3. File: msvwow.h
  4. Contents: prototypes for 32-64 bit interop for the MSV1_0 package
  5. History: 07-Jan-2001 SField
  6. --*/
  7. #ifndef __MSVWOW_H__
  8. #define __MSVWOW_H__
  9. #ifdef _WIN64
  10. #ifdef __cplusplus
  11. extern "C"
  12. {
  13. #endif // __cplusplus
  14. //
  15. // WOW versions of native structures
  16. // MUST keep these in sync with ntmsv1_0.h
  17. //
  18. typedef UNICODE_STRING32 UNICODE_STRING_WOW64;
  19. typedef UNICODE_STRING_WOW64 *PUNICODE_STRING_WOW64;
  20. typedef STRING32 STRING_WOW64;
  21. typedef STRING_WOW64 *PSTRING_WOW64;
  22. typedef struct _MSV1_0_INTERACTIVE_LOGON_WOW64 {
  23. MSV1_0_LOGON_SUBMIT_TYPE MessageType;
  24. UNICODE_STRING_WOW64 LogonDomainName;
  25. UNICODE_STRING_WOW64 UserName;
  26. UNICODE_STRING_WOW64 Password;
  27. } MSV1_0_INTERACTIVE_LOGON_WOW64, *PMSV1_0_INTERACTIVE_LOGON_WOW64;
  28. typedef struct _MSV1_0_INTERACTIVE_PROFILE_WOW64 {
  29. MSV1_0_PROFILE_BUFFER_TYPE MessageType;
  30. USHORT LogonCount;
  31. USHORT BadPasswordCount;
  32. LARGE_INTEGER LogonTime;
  33. LARGE_INTEGER LogoffTime;
  34. LARGE_INTEGER KickOffTime;
  35. LARGE_INTEGER PasswordLastSet;
  36. LARGE_INTEGER PasswordCanChange;
  37. LARGE_INTEGER PasswordMustChange;
  38. UNICODE_STRING_WOW64 LogonScript;
  39. UNICODE_STRING_WOW64 HomeDirectory;
  40. UNICODE_STRING_WOW64 FullName;
  41. UNICODE_STRING_WOW64 ProfilePath;
  42. UNICODE_STRING_WOW64 HomeDirectoryDrive;
  43. UNICODE_STRING_WOW64 LogonServer;
  44. ULONG UserFlags;
  45. } MSV1_0_INTERACTIVE_PROFILE_WOW64, *PMSV1_0_INTERACTIVE_PROFILE_WOW64;
  46. typedef struct _MSV1_0_LM20_LOGON_WOW64 {
  47. MSV1_0_LOGON_SUBMIT_TYPE MessageType;
  48. UNICODE_STRING_WOW64 LogonDomainName;
  49. UNICODE_STRING_WOW64 UserName;
  50. UNICODE_STRING_WOW64 Workstation;
  51. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  52. STRING_WOW64 CaseSensitiveChallengeResponse;
  53. STRING_WOW64 CaseInsensitiveChallengeResponse;
  54. ULONG ParameterControl;
  55. } MSV1_0_LM20_LOGON_WOW64, * PMSV1_0_LM20_LOGON_WOW64;
  56. typedef struct _MSV1_0_LM20_LOGON_PROFILE_WOW64 {
  57. MSV1_0_PROFILE_BUFFER_TYPE MessageType;
  58. LARGE_INTEGER KickOffTime;
  59. LARGE_INTEGER LogoffTime;
  60. ULONG UserFlags;
  61. UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH];
  62. UNICODE_STRING_WOW64 LogonDomainName;
  63. UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH];
  64. UNICODE_STRING_WOW64 LogonServer;
  65. UNICODE_STRING_WOW64 UserParameters;
  66. } MSV1_0_LM20_LOGON_PROFILE_WOW64, * PMSV1_0_LM20_LOGON_PROFILE_WOW64;
  67. typedef struct _MSV1_0_ENUMUSERS_RESPONSE_WOW64 {
  68. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  69. ULONG NumberOfLoggedOnUsers;
  70. PLUID LogonIds;
  71. PULONG EnumHandles;
  72. } MSV1_0_ENUMUSERS_RESPONSE_WOW64, *PMSV1_0_ENUMUSERS_RESPONSE_WOW64;
  73. typedef struct _MSV1_0_GETUSERINFO_RESPONSE_WOW64 {
  74. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  75. PSID UserSid;
  76. UNICODE_STRING_WOW64 UserName;
  77. UNICODE_STRING_WOW64 LogonDomainName;
  78. UNICODE_STRING_WOW64 LogonServer;
  79. SECURITY_LOGON_TYPE LogonType;
  80. } MSV1_0_GETUSERINFO_RESPONSE_WOW64, *PMSV1_0_GETUSERINFO_RESPONSE_WOW64;
  81. typedef struct _MSV1_0_CHANGEPASSWORD_REQUEST_WOW64 {
  82. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  83. UNICODE_STRING_WOW64 DomainName;
  84. UNICODE_STRING_WOW64 AccountName;
  85. UNICODE_STRING_WOW64 OldPassword;
  86. UNICODE_STRING_WOW64 NewPassword;
  87. BOOLEAN Impersonating;
  88. } MSV1_0_CHANGEPASSWORD_REQUEST_WOW64, *PMSV1_0_CHANGEPASSWORD_REQUEST_WOW64;
  89. typedef struct _MSV1_0_CHANGEPASSWORD_RESPONSE_WOW64 {
  90. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  91. BOOLEAN PasswordInfoValid;
  92. DOMAIN_PASSWORD_INFORMATION DomainPasswordInfo;
  93. } MSV1_0_CHANGEPASSWORD_RESPONSE_WOW64, *PMSV1_0_CHANGEPASSWORD_RESPONSE_WOW64;
  94. //
  95. // If this assertion fails, we're overrunning the client's OUT buffer on
  96. // password change requests
  97. //
  98. C_ASSERT(sizeof(MSV1_0_CHANGEPASSWORD_RESPONSE) == sizeof(MSV1_0_CHANGEPASSWORD_RESPONSE_WOW64));
  99. //
  100. // routines for working on primary structures
  101. //
  102. NTSTATUS
  103. MsvConvertWOWInteractiveLogonBuffer(
  104. IN PVOID ProtocolSubmitBuffer,
  105. IN PVOID ClientBufferBase,
  106. IN OUT PULONG pSubmitBufferSize,
  107. OUT PVOID *ppTempSubmitBuffer
  108. );
  109. NTSTATUS
  110. MsvConvertWOWNetworkLogonBuffer(
  111. IN PVOID ProtocolSubmitBuffer,
  112. IN PVOID ClientBufferBase,
  113. IN OUT PULONG pSubmitBufferSize,
  114. OUT PVOID *ppTempSubmitBuffer
  115. );
  116. NTSTATUS
  117. MsvConvertWOWChangePasswordBuffer(
  118. IN PVOID ProtocolSubmitBuffer,
  119. IN PVOID ClientBufferBase,
  120. IN OUT PULONG pSubmitBufferSize,
  121. OUT PVOID *ppTempSubmitBuffer
  122. );
  123. NTSTATUS
  124. MsvAllocateInteractiveWOWProfile (
  125. IN PLSA_CLIENT_REQUEST ClientRequest,
  126. OUT PMSV1_0_INTERACTIVE_PROFILE *ProfileBuffer,
  127. OUT PULONG ProfileBufferSize,
  128. IN PNETLOGON_VALIDATION_SAM_INFO4 NlpUser
  129. );
  130. NTSTATUS
  131. MsvAllocateNetworkWOWProfile (
  132. IN PLSA_CLIENT_REQUEST ClientRequest,
  133. OUT PMSV1_0_LM20_LOGON_PROFILE *ProfileBuffer,
  134. OUT PULONG ProfileBufferSize,
  135. IN PNETLOGON_VALIDATION_SAM_INFO4 NlpUser,
  136. IN ULONG ParameterControl
  137. );
  138. //
  139. // generic helper routines
  140. //
  141. VOID
  142. MsvPutWOWClientString(
  143. IN OUT PCLIENT_BUFFER_DESC ClientBufferDesc,
  144. IN PUNICODE_STRING_WOW64 OutString,
  145. IN PUNICODE_STRING InString
  146. );
  147. #ifdef __cplusplus
  148. }
  149. #endif // __cplusplus
  150. #endif // _WIN64
  151. #endif // __MSVWOW_H__