PatchStatusProc

The PatchStatusProc function is an application-defined callback function used with the CreatePatchFile, ApplyPatchFile, CreatePackage and UpdatePackage functions. It is called when a portion of a patch operation is completed. The LPPATCHSTATUSPROC type defines a pointer to this callback function. PatchStatusProc is a placeholder for the application-defined function name.

BOOL CALLBACK PatchStatusProc(
HPACKAGE hPackage, // handle to patch package
LPPATCH_STATUS_INFORMATION lpInfo, // status information
LPVOID lParam // user-defined parameter
);

Parameters

hPackage
[in] A handle to the current patch package file. If the CreatePatchFile or ApplyPatchFile function was called, this parameter will have a value of INVALID_PACKAGE_HANDLE, since no package file is associated with the patch.
 
lpInfo
[in] A pointer to a PATCH_STATUS_INFORMATION structure which will contain information about the current patch operation.
 
lParam
[in] A user-defined parameter which was passed through the calling function. This value is commonly used to associate the callback with a private data structure or an instance of a class.

Return Values

The PatchStatusProc function should return a non-zero value to continue the current operation in progress.

To cancel the operation, the function should return a value of zero. If this callback function returns zero, the calling function will fail with the error AP_ERROR_OPERATION_CANCELED. It is the responsibilty of the application to handle this error condition.

Remarks

An application can use this callback to update user-interface objects such as a progress to inform the user as to the status of the patching process.

If a patching operation is canceled when a package is being applied on a target system, any modified files will automatically be reverted to their previous versions.

Requirements

Windows NT/2000/XP: Requires Windows NT 4.0 SP3 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Include apatch.h.
Library: Use apatch32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.

See Also

ApplyPatchFile, ApplyPackage, CreatePatchFile, CreatePackage, UpdatePackage