VFS_FindFirstFile(
HANDLE:hVFSData,
LPVFSFUNCDATA:lpFuncData,
LPTSTR:lpszPath,
LPWIN32_FIND_DATA:lpwfdData,
HANDLE:hAbortEvent
)
→ HANDLE
The VFS_FindFirstFile function is called to obtain information about a single file or folder, or about all items in a directory that match a wildcard pattern.
You should check the final path component of lpszPath to see if it is an actual filename, or a wildcard pattern. Currently Opus does not use wildcard patterns other than "*" - that is, either Opus wants just a single file, or it wants every file in the directory.
You should place as much information as possible about the first (or only) matching file into lpwfdData and return a data structure cast to a HANDLE that Opus can use to continue the enumeration.
If Opus only asks for information about a single file there is no need to allocate a data structure - in this case you could just return TRUE cast to a HANDLE, as long as you check for this value in VFS_FindNextFile and VFS_FindClose. If Opus supplies a wildcard pattern then the structure pointed to by the handle you return must provide enough information for your VFS_FindNextFile function to continue the enumeration of all items in the directory.
If hAbortEvent is non-NULL it is a windows event handle that you can use to check if the user wants to abort the enumeration. You should store this handle in your data structure so you can check it in your VFS_FindNextFile function. You can check for the abort signal with the following code:
if ( hAbortEvent && WaitForSingleObject( hAbortEvent, 0 ) == WAIT_OBJECT_0 )
{
// aborted
}