VFS_GetNextFile(
     HANDLE:hVFSData,
     HANDLE:hOutOfOrderData,
     LPWSTR:lpszFilePath,
     UINT:cchFileMax,
     LPSTREAM*:ppFileStream,
     WIN32_FIND_DATA*:pfdFileInfo,
     DWORD*:pdwDataValid,
     LONG*:plErrCode,
     LPWSTR:pszErrMsg,
     UINT:cchErrMsgMax
)
→ BOOL

Arguments

hVFSData

[in] The handle to the namespace instance data

hOutOfOrderData

[in] The handle returned by VFS_BeginOutOfOrder

lpszFilePath

[out] Buffer to receive the path of the file

cchFileMax

[in] Size of the lpszFilePath buffer in characters

ppFileStream

[out] Receives a stream for the file

pfdFileInfo

[out] Receives information about the file. Use pdwDataValid to indicate which fields are valid. Ignored if the function returns FALSE

pdwDataValid

[out] Flags indicating which data is valid

VFSGNF_DataValid_FilePathlpszFilePath
VFSGNF_DataValid_AttrpfdFileInfo->dwFileAttributes
VFSGNF_DataValid_CreateTimepfdFileInfo->ftCreationTime
VFSGNF_DataValid_AccessTimepfdFileInfo->ftLastAccessTime
VFSGNF_DataValid_WriteTimepfdFileInfo->ftLastWriteTime
VFSGNF_DataValid_SizepfdFileInfo->nFileSizeHigh and pfdFileInfo->nFileSizeLow
VFSGNF_DataValid_FileNamepfdFileInfo->cFileName
VFSGNF_DataValid_AllAll of the above

plErrCode

[out] Receives an error code if the function returns FALSE

pszErrMsg

[out] Buffer for a custom error message. Set *plErrCode to -1 to use it

cchErrMsgMax

[in] Size of the pszErrMsg buffer in characters

Return value

Return TRUE if the next file was retrieved successfully, or FALSE if there was an error or there are no more files.

Description

The VFS_GetNextFile function is called to retrieve the next file of an out-of-order operation.

If VFS_GetNextFile returns TRUE, at least VFSGNF_DataValid_FilePath must be set in *pdwDataValid.

If VFS_GetNextFile returns FALSE:

Errors reading from the stream should be saved in the stream object and made available through the IOpusOOOStreamError interface, which Opus looks for on the stream if its methods fail (the ISequentialStream::Read method should return E_FAIL or another error code). The interface has three methods:

struct IOpusOOOStreamError : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetError(LONG* lErrCode) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetErrorMsg(LPWSTR pszErrBuf, ULONG cchErrBuf) = 0;
    virtual HRESULT STDMETHODCALLTYPE ClearError() = 0;
};

Its interface ID is IID_IOpusOOOStreamError.

VFS_GetLastError is never used to report errors relating to the out-of-order functions.

See also VFS_BeginOutOfOrder, VFS_EndOutOfOrder and the VFSCAPABILITY_OUTOFORDER capability flag.

This function was added in Directory Opus 10 (VFSPLUGINVERSION 4).