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.

BOOL
WINAPI
WIMSetReferenceFile(
	 HANDLE  hWim,
	 PWSTR   pszPath,
	 DWORD  dwFlags
	);

Parameters

hWim

[in] A handle to a .wim (Windows image) file returned by the WIMCreateFile function.

pszPath

[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.

If the function fails, then the return value is zero. To obtain extended error information, call the GetLastError function.

Remarks

If NULL is passed in for the pszPath 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.

See Also