Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
as a patch: add COM instance for new lifted WSL service
  • Loading branch information
mintty committed Feb 3, 2022
1 parent d1fa499 commit 2ddd2cd
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 5 deletions.
62 changes: 62 additions & 0 deletions 0002-add-com-for-lifted-wsl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
diff -rup src/sav/GetVmId.cpp src/GetVmId.cpp
--- src/sav/GetVmId.cpp 2021-04-27 13:50:51.000000000 +0000
+++ src/GetVmId.cpp 2022-02-03 19:43:53.684999800 +0000
@@ -46,11 +46,24 @@ void ComInit(void)
EOAC_STATIC_CLOAKING, NULL);
assert(hRes == 0);

- hRes = CoCreateInstance(CLSID_LxssUserSession,
+ // First try with COM server in lifted WSL service
+ hRes = CoCreateInstance(CLSID_WslService,
NULL,
CLSCTX_LOCAL_SERVER,
- IID_ILxssUserSession,
+ IID_IWSLService,
(PVOID *)&wslSession);
+
+
+ // Now try with COM server in system WSL service
+ if (FAILED(hRes))
+ {
+ hRes = CoCreateInstance(CLSID_LxssUserSession,
+ NULL,
+ CLSCTX_LOCAL_SERVER,
+ IID_ILxssUserSession,
+ (PVOID *)&wslSession);
+ }
+
assert(hRes == 0);
}

diff -rup src/sav/LxssUserSession.hpp src/LxssUserSession.hpp
--- src/sav/LxssUserSession.hpp 2021-04-27 13:50:51.000000000 +0000
+++ src/LxssUserSession.hpp 2022-02-03 19:45:22.846298200 +0000
@@ -11,14 +11,26 @@
#ifndef LXSSUSERSESSION_H
#define LXSSUSERSESSION_H

-/* Class identifier */
+// COM IDs for lifted WSL service
+static const GUID CLSID_WslService = {
+ 0xF122531F,
+ 0x326B,
+ 0x4514,
+ { 0x85, 0xAE, 0xDC, 0x99, 0xD3, 0x1D, 0x82, 0x56 } };
+
+static const GUID IID_IWSLService = {
+ 0x50047071,
+ 0x122C,
+ 0x4CAD,
+ { 0x9C, 0x93, 0x94, 0x72, 0x0E, 0xB7, 0x7B, 0x06 } };
+
+// COM IDs for system WSL service
static const GUID CLSID_LxssUserSession = {
0x4F476546,
0xB412,
0x4579,
{ 0xB6, 0x4C, 0x12, 0x3D, 0xF3, 0x31, 0xE3, 0xD6 } };

-/* Interface identifier */
static const GUID IID_ILxssUserSession = {
0x536A6BCF,
0xFE04,
2 changes: 1 addition & 1 deletion LICENSE.mintty
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mintty is copyright 2008-13 Andy Koppe, 2015-18 Thomas Wolff.
mintty is copyright 2008-13 Andy Koppe, 2015-22 Thomas Wolff.

Licensed under the terms of the GNU General Public License version 3 or later,
amended with the bundling clause to clarify ambiguous interpretation.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.1
3.5.3
8 changes: 5 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@


# wsltty release
ver=3.5.1
ver=3.5.3

# wsltty appx release - must have 4 parts!
verx=3.5.1.1
verx=3.5.3.0


##############################
# mintty release version

minttyver=3.5.1
minttyver=3.5.3

##############################

Expand Down Expand Up @@ -150,6 +150,8 @@ wslbridge-source: $(wslbridgedir).zip
cp $(wslbridgedir)/LICENSE LICENSE.wslbridge2
# patch
cd $(wslbridgedir); patch -p1 < ../0001-notify-size-change-inband.patch
# patch to https://github.com/Biswa96/wslbridge2/commit/41575379b416703c49e2687e957440239a4cdfb7
cd $(wslbridgedir); patch -p0 < ../0002-add-com-for-lifted-wsl.patch

wslbridge-frontend: wslbridge-source
echo ------------- Compiling wslbridge2 frontend
Expand Down

0 comments on commit 2ddd2cd

Please sign in to comment.