Skip to content

FSP_FILE_SYSTEM_INTERFACE is build with all function pointers set, instead of only the user-defined ones #42

@touilleMan

Description

@touilleMan

see

file_system_interface = ffi.new("FSP_FILE_SYSTEM_INTERFACE*")
file_system_interface.GetVolumeInfo = lib._trampolin_fs_GetVolumeInfo
file_system_interface.SetVolumeLabel = lib._trampolin_fs_SetVolumeLabel
file_system_interface.GetSecurityByName = lib._trampolin_fs_GetSecurityByName
file_system_interface.Create = lib._trampolin_fs_Create
file_system_interface.Open = lib._trampolin_fs_Open
file_system_interface.Overwrite = lib._trampolin_fs_Overwrite
file_system_interface.Cleanup = lib._trampolin_fs_Cleanup
file_system_interface.Close = lib._trampolin_fs_Close
file_system_interface.Read = lib._trampolin_fs_Read
file_system_interface.Write = lib._trampolin_fs_Write
file_system_interface.Flush = lib._trampolin_fs_Flush
file_system_interface.GetFileInfo = lib._trampolin_fs_GetFileInfo
file_system_interface.SetBasicInfo = lib._trampolin_fs_SetBasicInfo
file_system_interface.SetFileSize = lib._trampolin_fs_SetFileSize
file_system_interface.CanDelete = lib._trampolin_fs_CanDelete
file_system_interface.Rename = lib._trampolin_fs_Rename
file_system_interface.GetSecurity = lib._trampolin_fs_GetSecurity
file_system_interface.SetSecurity = lib._trampolin_fs_SetSecurity
file_system_interface.ReadDirectory = lib._trampolin_fs_ReadDirectory
file_system_interface.ResolveReparsePoints = lib._trampolin_fs_ResolveReparsePoints
file_system_interface.GetReparsePoint = lib._trampolin_fs_GetReparsePoint
file_system_interface.SetReparsePoint = lib._trampolin_fs_SetReparsePoint
file_system_interface.DeleteReparsePoint = lib._trampolin_fs_DeleteReparsePoint
file_system_interface.GetStreamInfo = lib._trampolin_fs_GetStreamInfo
file_system_interface.GetDirInfoByName = lib._trampolin_fs_GetDirInfoByName

On top of that, the default implementation of methods is to raise a NotImplementedError which in turn is caught and turn into a STATUS_UNEXPECTED_IO_ERROR

The FSP_FILE_SYSTEM_INTERFACE structure should in theory only contains the function pointers corresponding to function implemented by the end user, because a NULL function pointer often treated differently from a function pointer returning e.e. STATUS_NOT_IMPLEMENTED.

For instance, having a set_basic_info method returning STATUS_NOT_IMPLEMENTED causes "Invalid MS-DOS function error" in explorer.exe when copying some directory (but not all, and the copy succeed anyway...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions