Skip to content
Merged
Show file tree
Hide file tree
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 Feb 6, 2026
5076336
Add internal sdk header file
richfr Feb 6, 2026
6802d4f
update primary cmakelists file with wslc sdk build
richfr Feb 6, 2026
9e817fd
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 9, 2026
04b5fa0
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 9, 2026
62b3272
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 9, 2026
9efaa38
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 9, 2026
625b73b
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 9, 2026
94a4450
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 9, 2026
3faa5ea
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 9, 2026
2610162
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 9, 2026
22e8d30
Rename wslcsdkprivate.h to WslcsdkPrivate.h
1wizkid Feb 9, 2026
7334517
Apply suggestion from @Copilot
1wizkid Feb 9, 2026
ca43942
Rename cmakelists.txt to CMakeLists.txt
1wizkid Feb 9, 2026
5fb9c4a
Change WslcSessionInitSettings to return void
1wizkid Feb 9, 2026
4c64c5f
Comment out sessionSettings cast in wslcsdk.cpp
1wizkid Feb 9, 2026
22d2038
Fix parameter annotations in wslcsdk.cpp
1wizkid Feb 9, 2026
73a190c
Rename WslcContainerSettingsRuntimeName function
1wizkid Feb 9, 2026
7583e78
Rename WslcContainerExecProcess to WslcContainerExec
1wizkid Feb 9, 2026
0dd918b
Add signal and timeout parameters to WslcContainerStop
1wizkid Feb 9, 2026
e3980c6
Add flags parameter to WslcContainerDelete function
1wizkid Feb 9, 2026
a48c106
Change argument types in WslcProcessSettingsCmdLineArgs
1wizkid Feb 9, 2026
6396cdb
Change key_value parameter type in WslcProcessSettingsEnvVariables
1wizkid Feb 9, 2026
a8fdba2
Enhance WslcProcessSettingsIoCallback with context
1wizkid Feb 9, 2026
40fb3ae
Update parameter in WslcSessionImageDelete function
1wizkid Feb 9, 2026
ba4a4aa
Fix parameter type for WslcCanRun function
1wizkid Feb 9, 2026
f396db0
Rename WslcContainerExecProcess to WslcContainerExec
1wizkid Feb 9, 2026
40563bd
Apply suggestion from @Copilot
1wizkid Feb 9, 2026
76cc58f
Apply suggestion from @Copilot
1wizkid Feb 9, 2026
fef49e0
Apply suggestion from @Copilot
1wizkid Feb 9, 2026
0535ab5
Apply suggestion from @Copilot
1wizkid Feb 9, 2026
2dcfa36
Added * to structure
1wizkid Feb 9, 2026
3cff6d9
Changes made pased on feedback
richfr Feb 9, 2026
6060dc8
Merge branch 'feature/wsl-for-apps' into user/richfr
1wizkid Feb 9, 2026
125328f
Apply suggestion from @Copilot
1wizkid Feb 9, 2026
3b7ca3d
Replace size and alignment asserts with static_assert
1wizkid Feb 9, 2026
8315464
Apply suggestion from @Copilot
1wizkid Feb 9, 2026
b35f524
Increase WSLC_SESSION_OPTIONS_SIZE from 80 to 88
1wizkid Feb 9, 2026
6ded2a7
Change UINT16 to uint16_t in port mapping struct
1wizkid Feb 9, 2026
15bd767
Fix parameter declaration for WslcContainerSettingsSetHostName
1wizkid Feb 9, 2026
1b870cc
Fix parameter type in WslcContainerSettingsSetHostName
1wizkid Feb 10, 2026
bf4c903
Fix parameter type in WslcContainerSettingsSetDomainName
1wizkid Feb 10, 2026
d469e80
Fix parameter declaration for WslcContainerSettingsSetDomainName
1wizkid Feb 10, 2026
58721b6
Update wslcsdk.h
1wizkid Feb 10, 2026
6e698c3
created asserts to check struct sizes of opaque structures
richfr Feb 9, 2026
f6695df
Fix clang formating issues. Make CPU/Mem optional. Formalize Struct a…
richfr Feb 10, 2026
4335008
Update windowsAddress to be a pointer
1wizkid Feb 11, 2026
7f3917b
Apply suggestion from @Copilot
1wizkid Feb 11, 2026
24b7bbb
Remove duplicate include for wslaservice.h
1wizkid Feb 11, 2026
10d9f9e
Fix include statement for WslcsdkPrivate.h
1wizkid Feb 11, 2026
aa4026b
Fix typo in WslcSession parameter name
1wizkid Feb 11, 2026
22d0fd1
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 11, 2026
09e7685
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 11, 2026
40313ac
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 11, 2026
48f380d
Fix typo in WslcRegistryAuthenticationInformation struct
1wizkid Feb 11, 2026
b1cfe90
Update wslcsdk.h
1wizkid Feb 11, 2026
2b6616f
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid Feb 11, 2026
955b63c
Update wslcsdk.h
1wizkid Feb 11, 2026
75275c3
Change memory parameter type from uint64_t to uint32_t
1wizkid Feb 11, 2026
8384e44
Add port and volume count parameters to settings functions
1wizkid Feb 11, 2026
85147dc
Refactor WslcContainerSettings function declarations
1wizkid Feb 11, 2026
dff8058
Update wslcsdk.h
1wizkid Feb 11, 2026
f3f5a40
Fix comment to reference WslcImageInfo structures
1wizkid Feb 11, 2026
14f24f5
Clarify stdIOCallback usage in WslcProcessSettingsSetIoCallback
1wizkid Feb 11, 2026
4be983c
Change WslcInstallCallback typedef from VOID to void
1wizkid Feb 11, 2026
119b809
Change WslcStdIOCallback return type to void
1wizkid Feb 11, 2026
870446d
Remove 'const' qualifier from function parameters
1wizkid Feb 11, 2026
ccaace4
Change vhdRequirements parameter to const in WslcSDK
1wizkid Feb 11, 2026
ea09de4
Change vhdRequirements parameter to const in WslcSessionSettingsSetVHD
1wizkid Feb 11, 2026
59cd91f
Remove 'path' field from WslcVhdRequirements struct
1wizkid Feb 11, 2026
34cc674
Rename WslcContainerSettingsSetVolume to WslcContainerSettingsAddVolume
1wizkid Feb 11, 2026
5a05925
Rename WslcContainerSettingsSetVolume to AddVolume
1wizkid Feb 11, 2026
549af67
Rename WslcContainerSettingsSetVolume to AddVolume
1wizkid Feb 11, 2026
adee9ee
Fix formatting and consistency in wslcsdk.cpp
1wizkid Feb 11, 2026
20650ba
Reduce WSLC_SESSION_OPTIONS_SIZE from 88 to 80
1wizkid Feb 11, 2026
b7a9ff5
Remove EXTERN_C_START and EXTERN_C_END macros
1wizkid Feb 11, 2026
70c3b6e
Remove unnecessary blank line in wslcsdk.cpp
1wizkid Feb 11, 2026
068946a
Format function signatures for better readability
1wizkid Feb 11, 2026
f4c5de8
Clean up code by removing empty lines
1wizkid Feb 11, 2026
5b7a075
Merge branch 'feature/wsl-for-apps' into user/richfr
1wizkid Feb 11, 2026
02ec8b7
Fix enum prefix in WslcContainerNetworkingMode
1wizkid Feb 11, 2026
8da8691
Update src/windows/WslcSDK/WslcsdkPrivate.h
1wizkid Feb 12, 2026
2b1ab12
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 12, 2026
578823a
Update wslcsdk.cpp
1wizkid Feb 12, 2026
122c9b4
Fix enum prefix in WslcContainerNetworkingMode
1wizkid Feb 12, 2026
c49495e
Refactor enum and type definitions for consistency
1wizkid Feb 12, 2026
b9ae483
Change UINT32 to uint32_t in wslcsdk.cpp
1wizkid Feb 12, 2026
21aa057
Change UINT32 to uint32_t in WslcsdkPrivate.h
1wizkid Feb 12, 2026
631952e
Fix formatting and comments in wslcsdk.h
1wizkid Feb 12, 2026
b5bbbbd
Fix formatting and indentation in wslcsdk.h
1wizkid Feb 12, 2026
4cf4682
Merge branch 'feature/wsl-for-apps' into user/richfr
1wizkid Feb 12, 2026
5fb2287
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid Feb 12, 2026
ef5d9a3
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid Feb 12, 2026
8b54bf5
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid Feb 12, 2026
186c26f
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid Feb 12, 2026
a512f5a
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid Feb 12, 2026
baca242
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid Feb 12, 2026
83e3d54
Update src/windows/WslcSDK/wslcsdk.cpp
1wizkid Feb 12, 2026
fcc1687
Update src/windows/WslcSDK/wslcsdk.h
1wizkid Feb 12, 2026
de75b49
Merge branch 'feature/wsl-for-apps' into user/richfr
1wizkid Feb 12, 2026
11b6423
Refactor WslcContainerSettingsSetPortMapping function
1wizkid Feb 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ add_subdirectory(src/windows/wslinstall)
add_subdirectory(src/windows/wslaclient)
add_subdirectory(src/windows/wsladiag)
add_subdirectory(src/windows/wslc)
add_subdirectory(src/windows/WslcSDK)
Comment thread
1wizkid marked this conversation as resolved.

if (WSL_BUILD_WSL_SETTINGS)
add_subdirectory(src/windows/libwsl)
Expand Down
12 changes: 12 additions & 0 deletions src/windows/WslcSDK/CMakeLists.txt
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)
Comment thread
1wizkid marked this conversation as resolved.
99 changes: 99 additions & 0 deletions src/windows/WslcSDK/WslcsdkPrivate.h
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"
Comment thread
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
Comment thread
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;
Comment thread
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");
Comment thread
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;
Comment thread
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;
};
Loading