Skip to content

Add support for callback when loading images and display loaded images in wslc image load#40960

Open
OneBlue wants to merge 9 commits into
masterfrom
user/oneblue/load-callback
Open

Add support for callback when loading images and display loaded images in wslc image load#40960
OneBlue wants to merge 9 commits into
masterfrom
user/oneblue/load-callback

Conversation

@OneBlue

@OneBlue OneBlue commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change adds API support for callbacks when loaded images and displays loaded images in wslc

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI review requested due to automatic review settings June 30, 2026 19:53
@OneBlue OneBlue requested a review from a team as a code owner June 30, 2026 19:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the internal WSLC COM surface to support an IImageLoadCallback that reports each image reference discovered during LoadImage, and wires that through the wslc image load CLI so it prints “Loaded image …” lines as images are restored.

Changes:

  • Adds EnumReferenceFormat + IImageLoadCallback to wslc.idl and extends IWSLCSession::LoadImage to accept the callback.
  • Implements callback detection/parsing in WSLCSession::ImportImageImpl and prints loaded-image lines in the CLI image load task.
  • Updates unit/e2e tests and helper plumbing to validate callback behavior and CLI output.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/windows/WSLCTests.cpp Updates LoadImage calls for new signature; adds tests validating the callback reports loaded images.
test/windows/wslc/e2e/WSLCE2EImageSaveTests.cpp Validates wslc image load prints loaded-image lines when restoring multiple images.
test/windows/wslc/e2e/WSLCE2EHelpers.h Declares HelloWorldTestImage() helper.
test/windows/wslc/e2e/WSLCE2EHelpers.cpp Implements HelloWorldTestImage() helper.
test/windows/Common.cpp Updates helper LoadTestImage() to pass the new (optional) callback param.
src/windows/wslcsession/WSLCSession.h Extends LoadImage method signature to accept IImageLoadCallback*.
src/windows/wslcsession/WSLCSession.cpp Passes callback through to ImportImageImpl; parses “Loaded image …” stream output and invokes callback.
src/windows/wslc/tasks/ImageTasks.cpp Adds CLI callback implementation that prints localized “Loaded image …” lines during image load.
src/windows/wslc/services/ImageService.h Extends ImageService::Load to accept an optional callback.
src/windows/wslc/services/ImageService.cpp Passes optional callback through to COM LoadImage.
src/windows/service/inc/wslc.idl Adds EnumReferenceFormat + IImageLoadCallback; extends IWSLCSession::LoadImage signature.
src/windows/common/wslutil.h Removes the local EnumReferenceFormat enum class (now sourced from IDL-generated headers).
src/windows/common/wslutil.cpp Updates parsing to use the IDL enum constants (EnumReferenceFormatTag, etc.).
msipackage/package.wix.in Registers proxy/stub for the new IImageLoadCallback interface.
localization/strings/en-US/Resources.resw Adds localized CLI strings for “Loaded image …” and “Loaded image ID …”.

Comment thread src/windows/wslc/tasks/ImageTasks.cpp Outdated
Comment thread src/windows/wslcsession/WSLCSession.h
Comment thread src/windows/wslcsession/WSLCSession.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants