The TWUGetPIF function retrieves and parses a package information file from the remote or local server. If successful, the resulting packages can be enumerated or accessed with TWUEnumPackages, TWUEnumPackageDependencies, TWUFindPackage, and TWUGetPackage. The total number of packages is available through TWUGetPackageCount.
Tip: TWUOpenUpdateURL combines the functionality of TWUOpenSession and TWUGetPIF. You might find it more convenient to use that function.
URESULT TWUGetPIF(
TWUHANDLE hSession,
const TCHAR *pszPIFPath
);
Delphi version:
function TWUGetPIF(
hSession: TWUHANDLE;
pszPIFPath: PTCHAR
): URESULT;
If the function succeeds, it returns ERROR_SUCCESS (0). If it fails, it returns a nonzero Win32 API error code. You can use TWUGetErrorMessage to retrieve the error message that corresponds to the error code.