The CPackage::FindNextFile function
returns the first file in the package that matches the specified search criteria.
| BOOL FindNextFile( |
|
LPPACKAGE_FILE_INFORMATION lpFileInfo |
|
// file information |
| ); |
Parameters
- lpFileInfo
- [in/out] A pointer to a PACKAGE_FILE_INFORMATION structure
that will contain information about the file. Note that the cbStructure member
must be initialized to the size of the structure that is being passed to the function.
Return Values
If the CPackage::FindNextFile
function succeeds, it will return a non-zero value.
If the function fails, it will return a value of zero. To
get extended error information, call GetLastError.
Remarks
The CPackage::FindNextFile function
will return FALSE after the last file has been returned.
Files that have been deleted from the package will not be
returned by this function.
Example
// Delete all executable files from the package
PACKAGE_FILE_INFORMATION pfInfo;
DWORD dwError = ERROR_SUCCESS;
BOOL bResult;
pfInfo.cbStructure = sizeof(PACKAGE_FILE_INFORMATION);
bResult = FindFirstFile(hPackage, _T("*.exe"),
PACKAGE_FILE_PLATFORM_DEFAULT,
PACKAGE_FIND_RECURSIVE, &pfInfo);
while (bResult)
{
bResult = DeleteFile(hPackage,
PACKAGE_FILE_PLATFORM_DEFAULT,
pfInfo.dwChecksum,
pfInfo.szFileName);
if (bResult == FALSE)
{
dwError = GetLastError();
break;
}
bResult = FindNextFile(hPackage, &pfInfo);
}
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
CPackage::FindFirstFile,
CPackage::GetNextFile
|