The fTWUPackageCB typedef defines the prototype for the callback function used by TWUEnumPackages and TWUEnumPackageDependencies.
typedef URESULT (*fTWUPackageCB)(
TWUHANDLE hSession,
TWUPackageData *pPackage,
LPARAM lCookie
);
Delphi version:
type fTWUPackageCB = function(
hSession: TWUHANDLE;
pPackage: PTWUPackageData;
lCookie: LPARAM
): URESULT;
If the function succeeds, it must return ERROR_SUCCESS (0) to continue the enumeration. If it fails or if you want to terminate the enumeration for some reason, the function must return a nonzero Win32 error code. In that case, the enumeration will be terminated and TWUEnumPackages or TWUEnumPackageDependencies will return pPackage. The error code itself will be returned through the puResult parameter of those functions.