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.

278 lines
7.8 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. remboot.h
  5. Abstract:
  6. This file contains definitions related to remote install.
  7. Author:
  8. Adam Barr (adamba) 30-Dec-1997
  9. Revision History:
  10. --*/
  11. #ifndef _REMBOOT_H_
  12. #define _REMBOOT_H_
  13. #if defined(REMOTE_BOOT)
  14. //
  15. // Location of CSC and RBR directories.
  16. //
  17. #define REMOTE_BOOT_IMIRROR_PATH_W L"\\IntelliMirror Cache"
  18. #define REMOTE_BOOT_IMIRROR_PATH_A "\\IntelliMirror Cache"
  19. #define REMOTE_BOOT_CSC_SUBDIR_W L"\\CSC" // relative to IMIRROR_PATH
  20. #define REMOTE_BOOT_CSC_SUBDIR_A "\\CSC" // relative to IMIRROR_PATH
  21. #define REMOTE_BOOT_RBR_SUBDIR_W L"\\RBR" // relative to IMIRROR_PATH
  22. #define REMOTE_BOOT_RBR_SUBDIR_A "\\RBR" // relative to IMIRROR_PATH
  23. #endif // defined(REMOTE_BOOT)
  24. //
  25. // Directory under \RemoteInstall\Setup\<language> where we put
  26. // installation images.
  27. //
  28. #define REMOTE_INSTALL_SHARE_NAME_W L"REMINST"
  29. #define REMOTE_INSTALL_SHARE_NAME_A "REMINST"
  30. #define REMOTE_INSTALL_SETUP_DIR_W L"Setup"
  31. #define REMOTE_INSTALL_SETUP_DIR_A "Setup"
  32. #define REMOTE_INSTALL_IMAGE_DIR_W L"Images"
  33. #define REMOTE_INSTALL_IMAGE_DIR_A "Images"
  34. #define REMOTE_INSTALL_TOOLS_DIR_W L"Tools"
  35. #define REMOTE_INSTALL_TOOLS_DIR_A "Tools"
  36. #define REMOTE_INSTALL_TEMPLATES_DIR_W L"Templates"
  37. #define REMOTE_INSTALL_TEMPLATES_DIR_A "Templates"
  38. //
  39. // Size of the various components in a secret.
  40. //
  41. #define LM_OWF_PASSWORD_SIZE 16
  42. #define NT_OWF_PASSWORD_SIZE 16
  43. #define RI_SECRET_DOMAIN_SIZE 32
  44. #define RI_SECRET_USER_SIZE 32
  45. #define RI_SECRET_SID_SIZE 28
  46. #if defined(REMOTE_BOOT)
  47. #define RI_SECRET_RESERVED_SIZE (64 + sizeof(ULONG))
  48. #endif // defined(REMOTE_BOOT)
  49. //
  50. // The string that is stored in the signature.
  51. //
  52. #define RI_SECRET_SIGNATURE "NTRI"
  53. //
  54. // Structure that holds a secret.
  55. //
  56. typedef struct _RI_SECRET {
  57. UCHAR Signature[4];
  58. ULONG Version;
  59. UCHAR Domain[RI_SECRET_DOMAIN_SIZE];
  60. UCHAR User[RI_SECRET_USER_SIZE];
  61. UCHAR LmEncryptedPassword1[LM_OWF_PASSWORD_SIZE];
  62. UCHAR NtEncryptedPassword1[NT_OWF_PASSWORD_SIZE];
  63. #if defined(REMOTE_BOOT)
  64. UCHAR LmEncryptedPassword2[LM_OWF_PASSWORD_SIZE];
  65. UCHAR NtEncryptedPassword2[NT_OWF_PASSWORD_SIZE];
  66. #endif // defined(REMOTE_BOOT)
  67. UCHAR Sid[RI_SECRET_SID_SIZE];
  68. #if defined(REMOTE_BOOT)
  69. UCHAR Reserved[RI_SECRET_RESERVED_SIZE];
  70. #endif // defined(REMOTE_BOOT)
  71. } RI_SECRET, *PRI_SECRET;
  72. //
  73. // FSCTLs the redir supports for accessing the secret.
  74. //
  75. #define IOCTL_RDR_BASE FILE_DEVICE_NETWORK_FILE_SYSTEM
  76. #define _RDR_CONTROL_CODE(request, method, access) \
  77. CTL_CODE(IOCTL_RDR_BASE, request, method, access)
  78. #define FSCTL_LMMR_RI_INITIALIZE_SECRET _RDR_CONTROL_CODE(250, METHOD_BUFFERED, FILE_ANY_ACCESS)
  79. #if defined(REMOTE_BOOT)
  80. #define FSCTL_LMMR_RI_CHECK_FOR_NEW_PASSWORD _RDR_CONTROL_CODE(251, METHOD_BUFFERED, FILE_ANY_ACCESS)
  81. #define FSCTL_LMMR_RI_IS_PASSWORD_SETTABLE _RDR_CONTROL_CODE(252, METHOD_BUFFERED, FILE_ANY_ACCESS)
  82. #define FSCTL_LMMR_RI_SET_NEW_PASSWORD _RDR_CONTROL_CODE(253, METHOD_BUFFERED, FILE_ANY_ACCESS)
  83. #endif // defined(REMOTE_BOOT)
  84. //used in the remoteboot command console case
  85. #define IOCTL_LMMR_USEKERNELSEC _RDR_CONTROL_CODE(254, METHOD_BUFFERED, FILE_ANY_ACCESS)
  86. //
  87. // Structure used by these IOCTLs.
  88. //
  89. typedef struct _LMMR_RI_INITIALIZE_SECRET {
  90. RI_SECRET Secret;
  91. #if defined(REMOTE_BOOT)
  92. BOOLEAN UsePassword2;
  93. #endif // defined(REMOTE_BOOT)
  94. } LMMR_RI_INITIALIZE_SECRET, *PLMMR_RI_INITIALIZE_SECRET;
  95. #if defined(REMOTE_BOOT)
  96. typedef struct _LMMR_RI_CHECK_FOR_NEW_PASSWORD {
  97. ULONG Length; // in bytes
  98. UCHAR Data[1];
  99. } LMMR_RI_CHECK_FOR_NEW_PASSWORD, *PLMMR_RI_CHECK_FOR_NEW_PASSWORD;
  100. typedef struct _LMMR_RI_SET_NEW_PASSWORD {
  101. ULONG Length1; // in bytes
  102. ULONG Length2; // in bytes -- 0 if no second password is provided
  103. UCHAR Data[1]; // if present, second password starts Length1 bytes in
  104. } LMMR_RI_SET_NEW_PASSWORD, *PLMMR_RI_SET_NEW_PASSWORD;
  105. #endif // defined(REMOTE_BOOT)
  106. //
  107. // The format of the IMirror.dat file that we write out
  108. //
  109. #define IMIRROR_DAT_FILE_NAME L"IMirror.dat"
  110. typedef struct _MIRROR_VOLUME_INFO_FILE {
  111. ULONG MirrorTableIndex;
  112. WCHAR DriveLetter;
  113. UCHAR PartitionType;
  114. BOOLEAN PartitionActive;
  115. BOOLEAN IsBootDisk;
  116. BOOLEAN CompressedVolume;
  117. ULONG MirrorUncLength;
  118. ULONG MirrorUncPathOffset;
  119. ULONG DiskNumber;
  120. ULONG PartitionNumber;
  121. ULONG DiskSignature;
  122. ULONG BlockSize;
  123. ULONG LastUSNMirrored;
  124. ULONG FileSystemFlags;
  125. WCHAR FileSystemName[16];
  126. ULONG VolumeLabelLength;
  127. ULONG VolumeLabelOffset;
  128. ULONG NtNameLength;
  129. ULONG NtNameOffset;
  130. ULONG ArcNameLength;
  131. ULONG ArcNameOffset;
  132. LARGE_INTEGER DiskSpaceUsed;
  133. LARGE_INTEGER StartingOffset;
  134. LARGE_INTEGER PartitionSize;
  135. } MIRROR_VOLUME_INFO_FILE, *PMIRROR_VOLUME_INFO_FILE;
  136. #define IMIRROR_CURRENT_VERSION 2
  137. typedef struct _MIRROR_CFG_INFO_FILE {
  138. ULONG MirrorVersion;
  139. ULONG FileLength;
  140. ULONG NumberVolumes;
  141. ULONG SystemPathLength;
  142. ULONG SystemPathOffset;
  143. BOOLEAN SysPrepImage; // if FALSE, means it's a mirror
  144. BOOLEAN Debug;
  145. ULONG MajorVersion;
  146. ULONG MinorVersion;
  147. ULONG BuildNumber;
  148. ULONG KernelFileVersionMS;
  149. ULONG KernelFileVersionLS;
  150. ULONG KernelFileFlags;
  151. ULONG CSDVersionLength;
  152. ULONG CSDVersionOffset;
  153. ULONG ProcessorArchitectureLength;
  154. ULONG ProcessorArchitectureOffset;
  155. ULONG CurrentTypeLength;
  156. ULONG CurrentTypeOffset;
  157. ULONG HalNameLength;
  158. ULONG HalNameOffset;
  159. MIRROR_VOLUME_INFO_FILE Volumes[1];
  160. } MIRROR_CFG_INFO_FILE, *PMIRROR_CFG_INFO_FILE;
  161. //
  162. // The format of the alternate data stream on sysprep files containing
  163. // additional client disk info.
  164. //
  165. #define IMIRROR_ACL_STREAM_NAME L":$SYSPREP"
  166. #define IMIRROR_ACL_STREAM_VERSION 2
  167. typedef struct _MIRROR_ACL_STREAM {
  168. ULONG StreamVersion;
  169. ULONG StreamLength;
  170. LARGE_INTEGER ChangeTime;
  171. ULONG ExtendedAttributes;
  172. ULONG SecurityDescriptorLength;
  173. // SecurityDescriptor of SecurityDescriptorLength
  174. } MIRROR_ACL_STREAM, *PMIRROR_ACL_STREAM;
  175. #define IMIRROR_SFN_STREAM_NAME L":$SYSPREPSFN"
  176. #define IMIRROR_SFN_STREAM_VERSION 1
  177. typedef struct _MIRROR_SFN_STREAM {
  178. ULONG StreamVersion;
  179. ULONG StreamLength;
  180. // short file name of stream length;
  181. } MIRROR_SFN_STREAM, *PMIRROR_SFN_STREAM;
  182. //
  183. // Service Control Messages to BINLSVC
  184. //
  185. #define BINL_SERVICE_REREAD_SETTINGS 128
  186. //
  187. // UI constants
  188. //
  189. // MAX_DIRECTORY_CHAR_COUNT theoretical limit is 68 for TFTP, but we keep
  190. // it lower here because certain buffers in the kernel, setupdd, etc.,
  191. // are statically allocated too small. Rather than try to fix all these
  192. // buffers now, we are making the enforced limit lower. (40 should still
  193. // be plenty big!) After W2K, we can look at fixing the bad code.
  194. //
  195. #define REMOTE_INSTALL_MAX_DIRECTORY_CHAR_COUNT 40
  196. #define REMOTE_INSTALL_MAX_DESCRIPTION_CHAR_COUNT 66
  197. #define REMOTE_INSTALL_MAX_HELPTEXT_CHAR_COUNT 261
  198. //
  199. // RISETUP has to call into BINLSVC to have it return the list of
  200. // files required by all the net card INFs in a given directory. Here's
  201. // the necessary stuff for this functionality.
  202. //
  203. // If you specify a non-zero value, we bail.
  204. //
  205. typedef ULONG (*PNETINF_CALLBACK)( PVOID Context, PWCHAR InfName, PWCHAR FileName );
  206. typedef ULONG (*PNETINFENUMFILES)(
  207. PWCHAR FlatDirectory, // all the way to "i386"
  208. ULONG Architecture, // PROCESSOR_ARCHITECTURE_XXXXX
  209. PVOID Context,
  210. PNETINF_CALLBACK CallBack );
  211. #define NETINFENUMFILESENTRYPOINT "NetInfEnumFiles"
  212. ULONG
  213. NetInfEnumFiles (
  214. PWCHAR FlatDirectory, // all the way to "i386"
  215. ULONG Architecture, // PROCESSOR_ARCHITECTURE_XXXXX
  216. PVOID Context,
  217. PNETINF_CALLBACK CallBack
  218. );
  219. #endif // _REMBOOT_H_