VFS_CreateFile(
HANDLE:hVFSData,
LPVFSFUNCDATA:lpFuncData,
LPTSTR:lpszFile,
DWORD:dwMode,
DWORD:dwFlagsAndAttr,
DWORD:dwFlags,
LPFILETIME:lpFT
)
→ HANDLE
[in] Indicates the type of access desired for the new file handle.
| GENERIC_READ | An existing file is being opened for reading |
| GENERIC_WRITE | An existing file is being opened or a new file is being created for writing |
[in] Combines the Windows API "creation disposition" parameter with several Opus-specific flags.
| VFSCREATEF_RESUME | File is being opened to resume a transfer |
| VFSCREATEF_RECURSIVECOPY | A recursive copy operation is in progress |
| VFSCREATEF_THUMBNAIL | Opus is opening the file in order to generate a thumbnail |
| VFSCREATEF_IGNOREIFSLOW | If reading the file will take a long time you should not open it and return failure instead |
| VFSCREATEF_BUFFERED | The file is being buffered |
The VFS_CreateFile function is called to open or create a file in your plugin's namespace.
You will only ever be called with GENERIC_WRITE if you do not specify the VFSCAPABILITY_READONLY capabilities flag. Directory Opus never opens a file for both read and write access - the dwMode parameter will always equal GENERIC_READ or GENERIC_WRITE.
As well as the flags listed above for dwFlags this parameter also contains the Windows CreateFile "creation disposition" parameter - CREATE_NEW, CREATE_ALWAYS, etc. You can retrieve the creation disposition value using the special mask value VFSCREATEF_MODEMASK. If creation disposition value is not specified you should assume "create new" for a write operation and "open existing" for a read operation.
In general, if your plugin does not support some of the concepts or features of this function you are free to ignore them - the only really important thing is that you return a HANDLE that can be passed to the VFS_ReadFile, VFS_WriteFile, VFS_SeekFile and VFS_CloseFile functions.