Used to change a file from being backed by a physical file to one backed by a system data provider.
HRESULT WofSetFileDataLocation( HANDLE FileHandle, ULONG Provider, PVOID ExternalFileInfo, ULONG Length );
A handle to a file opened with CreateFile or a similar API.
Indicates which provider is backing this file. Currently defined providers are:
|WOF_PROVIDER_WIM||Indicates that the data for the file should be obtained from a WIM file. On access, data is transparently extracted from the WIM file and provided to applications. If the file contents are modified, data is transparently decompressed and the file is restored to the same physical form it had if this API were not used.|
|WOF_PROVIDER_FILE||Indicates that the data for the file should be compressed and stored with the file itself. On access, data is transparently decompressed and provided to applications. If the file contents are modified, data is transparently decompressed and the file is restored to the same physical form it had if this API were not used. This provider requires Windows 10.|
Provides data specific to the specified provider. Data structures for each defined provider are:
Specifies the length of provider specific data, in bytes. This should correspond to the structures defined above:
This function returns an HRESULT indicating success or the reason for failure.
When using WOF_PROVIDER_FILE, the operation may fail with ERROR_COMPRESSION_NOT_BENEFICIAL. This indicates that an attempt was made to compress the data, but no disk space was saved, so the file was not compressed. For most applications, this can be treated as a success condition.