4 * Definitions for Windows Overlay File System Filter (WOF) ioctls. See
5 * http://msdn.microsoft.com/en-us/library/windows/hardware/ff540367(v=vs.85).aspx
6 * for more information.
12 #include "wimlib/types.h"
14 #define WOF_CURRENT_VERSION 1
15 #define WOF_PROVIDER_WIM 1
16 #define WIM_PROVIDER_CURRENT_VERSION 1
18 /* Identifies a backing provider for a specific overlay service version. */
19 struct wof_external_info {
21 /* Version of the overlay service supported by the backing provider.
22 * Set to WOF_CURRENT_VERSION. */
25 /* Identifier for the backing provider. Example value:
26 * WOF_PROVIDER_WIM. */
30 /* WOF reparse points can't be directly manipulated on Windows; setting the
31 * reparse data doesn't seem to work, and the WOF driver hides the reparse
32 * points so their data can't be read from Windows 8.1 and later. Use the
33 * ioctls (FSCTL_SET_EXTERNAL_BACKING, FSCTL_GET_EXTERNAL_BACKING,
34 * FSCTL_DELETE_EXTERNAL_BACKING) instead. */
37 * Format of the reparse data of WoF (Windows Overlay File System Filter)
38 * reparse points. These include WIMBoot "pointer files".
41 * - Reparse tag is 0x80000017
42 * - Don't make these if the file has no unnamed data stream, has an empty
43 * unnamed data stream, or already is a reparse point.
44 * - There is nowhere to put named data streams. They have to copied
45 * literally to the reparse point file.
47 struct wof_rpdata_disk {
48 struct wof_external_info info;
51 /* (Guess) Version of this structure --- set to 2. */
54 /* Integer ID that identifies the WIM. */
57 /* SHA1 message digest of the file's unnamed data
61 /* SHA1 message digest of the WIM's lookup table. */
62 u8 wim_lookup_table_sha1[20];
64 /* Uncompressed size of the file's unnamed data stream,
66 u64 stream_uncompressed_size;
68 /* Compressed size of the file's unnamed data stream, in
69 * bytes. If stream is stored uncompressed, set this
70 * the same as the uncompressed size. */
71 u64 stream_compressed_size;
73 /* Byte offset of the file's unnamed data stream in the
75 u64 stream_offset_in_wim;
81 /*****************************************************************************
83 * --- FSCTL_SET_EXTERNAL_BACKING ---
85 * Sets the backing source of a file.
87 * DeviceType: 9 (FILE_DEVICE_FILE_SYSTEM)
88 * Access: 0 (FILE_ANY_ACCESS)
90 * Method: 0 (METHOD_BUFFERED)
92 * Input buffer: 'struct wof_external_info' followed by provider-specific data
93 * ('struct wim_provider_external_info' in the case of WIM).
97 #define FSCTL_SET_EXTERNAL_BACKING 0x9030C
99 struct wim_provider_external_info {
101 /* Set to WIM_PROVIDER_CURRENT_VERSION. */
104 /* 0 when WIM provider active, otherwise
105 * WIM_PROVIDER_EXTERNAL_FLAG_NOT_ACTIVE or
106 * WIM_PROVIDER_EXTERNAL_FLAG_SUSPENDED. */
109 /* Integer ID that identifies the WIM. Get this with the
110 * FSCTL_ADD_OVERLAY ioctl. */
113 /* SHA1 message digest of the file's unnamed data stream. */
114 u8 resource_hash[20];
117 /*****************************************************************************
119 * --- FSCTL_ADD_OVERLAY ---
121 * Adds a new external backing source to a volume.
123 * DeviceType: 9 (FILE_DEVICE_FILE_SYSTEM)
124 * Access: 2 (FILE_WRITE_ACCESS)
126 * Method: 0 (METHOD_BUFFERED)
128 * Input buffer: 'struct wof_external_info' followed by provider-specific data
129 * ('struct wim_provider_add_overlay_input' in the case of WIM).
131 * Output buffer: Buffer large enough to receive any information resulting from
132 * the add operation. For the WIM provider, this must be an 8 byte buffer that
133 * receives the 64-bit WIM file ID.
135 #define FSCTL_ADD_OVERLAY 0x98330
137 struct wim_provider_add_overlay_input {
139 /* Type of WIM file. */
141 #define WIM_BOOT_OS_WIM 0
142 #define WIM_BOOT_NOT_OS_WIM 1
144 /* Index of the image in the WIM to use??? (This doesn't really make
145 * sense, since WIM files combine streams for all images into a single
146 * table. Set to 1 if unsure...) */
149 /* Byte offset of wim_file_name in this buffer, not including the
150 * preceding 'struct wof_external_info' (should be 16). */
151 u32 wim_file_name_offset;
153 /* Number of bytes in wim_file_name. */
154 u32 wim_file_name_length;
156 /* Full path to the WIM, e.g. "\??\d:\test-wimboot.wim".
157 * Does NOT need to be null terminated (MS docs claim otherwise). */
158 wchar_t wim_file_name[];