Enables the WIMApplyImage and WIMCaptureImage functions to use alternate .wim files for file resources. This can enable optimization of storage when multiple images are captured with similar data.
C++
BOOL
WINAPI
WIMSetReferenceFile(
IN HANDLE hWim,
IN LPWSTR lpszPath,
IN DWORD dwFlags
);
Parameters
hWim
[in] A handle to a .wim (Windows image) file returned by the WIMCreateFile function.
lpszPath
[in] A pointer to a null-terminated string containing the path of the .wim file to be added to the reference list.
dwFlags
[in] Specifies how the .wim file is added to the reference list. This parameter must include one of the following two values.
Value Description
WIM_REFERENCE_APPEND
The specified .wim file is appended to the current list.
WIM_REFERENCE_REPLACE
The specified .wim file becomes the only item in the list.
This parameter can also include any combination of the following flags.
Flag Description
WIM_FLAG_VERIFY
Data integrity information is generated for new files, verified, and updated for existing files.
WIM_FLAG_SHARE_WRITE
The .wim file is opened in a mode that enables simultaneous reading and writing.
Return Value
If the function succeeds, then the return value is nonzero.
Remarks
If the function fails, then the return value is zero. To obtain extended error information, call the GetLastError function.
RemarksIf NULL is passed in for the lpszPath parameter and WIM_REFERENCE_REPLACE is passed for the dwFlags parameter, then the reference list is completely cleared, and no file resources are extracted during the WIMApplyImage function.