How winfsp/sshfs-win works
Main Components
• Windows Shell/Explorer & Networking: Represent how the user or the “net use” command interacts with the mapped network drive.
• SSHFS-Win Wrapper: The sshfs-win.c file is the main entry point; it acts as a wrapper to translate Windows drive mapping requests into calls to SSHFS.
• Upstream SSHFS Submodule: Highlight that the project includes the full SSHFS code (patched by files in the “patches” directory) to do the heavy lifting.
• Cygwin Environment: Illustrate that a POSIX-like environment (provided by Cygwin) is required to run the SSHFS binary.
• WinFsp (and its related components): Indicate that WinFsp provides the FUSE (Filesystem in Userspace) functionality on Windows so that the mounted filesystem appears native.
• Build and Installer Components: Include the Makefile, Wix installer file (sshfs-win.wxs), and additional tools (such as registry patch files in “etc” and “patches”) as part of the build/packaging process.
Relationships and Data Flow
• That the SSHFS process communicates with the remote SSHFS host over SSH (including options for tunneling or key-based authentication as explained in the README).
• Interaction with WinFsp: after the SSHFS/Cygwin layer decodes the network drive operations, WinFsp translates them into Windows file system calls.
• Optionally, add the build and installer components on the side. Show that the build process (driven by the Makefile and patches incorporated from “patches”, “art”, and “etc”) packages everything into an MSI installer via the Wix configuration.
Architectural Patterns
• Layered architecture: Windows front end (user interactions) → Wrapper & integration layer → POSIX SSHFS engine (with patches) → WinFsp file system integration.
• That the project uses external dependencies (Cygwin for POSIX, WinFsp for FUSE) and patches over upstream SSHFS to meet Windows-specific requirements.
• The separation of concerns is clear—the wrapper handles Windows connectivity logic and the SSHFS submodule handles remote filesystem semantics.