The TWUEnumPackageDependencies function enumerates the dependencies of a given package, including the package itself. This is recursive: dependencies of dependencies are enumerated in a depth-first manner. The enumeration returns dependencies before the dependents, so it can be used to install packages from the bottom up. The original package is enumerated last.
Package dependencies are defined by the DependsOn key in the package sections of the package information file.
TWUPackageData * TWUEnumPackageDependencies(
TWUHANDLE hSession,
TWUPackageData *pPackage,
fTWUPackageCB pCallback,
LPARAM lCookie,
URESULT *puResult
);
Delphi version:
function TWUEnumPackageDependencies(
hSession: TWUHANDLE;
pPackage: PTWUPackageData;
pCallback: fTWUPackageCB;
lCookie: LPARAM;
var puResult: URESULT
): PTWUPackageData;
The function returns a pointer to the package that caused the enumeration to fail (by returning a nonzero result from the callback function), or NULL if all or no packages were enumerated. If all packages were enumerated, *puResult will contain ERROR_SUCCESS; if no packages were enumerated, *puResult will contain a nonzero error code.