According to the following web page
http://msdn.microsoft.com/library/de...bdcapitech.asp
it should be possible to use CreatePatchFile() from MSPATCHC.DLL to
compress an executable (e.g. A.DLL) without supplying a previous
version (a basis or a source file) of the target file to the API call.
For example, the following code should create a compressed version of
A.DLL:
BOOL ok = CreatePatchFile(
NULL // LPCSTR OldFileName
, "a.dll" // LPCSTR NewFileName
, "a.patch" // LPCSTR PatchFileName
, PATCH_OPTION_USE_BEST // ULONG OptionFlags
, NULL // PPATCH_OPTION_DATA OptionData
);
Instead, it returns an error and GetLastError() reports error #3: 'The
system cannot find the path specified.'
The offending paragraph titled 'Compressing a Target Without a Basis
File' from the above mentioned web page reads:
"If a Delta Create function is called and the basis file is specified
as NULL (file name string pointer for functions that designate files by
paths) or INVALID_HANDLE_VALUE (handle for functions that designate
files by handles), the output will be a compressed target file that is
not actually a delta."
What am I doing wrong and how to make CreatePatchFile() compress a
target without a basis file? Do I have to pass a specific OptionFlags
value, or supply a specific OptionData structure?
I'm running into a similar problem when trying to decompress a patch
file using ApplyPatchToFile() with OldFileName set to NULL.
Any ideas to the solution of the problem?
Thanks in advance,
Boris
bmazic [at] onetel [dot] com