reference:plugins:vfs_plugins:vfs_getfileinformation

VFS_GetFileInformation(
     HANDLE:hVFSData,
     LPVFSFUNCDATA:lpFuncData,
     LPTSTR:lpszPath,
     HANDLE:hHeap,
     DWORD:dwFlags
)
→ LPVFSFILEDATAHEADER

Arguments

hVFSData

[in] The handle to the namespace instance data

lpFuncData

[in] unused

lpszPath

[in] A null-terminated string containing the full pathname of the file to retrieve information for

hHeap

[in] A handle to a memory heap for you to allocate memory from using HeapAlloc.

dwFlags

[in] Currently unused.

Return value

If the file exists you should allocate a chunk of memory using the heap provided containing a VFSFILEDATAHEADER and a VFSFILEDATA structure and return the address of the allocated memory. If the file does not exist you should return NULL.

Description

The VFS_GetFileInformation function is called to retrieve information about a specified file or folder in your plugin's namespace.

This function is very similar to VFS_ReadDirectory - the only difference is that information for only a single file is returned. The following code is an example of how to allocate the necessary data structure:

LPVOID lpMem = HeapAlloc(hHeap,0,sizeof(VFSFILEDATAHEADER) +
                        sizeof(VFSFILEDATA) );
LPVFSFILEDATAHEADER pHeader=(LPVFSFILEDATAHEADER)lpMem;
LPVFSFILEDATA pFileData=(LPVFSFILEDATA)(pHeader+1);
// initialize structures
return pHeader;