-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathWslcsdkPrivate.h
More file actions
93 lines (73 loc) · 2.76 KB
/
WslcsdkPrivate.h
File metadata and controls
93 lines (73 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*++
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"
#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
{
PCWSTR displayName;
PCWSTR storagePath;
uint32_t cpuCount;
uint64_t memoryMb;
uint32_t timeoutMS;
WSLC_VHD_REQUIREMENTS vhdRequirements;
WSLC_SESSION_FLAGS flags;
WslcSessionTerminationCallback terminationCallback;
PVOID terminationCallbackContext;
} WSLC_SESSION_OPTIONS_INTERNAL;
typedef char WSLC_SESSION_OPTIONS_INTERNAL_SIZE_ASSERT[sizeof(WSLC_SESSION_OPTIONS_INTERNAL)];//size = 80
typedef char WSLC_SESSION_OPTIONS_INTERNAL_ALIGNMENT_ASSERT[__alignof(WSLC_SESSION_OPTIONS_INTERNAL)];//alignment = 8
// PROCESS DEFINITIONS
typedef struct WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL
{
PCSTR entryPoint; // path to executable inside container
PCSTR* commandLine;
UINT32 commandLineCount;
PCSTR* environment;
UINT32 environmentCount;
PCSTR currentDirectory;
} WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL;
typedef char WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL_SIZE_ASSERT[sizeof(WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL)]; // size = 48
typedef char WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL_ALIGNMENT_ASSERT[__alignof(WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL)]; // alignment = 8
// 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;
const WSLC_CONTAINER_PORT_MAPPING* ports;
UINT32 portsCount;
const WSLC_CONTAINER_VOLUME* volumes;
UINT32 volumesCount;
const WSLC_CONTAINER_PROCESS_OPTIONS_INTERNAL* initProcessOptions;
WSLC_ContainerNetworkingMode networking;
WSLC_CONTAINER_FLAGS containerFlags;
} WSLC_CONTAINER_OPTIONS_INTERNAL;
typedef char WSLC_CONTAINER_OPTIONS_INTERNAL_SIZE_ASSERT[sizeof(WSLC_CONTAINER_OPTIONS_INTERNAL)]; // size = 80
typedef char WSLC_CONTAINER_OPTIONS_INTERNAL_ALIGNMENT_ASSERT[__alignof(WSLC_CONTAINER_OPTIONS_INTERNAL)]; // alignment = 8
// Use to allocate the actual objects on the heap to keep it alive.
struct WslcSessionImpl
{
wil::com_ptr<IWSLASessionManager> sessionManager;
//wil::com_ptr<IWSLAUserSession> userSession;
//wil::com_ptr<IWSLASession> session;
};
struct WslcContainerImpl
{
wil::com_ptr<IWSLAContainer> container;
};
struct WslcProcessImpl
{
wil::com_ptr<IWSLAProcess> process;
};