support both cimfs and cimwriter dlls#2587
Open
anmaxvl wants to merge 3 commits intomicrosoft:mainfrom
Open
Conversation
2ccfeab to
47570f0
Compare
47570f0 to
36bea94
Compare
helsaawy
reviewed
Jan 14, 2026
Contributor
helsaawy
left a comment
There was a problem hiding this comment.
nits in comments; but LGTM overall
helsaawy
approved these changes
Jan 20, 2026
97f02b3 to
2589b91
Compare
helsaawy
approved these changes
Jan 20, 2026
6070070 to
b61bbd6
Compare
helsaawy
approved these changes
Feb 9, 2026
b61bbd6 to
a9415b3
Compare
helsaawy
approved these changes
Feb 11, 2026
msscotb
approved these changes
Feb 12, 2026
| //sys CimMergeMountVerifiedImage(numCimPaths uint32, backingImagePaths *CimFsImagePath, flags uint32, volumeID *g, hashSize uint16, hash *byte) (hr error) = cimfs.CimMergeMountVerifiedImage | ||
| // pickSupported makes sure we use appropriate syscalls depending on which DLLs are present. | ||
| func pickSupported[F any](cimWriterFunc, cimfsFunc F) F { | ||
| if cimwriter.Supported() { |
Contributor
There was a problem hiding this comment.
Is there a way to log which CIM dll gets used but not for each syscall?
Contributor
Author
There was a problem hiding this comment.
added logging to the function used by snapshotter.
The PR introducing `cimwriter.dll` was a breaking change, which is fixed in this PR. Split CIM syscalls into separate packages for `cimfs.dll` and `cimwriter.dll`, with shared types in `internal/winapi/types/`. Add `pickSupported()` to prefer `cimwriter.dll` for write operations and fall back to `cimfs.dll` when `cimwriter.dll` is not present. Mount, dismount, and verification operations always use `cimfs.dll`. Relax `CimFsSupported()` to only require cimfs.dll instead of both DLLs (the breaking change). Signed-off-by: Maksim An <maksiman@microsoft.com>
Regenerate zsyscall_windows.go files for the new cimfs and cimwriter packages after PR feedback. Signed-off-by: Maksim An <maksiman@microsoft.com>
Allow `cimwriter.dll` and `cimfs.dll` to be loaded from outside the system directory. Log the resolved DLL path on load using `GetModuleFileName`. Add `LogCimDLLSupport()` to report which DLL is active for write operations, called from `CreateBlockCIMWithOptions` on every block CIM creation. Add `TestMain` in `pkg/cimfs` to print DLL availability in test output. Signed-off-by: Maksim An <maksiman@microsoft.com>
2224b12 to
32f979e
Compare
helsaawy
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PR introducing
cimwriter.dllwas a breaking change, which is fixed in this PR.Add both
cimfs.dllandcimwriter.dllsyscalls and only usecimwriter.dllwhen present.Add logging to indicate which one is used: