/* "Reparse point data, including the tag and optional GUID, cannot
* exceed 16 kilobytes." - MSDN */
- if (wim_resource_size(lte) > (16 * 1024 - 8)) {
+ if (wim_resource_size(lte) > REPARSE_POINT_MAX_SIZE - 8) {
ERROR("Reparse data of `%s' is too long (%"PRIu64" bytes)",
dentry->_full_path, wim_resource_size(lte));
return WIMLIB_ERR_INVALID_DENTRY;
if (!lte)
return -EIO;
- if (wim_resource_size(lte) > 10000)
+ if (wim_resource_size(lte) > REPARSE_POINT_MAX_SIZE)
return -EIO;
u8 res_buf[wim_resource_size(lte)];
* yet. The differences between the versions are undocumented. */
#define WIM_VERSION 0x10d00
+#define REPARSE_POINT_MAX_SIZE (16 * 1024)
+
/* Metadata for a resource in a WIM file. */
struct resource_entry {
/* Size, in bytes, of the resource in the WIM file. */
/* "Reparse point data, including the tag and optional GUID,
* cannot exceed 16 kilobytes." - MSDN */
- char reparse_point_buf[16 * 1024];
+ char reparse_point_buf[REPARSE_POINT_MAX_SIZE];
DWORD bytesReturned;
if (!DeviceIoControl(hFile, FSCTL_GET_REPARSE_POINT,