~~Title: VFS_GetNextFile~~
VFS_GetNextFile && BOOL && Return **TRUE** if the next file was retrieved successfully, or **FALSE** if there was an error or there are no more files. &&
hVFSData && HANDLE && [in] The handle to the namespace instance data &&
hOutOfOrderData && HANDLE && [in] The handle returned by [[vfs_beginoutoforder|VFS_BeginOutOfOrder]] &&
lpszFilePath && LPWSTR && [out] Buffer to receive the path of the file &&
cchFileMax && UINT && [in] Size of the //lpszFilePath// buffer in characters &&
ppFileStream && LPSTREAM* && [out] Receives a stream for the file &&
pfdFileInfo && WIN32_FIND_DATA* && [out] Receives information about the file. Use //pdwDataValid// to indicate which fields are valid. Ignored if the function returns **FALSE** &&
pdwDataValid && DWORD* && [out] Flags indicating which data is valid
|VFSGNF_DataValid_FilePath|//lpszFilePath//|
|VFSGNF_DataValid_Attr|//%%pfdFileInfo->dwFileAttributes%%//|
|VFSGNF_DataValid_CreateTime|//%%pfdFileInfo->ftCreationTime%%//|
|VFSGNF_DataValid_AccessTime|//%%pfdFileInfo->ftLastAccessTime%%//|
|VFSGNF_DataValid_WriteTime|//%%pfdFileInfo->ftLastWriteTime%%//|
|VFSGNF_DataValid_Size|//%%pfdFileInfo->nFileSizeHigh%%// and //%%pfdFileInfo->nFileSizeLow%%//|
|VFSGNF_DataValid_FileName|//%%pfdFileInfo->cFileName%%//|
|VFSGNF_DataValid_All|All of the above|
&&
plErrCode && LONG* && [out] Receives an error code if the function returns **FALSE** &&
pszErrMsg && LPWSTR && [out] Buffer for a custom error message. Set //*plErrCode// to -1 to use it &&
cchErrMsgMax && UINT && [in] Size of the //pszErrMsg// buffer in characters
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**:
* If all files are complete, set //*plErrCode// to **ERROR_NO_MORE_FILES**. This is the normal way to end the enumeration.
* If you have an error for a file, or for the overall operation, set //*plErrCode// to the error code, //or// set //*plErrCode// to -1 and store a custom error message in //pszErrMsg//.
* If possible, still return the file path in //lpszFilePath//. It is used to display the error message, and to mark the file as "failed" so it does not get deselected. If the failure happens before you know which path you are dealing with (or it is a general failure for the whole archive), leave //lpszFilePath// empty. The **WIN32_FIND_DATA** structure is ignored in error cases.
* You must //not// set **VFSGNF_DataValid_FilePath** if you leave //lpszFilePath// empty, or set it to something other than one of the file paths you were given. For example, you may report an error for the entire archive and set //lpszFilePath// to the archive path so it appears in the error message, or you may be reporting an error caused by //lpszFilePath// being too small for the path. In both cases **VFSGNF_DataValid_FilePath** must not be set.
* If **VFSGNF_DataValid_FilePath** is not set, //lpszFilePath// is only used to generate the error message. The message usually only includes the filename, not the full path, so you can fill in just the name if you like (for example, if the full path is too long for the buffer). If the name by itself is also too long, truncate it.
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|VFS_GetLastError]] is never used to report errors relating to the out-of-order functions.
See also [[vfs_beginoutoforder|VFS_BeginOutOfOrder]], [[vfs_endoutoforder|VFS_EndOutOfOrder]] and the **VFSCAPABILITY_OUTOFORDER** capability flag.
This function was added in Directory Opus 10 (**VFSPLUGINVERSION** 4).