-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Merge the WSL Container SDK DLL project into the main feature branch #14172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 91 commits
Commits
Show all changes
101 commits
Select commit
Hold shift + click to select a range
6c1746b
add the WSL Container SDK API DLL wslcsdk.dll
richfr 5076336
Add internal sdk header file
richfr 6802d4f
update primary cmakelists file with wslc sdk build
richfr 9e817fd
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 04b5fa0
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 62b3272
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 9efaa38
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 625b73b
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 94a4450
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 3faa5ea
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 2610162
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 22e8d30
Rename wslcsdkprivate.h to WslcsdkPrivate.h
1wizkid 7334517
Apply suggestion from @Copilot
1wizkid ca43942
Rename cmakelists.txt to CMakeLists.txt
1wizkid 5fb9c4a
Change WslcSessionInitSettings to return void
1wizkid 4c64c5f
Comment out sessionSettings cast in wslcsdk.cpp
1wizkid 22d2038
Fix parameter annotations in wslcsdk.cpp
1wizkid 73a190c
Rename WslcContainerSettingsRuntimeName function
1wizkid 7583e78
Rename WslcContainerExecProcess to WslcContainerExec
1wizkid 0dd918b
Add signal and timeout parameters to WslcContainerStop
1wizkid e3980c6
Add flags parameter to WslcContainerDelete function
1wizkid a48c106
Change argument types in WslcProcessSettingsCmdLineArgs
1wizkid 6396cdb
Change key_value parameter type in WslcProcessSettingsEnvVariables
1wizkid a8fdba2
Enhance WslcProcessSettingsIoCallback with context
1wizkid 40fb3ae
Update parameter in WslcSessionImageDelete function
1wizkid ba4a4aa
Fix parameter type for WslcCanRun function
1wizkid f396db0
Rename WslcContainerExecProcess to WslcContainerExec
1wizkid 40563bd
Apply suggestion from @Copilot
1wizkid 76cc58f
Apply suggestion from @Copilot
1wizkid fef49e0
Apply suggestion from @Copilot
1wizkid 0535ab5
Apply suggestion from @Copilot
1wizkid 2dcfa36
Added * to structure
1wizkid 3cff6d9
Changes made pased on feedback
richfr 6060dc8
Merge branch 'feature/wsl-for-apps' into user/richfr
1wizkid 125328f
Apply suggestion from @Copilot
1wizkid 3b7ca3d
Replace size and alignment asserts with static_assert
1wizkid 8315464
Apply suggestion from @Copilot
1wizkid b35f524
Increase WSLC_SESSION_OPTIONS_SIZE from 80 to 88
1wizkid 6ded2a7
Change UINT16 to uint16_t in port mapping struct
1wizkid 15bd767
Fix parameter declaration for WslcContainerSettingsSetHostName
1wizkid 1b870cc
Fix parameter type in WslcContainerSettingsSetHostName
1wizkid bf4c903
Fix parameter type in WslcContainerSettingsSetDomainName
1wizkid d469e80
Fix parameter declaration for WslcContainerSettingsSetDomainName
1wizkid 58721b6
Update wslcsdk.h
1wizkid 6e698c3
created asserts to check struct sizes of opaque structures
richfr f6695df
Fix clang formating issues. Make CPU/Mem optional. Formalize Struct a…
richfr 4335008
Update windowsAddress to be a pointer
1wizkid 7f3917b
Apply suggestion from @Copilot
1wizkid 24b7bbb
Remove duplicate include for wslaservice.h
1wizkid 10d9f9e
Fix include statement for WslcsdkPrivate.h
1wizkid aa4026b
Fix typo in WslcSession parameter name
1wizkid 22d0fd1
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 09e7685
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 40313ac
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 48f380d
Fix typo in WslcRegistryAuthenticationInformation struct
1wizkid b1cfe90
Update wslcsdk.h
1wizkid 2b6616f
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid 955b63c
Update wslcsdk.h
1wizkid 75275c3
Change memory parameter type from uint64_t to uint32_t
1wizkid 8384e44
Add port and volume count parameters to settings functions
1wizkid 85147dc
Refactor WslcContainerSettings function declarations
1wizkid dff8058
Update wslcsdk.h
1wizkid f3f5a40
Fix comment to reference WslcImageInfo structures
1wizkid 14f24f5
Clarify stdIOCallback usage in WslcProcessSettingsSetIoCallback
1wizkid 4be983c
Change WslcInstallCallback typedef from VOID to void
1wizkid 119b809
Change WslcStdIOCallback return type to void
1wizkid 870446d
Remove 'const' qualifier from function parameters
1wizkid ccaace4
Change vhdRequirements parameter to const in WslcSDK
1wizkid ea09de4
Change vhdRequirements parameter to const in WslcSessionSettingsSetVHD
1wizkid 59cd91f
Remove 'path' field from WslcVhdRequirements struct
1wizkid 34cc674
Rename WslcContainerSettingsSetVolume to WslcContainerSettingsAddVolume
1wizkid 5a05925
Rename WslcContainerSettingsSetVolume to AddVolume
1wizkid 549af67
Rename WslcContainerSettingsSetVolume to AddVolume
1wizkid adee9ee
Fix formatting and consistency in wslcsdk.cpp
1wizkid 20650ba
Reduce WSLC_SESSION_OPTIONS_SIZE from 88 to 80
1wizkid b7a9ff5
Remove EXTERN_C_START and EXTERN_C_END macros
1wizkid 70c3b6e
Remove unnecessary blank line in wslcsdk.cpp
1wizkid 068946a
Format function signatures for better readability
1wizkid f4c5de8
Clean up code by removing empty lines
1wizkid 5b7a075
Merge branch 'feature/wsl-for-apps' into user/richfr
1wizkid 02ec8b7
Fix enum prefix in WslcContainerNetworkingMode
1wizkid 8da8691
Update src/windows/WslcSDK/WslcsdkPrivate.h
1wizkid 2b1ab12
Update src/windows/WslcSDK/wslcsdk.h
1wizkid 578823a
Update wslcsdk.cpp
1wizkid 122c9b4
Fix enum prefix in WslcContainerNetworkingMode
1wizkid c49495e
Refactor enum and type definitions for consistency
1wizkid b9ae483
Change UINT32 to uint32_t in wslcsdk.cpp
1wizkid 21aa057
Change UINT32 to uint32_t in WslcsdkPrivate.h
1wizkid 631952e
Fix formatting and comments in wslcsdk.h
1wizkid b5bbbbd
Fix formatting and indentation in wslcsdk.h
1wizkid 4cf4682
Merge branch 'feature/wsl-for-apps' into user/richfr
1wizkid 5fb2287
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid ef5d9a3
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid 8b54bf5
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid 186c26f
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid a512f5a
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid baca242
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid 83e3d54
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid fcc1687
Update src/windows/WslcSDK/wslcsdk.h
1wizkid de75b49
Merge branch 'feature/wsl-for-apps' into user/richfr
1wizkid 11b6423
Refactor WslcContainerSettingsSetPortMapping function
1wizkid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| set(SOURCES wslcsdk.cpp) | ||
| set(HEADERS | ||
| wslcsdk.h | ||
| WslcsdkPrivate.h | ||
| ) | ||
|
|
||
| add_library(wslcsdk SHARED ${SOURCES} ${HEADERS} wslcsdk.def) | ||
| set_target_properties(wslcsdk PROPERTIES EXCLUDE_FROM_ALL FALSE) | ||
| add_dependencies(wslcsdk wslaserviceidl) | ||
| target_link_libraries(wslcsdk ${COMMON_LINK_LIBRARIES} legacy_stdio_definitions common) | ||
| target_precompile_headers(wslcsdk REUSE_FROM common) | ||
| set_target_properties(wslcsdk PROPERTIES FOLDER windows) | ||
|
1wizkid marked this conversation as resolved.
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| /*++ | ||
|
|
||
| Copyright (c) Microsoft. All rights reserved. | ||
|
|
||
| Module Name: | ||
|
|
||
| WslcSDKPrivate.h | ||
|
|
||
| Abstract: | ||
|
|
||
| This file contains the private WSL Container SDK definitions. | ||
|
|
||
| --*/ | ||
| #pragma once | ||
| #include <windows.h> | ||
| #include "wslcsdk.h" | ||
|
1wizkid marked this conversation as resolved.
|
||
| #include "wslaservice.h" | ||
| #include <stdint.h> | ||
| #include <wil/com.h> // COM helpers | ||
| // #include <wil/resource.h> // handle wrappers | ||
| // #include <wil/result.h> // error handling | ||
|
|
||
| // SESSION DEFINITIONS | ||
| typedef struct WSLC_SESSION_OPTIONS_INTERNAL | ||
|
1wizkid marked this conversation as resolved.
|
||
| { | ||
| PCWSTR displayName; | ||
| PCWSTR storagePath; | ||
|
|
||
| uint32_t cpuCount; | ||
| uint64_t memoryMb; | ||
| uint32_t timeoutMS; | ||
|
|
||
| WslcVhdRequirements vhdRequirements; | ||
| WslcSessionFlags flags; | ||
| WslcSessionTerminationCallback terminationCallback; | ||
| PVOID terminationCallbackContext; | ||
| } WSLC_SESSION_OPTIONS_INTERNAL; | ||
|
1wizkid marked this conversation as resolved.
|
||
|
|
||
| static_assert(sizeof(WSLC_SESSION_OPTIONS_INTERNAL) == WSLC_SESSION_OPTIONS_SIZE, "WSLC_SESSION_OPTIONS_INTERNAL size mismatch"); | ||
|
|
||
| static_assert( | ||
| __alignof(WSLC_SESSION_OPTIONS_INTERNAL) == WSLC_SESSION_OPTIONS_ALIGNMENT, | ||
| "WSLC_SESSION_OPTIONS_INTERNAL alignment mismatch"); | ||
|
1wizkid marked this conversation as resolved.
|
||
|
|
||
| // PROCESS DEFINITIONS | ||
| typedef struct WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL | ||
| { | ||
| PCSTR executable; // path to executable inside container | ||
| PCSTR* commandLine; | ||
| uint32_t commandLineCount; | ||
| PCSTR* environment; | ||
| uint32_t environmentCount; | ||
| PCSTR currentDirectory; | ||
| } WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL; | ||
|
|
||
| static_assert( | ||
| sizeof(WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL) == WSLC_CONTAINER_PROCESS_OPTIONS_SIZE, | ||
| "WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL must be 48 bytes"); | ||
| static_assert( | ||
| __alignof(WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL) == WSLC_CONTAINER_PROCESS_OPTIONS_ALIGNMENT, | ||
| "WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL must be 8-byte aligned"); | ||
|
|
||
| // CONTAINER DEFINITIONS | ||
| typedef struct WSLC_CONTAINER_OPTIONS_INTERNAL | ||
| { | ||
| PCSTR image; // Image name (repository:tag) | ||
| PCSTR runtimeName; // Container runtime name (expected to allow DNS resolution between containers) | ||
| PCSTR HostName; | ||
| PCSTR DomainName; | ||
|
1wizkid marked this conversation as resolved.
|
||
| const WslcContainerPortMapping* ports; | ||
| uint32_t portsCount; | ||
| const WslcContainerVolume* volumes; | ||
| uint32_t volumesCount; | ||
| const WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL* initProcessOptions; | ||
| WslcContainerNetworkingMode networking; | ||
| WslcContainerFlags containerFlags; | ||
|
|
||
| } WSLC_CONTAINER_OPTIONS_INTERNAL; | ||
| static_assert( | ||
| sizeof(WSLC_CONTAINER_OPTIONS_INTERNAL) == WSLC_CONTAINER_OPTIONS_SIZE, "WSLC_CONTAINER_OPTIONS_INTERNAL must be 80 bytes"); | ||
| static_assert( | ||
| __alignof(WSLC_CONTAINER_OPTIONS_INTERNAL) == WSLC_CONTAINER_OPTIONS_ALIGNMENT, | ||
| "WSLC_CONTAINER_OPTIONS_INTERNAL must be 8-byte aligned"); | ||
|
|
||
| // Use to allocate the actual objects on the heap to keep it alive. | ||
| struct WslcSessionImpl | ||
| { | ||
| wil::com_ptr<IWSLASessionManager> sessionManager; | ||
| }; | ||
|
|
||
| struct WslcContainerImpl | ||
| { | ||
| wil::com_ptr<IWSLAContainer> container; | ||
| }; | ||
|
|
||
| struct WslcProcessImpl | ||
| { | ||
| wil::com_ptr<IWSLAProcess> process; | ||
| }; | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.