mirror of https://github.com/microsoft/WSL
Spelling (#12954)
* link: Collect WSL logs (recommended method) Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * link: Advanced Authoring Tests in C++ Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * link: CMake Documentation and Community Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * link: Collect WSL logs for networking issues Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * link: Collect WSL logs (recommended method) Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: ; otherwise, Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: a Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: access Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: accessible Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: across Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: actively Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: adapters Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: address Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: addresses Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: and Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: appropriate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: argument Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: associated Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: attach Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: available Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: beginning Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: between Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: binaries Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: bound Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: buffer Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: buffers Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: cannot Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: canonical Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: capabilities Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: case-insensitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: case-sensitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: certified Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: command Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: committer Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: communication Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: complains Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: configuration Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: consumed Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: continue Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: converted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: currently Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: customers Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: daemon Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: deferred Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: definitions Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: delimiter Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: delivered Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dellink Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: derived Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: descriptor Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: destined Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: destruct Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: destructible Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: destructor Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: detach Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: differentiate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: directories Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: disassociate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: disposition Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: distribution Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: distro Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: duping Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: emitted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: empty Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: environment Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: every time Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: exclusive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: expected Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: expire Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: explicitly Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: fall back Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: false Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: fastfail Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: filesystem Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: first Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: followed Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: for Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: functionality Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: functionally Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: github Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: greater Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: guarantee Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: guaranteed Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: handles Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: hangup Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: hierarchy Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: hogwarts Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: hydrated Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: icrnl Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: implementation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: implementing Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: initialize Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: instance Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: instantiate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: instantiations Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: intentionally Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: interpret Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: interpreter Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: irreversibly Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: iteration Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: iterator Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: its Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: kernel Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: kmsg Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: knowledge Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: maximum Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: mirrored Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: msftconnecttest Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: multi Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: multiple Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: mutable Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: namespace Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: nonexistent Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: notifications Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: occurred Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: occurring Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: otherwise, Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: outstanding Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: overridden Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: partition Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: pass through Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: passthrough Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: performs Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: periodically Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: positional Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: precedence Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: preexisting Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: preferring Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: prepopulate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: previous Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: privileges Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: process Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: processes Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: programmatically Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: protection Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: provided Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: reasonable Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: receive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: received Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: red hat Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: reentrant Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: registered Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: regularly Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: relay Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: release Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: representing Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: requests Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: response Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: resurrect Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: retention Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: returned Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: security Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: semaphore Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: separate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: separator Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: service Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: set up Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: setup Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: severely Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: should Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: signal Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: similarly Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: simple Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: simplified Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: single Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: specified Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: splitting Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: standard Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: stress Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: succeed Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: success Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: successfully Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: supplementary Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: synced Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: system Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: take Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: than Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: that opening Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: the Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: threadpool Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: to Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: true Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: truncate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: tunneling Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: unexpected Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: uninitialize Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: unique Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: unprivileged Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: unregistered Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: untrusted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: upgrade Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: utility Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: validating Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: variant Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: variation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: variations Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: verify Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: visible Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: whether Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: winget Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: worker Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: written Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: wslservice Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * format source --------- Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Ben Hillis <benhillis@gmail.com> Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
This commit is contained in:
parent
cefe0cdcc1
commit
abce91d14b
|
|
@ -184,10 +184,10 @@ configuration:
|
||||||
The scipt will output the path of the log file once done.
|
The scipt will output the path of the log file once done.
|
||||||
|
|
||||||
|
|
||||||
Once completed please upload the output files to this Github issue.
|
Once completed please upload the output files to this GitHub issue.
|
||||||
|
|
||||||
|
|
||||||
[Click here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) for more info on logging
|
See [Collect WSL logs (recommended method)](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method).
|
||||||
|
|
||||||
|
|
||||||
If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue.
|
If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue.
|
||||||
|
|
@ -229,10 +229,10 @@ configuration:
|
||||||
The scipt will output the path of the log file once done.
|
The scipt will output the path of the log file once done.
|
||||||
|
|
||||||
|
|
||||||
Once completed please upload the output files to this Github issue.
|
Once completed please upload the output files to this GitHub issue.
|
||||||
|
|
||||||
|
|
||||||
[Click here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) for more info on logging
|
See [Collect WSL logs (recommended method)](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method).
|
||||||
|
|
||||||
|
|
||||||
Thank you!
|
Thank you!
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
name: Publish to Winget
|
name: Publish to WinGet
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ stages:
|
||||||
workingDirectory: "."
|
workingDirectory: "."
|
||||||
cmakeArgs: . --fresh -A ${{ platform }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_VERSION=10.0.26100.0 -DPACKAGE_VERSION=$(version.WSL_PACKAGE_VERSION) -DWSL_NUGET_PACKAGE_VERSION=$(version.WSL_NUGET_PACKAGE_VERSION) -DSKIP_PACKAGE_SIGNING=${{ parameters.isRelease }} -DOFFICIAL_BUILD=${{ parameters.isRelease }} -DPIPELINE_BUILD_ID=$(Build.BuildId) -DVSO_ORG=${{ parameters.vsoOrg }} -DVSO_PROJECT=${{ parameters.vsoProject }} -DWSL_BUILD_WSL_SETTINGS=true
|
cmakeArgs: . --fresh -A ${{ platform }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_VERSION=10.0.26100.0 -DPACKAGE_VERSION=$(version.WSL_PACKAGE_VERSION) -DWSL_NUGET_PACKAGE_VERSION=$(version.WSL_NUGET_PACKAGE_VERSION) -DSKIP_PACKAGE_SIGNING=${{ parameters.isRelease }} -DOFFICIAL_BUILD=${{ parameters.isRelease }} -DPIPELINE_BUILD_ID=$(Build.BuildId) -DVSO_ORG=${{ parameters.vsoOrg }} -DVSO_PROJECT=${{ parameters.vsoProject }} -DWSL_BUILD_WSL_SETTINGS=true
|
||||||
|
|
||||||
# This additional Restore NuGet package task is added as a workaround for WSL Settings to have its' packages restored properly.
|
# This additional Restore NuGet package task is added as a workaround for WSL Settings to have its packages restored properly.
|
||||||
# Without this, building wsl settings may encounter the following error:
|
# Without this, building wsl settings may encounter the following error:
|
||||||
#
|
#
|
||||||
# The plugin credential provider could not acquire credentials. Authentication may require manual action.
|
# The plugin credential provider could not acquire credentials. Authentication may require manual action.
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ stages:
|
||||||
zipPath: $(StoreBrokerPayloadPath)\WindowsSubsystemForLinux.zip
|
zipPath: $(StoreBrokerPayloadPath)\WindowsSubsystemForLinux.zip
|
||||||
force: true
|
force: true
|
||||||
skipPolling: true # skips polling Partner Centre/store API for the state of the package; skipping will mean that errors in the process will only show up in Partner Center
|
skipPolling: true # skips polling Partner Centre/store API for the state of the package; skipping will mean that errors in the process will only show up in Partner Center
|
||||||
targetPublishMode: Immediate # on completion of this task, the package will be published to the WSL SelfHost flight once ceritified (no manual clicking of any buttons in Partner Center)
|
targetPublishMode: Immediate # on completion of this task, the package will be published to the WSL SelfHost flight once certified (no manual clicking of any buttons in Partner Center)
|
||||||
preserveSubmissionId: false
|
preserveSubmissionId: false
|
||||||
deletePackages: true
|
deletePackages: true
|
||||||
numberOfPackagesToKeep: 0
|
numberOfPackagesToKeep: 0
|
||||||
|
|
@ -115,6 +115,6 @@ stages:
|
||||||
pip install --user -r tools/devops/requirements.txt
|
pip install --user -r tools/devops/requirements.txt
|
||||||
python tools/devops/create-release.py '${{ parameters.packageVersion }}' drop\bundle\Microsoft.WSL_${{ parameters.packageVersion }}.0_x64_ARM64.msixbundle drop\bundle\wsl.${{ parameters.packageVersion }}.0.arm64.msi drop\bundle\wsl.${{ parameters.packageVersion }}.0.x64.msi --no-fetch --github-token "$env:token" ${{ iif(parameters.publishPackage, '--publish --auto-release-notes', '--use-current-ref') }}
|
python tools/devops/create-release.py '${{ parameters.packageVersion }}' drop\bundle\Microsoft.WSL_${{ parameters.packageVersion }}.0_x64_ARM64.msixbundle drop\bundle\wsl.${{ parameters.packageVersion }}.0.arm64.msi drop\bundle\wsl.${{ parameters.packageVersion }}.0.x64.msi --no-fetch --github-token "$env:token" ${{ iif(parameters.publishPackage, '--publish --auto-release-notes', '--use-current-ref') }}
|
||||||
|
|
||||||
displayName: Create Github release
|
displayName: Create GitHub release
|
||||||
env:
|
env:
|
||||||
token: $(GITHUB_RELEASE_TOKEN)
|
token: $(GITHUB_RELEASE_TOKEN)
|
||||||
|
|
@ -19,7 +19,7 @@ You can file issues for WSL at the WSL repository, or linked repositories. Befor
|
||||||
|
|
||||||
1. If your issue is related to WSL documentation, please file it at [microsoftdocs/wsl](https://github.com/microsoftdocs/WSL/issues)
|
1. If your issue is related to WSL documentation, please file it at [microsoftdocs/wsl](https://github.com/microsoftdocs/WSL/issues)
|
||||||
2. If your issue is related to a Linux GUI app, please file it at [microsoft/wslg](https://github.com/microsoft/wslg/issues)
|
2. If your issue is related to a Linux GUI app, please file it at [microsoft/wslg](https://github.com/microsoft/wslg/issues)
|
||||||
3. Otherwise if you have a technical issue related to WSL in general, such as start up issues, etc., please file it at [microsoft/wsl](https://github.com/microsoft/WSL/issues)
|
3. Otherwise, if you have a technical issue related to WSL in general, such as start up issues, etc., please file it at [microsoft/wsl](https://github.com/microsoft/WSL/issues)
|
||||||
|
|
||||||
Please provide as much information as possible when reporting a bug or filing an issue on the Windows Subsystem for Linux, and be sure to include logs as necessary!
|
Please provide as much information as possible when reporting a bug or filing an issue on the Windows Subsystem for Linux, and be sure to include logs as necessary!
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@ After reboot, the kernel dump will be in `%SystemRoot%\MEMORY.DMP` (unless this
|
||||||
Please send this dump to: secure@microsoft.com .
|
Please send this dump to: secure@microsoft.com .
|
||||||
Make sure that the email body contains:
|
Make sure that the email body contains:
|
||||||
|
|
||||||
- The Github issue number, if any
|
- The GitHub issue number, if any
|
||||||
- That this dump is intended for the WSL team
|
- That this dump is intended for the WSL team
|
||||||
|
|
||||||
### 11) Reporting a WSL process crash
|
### 11) Reporting a WSL process crash
|
||||||
|
|
|
||||||
|
|
@ -12,21 +12,21 @@
|
||||||
<Provider Type="VSODrop">
|
<Provider Type="VSODrop">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Add Name="CloudTest.ProviderCustomName" Value="[test_distro]" />
|
<Add Name="CloudTest.ProviderCustomName" Value="[test_distro]" />
|
||||||
<!-- When updating the drops for this make sure the rentention is set to never expire -->
|
<!-- When updating the drops for this make sure the retention is set to never expire -->
|
||||||
<Add Name="DropURL" Value="https://${VSO_ORG}.artifacts.visualstudio.com/_apis/drop/drops/WSL/${CLOUDTEST_TEST_DISTRO_DROP}"/>
|
<Add Name="DropURL" Value="https://${VSO_ORG}.artifacts.visualstudio.com/_apis/drop/drops/WSL/${CLOUDTEST_TEST_DISTRO_DROP}"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Provider>
|
</Provider>
|
||||||
<Provider Type="VSODrop">
|
<Provider Type="VSODrop">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Add Name="CloudTest.ProviderCustomName" Value="[test_packages]" />
|
<Add Name="CloudTest.ProviderCustomName" Value="[test_packages]" />
|
||||||
<!-- When updating the drops for this make sure the rentention is set to never expire -->
|
<!-- When updating the drops for this make sure the retention is set to never expire -->
|
||||||
<Add Name="DropURL" Value="https://${VSO_ORG}.artifacts.visualstudio.com/_apis/drop/drops/WSL/${CLOUDTEST_TEST_PACKAGES}"/>
|
<Add Name="DropURL" Value="https://${VSO_ORG}.artifacts.visualstudio.com/_apis/drop/drops/WSL/${CLOUDTEST_TEST_PACKAGES}"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Provider>
|
</Provider>
|
||||||
<Provider Type="VSODrop">
|
<Provider Type="VSODrop">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Add Name="CloudTest.ProviderCustomName" Value="[dump_tool]" />
|
<Add Name="CloudTest.ProviderCustomName" Value="[dump_tool]" />
|
||||||
<!-- When updating the drops for this make sure the rentention is set to never expire -->
|
<!-- When updating the drops for this make sure the retention is set to never expire -->
|
||||||
<Add Name="DropURL" Value="https://${VSO_ORG}.artifacts.visualstudio.com/_apis/drop/drops/WSL/${DUMPTOOL_DROP}"/>
|
<Add Name="DropURL" Value="https://${VSO_ORG}.artifacts.visualstudio.com/_apis/drop/drops/WSL/${DUMPTOOL_DROP}"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Provider>
|
</Provider>
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ sequenceDiagram
|
||||||
|
|
||||||
## CreateInstance()
|
## CreateInstance()
|
||||||
|
|
||||||
When [wslervice.exe](wslservice.exe.md) receives the CreateInstance() call via COM, it will:
|
When [wslservice.exe](wslservice.exe.md) receives the CreateInstance() call via COM, it will:
|
||||||
|
|
||||||
1) Identify which distribution the user wants to create. This is done by looking up the `DistributionRegistration` (see `src/windows/service/exe/DistributionRegistration.cpp`) in the Windows registry, matching either on the distribution ID, or using the default if none is provided.
|
1) Identify which distribution the user wants to create. This is done by looking up the `DistributionRegistration` (see `src/windows/service/exe/DistributionRegistration.cpp`) in the Windows registry, matching either on the distribution ID, or using the default if none is provided.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ When a Linux process is created, [wslservice.exe](wslservice.exe.md) determines
|
||||||
|
|
||||||
*Note: This section only applies to WSL2 distributions. *
|
*Note: This section only applies to WSL2 distributions. *
|
||||||
|
|
||||||
When a [session leader](session-leader.md) is created, [wslsevice.exe](wslservice.exe.md) starts a [plan9](https://9fans.github.io/plan9port/man/man9/intro.html) file server. This file server can be connected to from the WSL2 virtual machine to mount Windows drives.
|
When a [session leader](session-leader.md) is created, [wslservice.exe](wslservice.exe.md) starts a [plan9](https://9fans.github.io/plan9port/man/man9/intro.html) file server. This file server can be connected to from the WSL2 virtual machine to mount Windows drives.
|
||||||
|
|
||||||
When the WSL distribution is created, [wslservice.exe](wslservice.exe.md) uses the `LX_INIT_CONFIGURATION_INFORMATION` message to indicate wether the process that created the distribution is elevated or not. Based on this, [init](init.md) will mount either or the elevated, or un-elevated version of the plan9 server.
|
When the WSL distribution is created, [wslservice.exe](wslservice.exe.md) uses the `LX_INIT_CONFIGURATION_INFORMATION` message to indicate whether the process that created the distribution is elevated or not. Based on this, [init](init.md) will mount either or the elevated, or un-elevated version of the plan9 server.
|
||||||
|
|
||||||
Later when the first command is created in the namespace that hasn't been mounted yet, (either elevated, or non-elevated), [wslservice.exe](wslservice.exe.md) sends a `LxInitMessageRemountDrvfs` to [init](init.md), which tell `init` to mount the other namespace.
|
Later when the first command is created in the namespace that hasn't been mounted yet, (either elevated, or non-elevated), [wslservice.exe](wslservice.exe.md) sends a `LxInitMessageRemountDrvfs` to [init](init.md), which tell `init` to mount the other namespace.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,4 @@ When systemd is enabled, WSL tries synchronizes launching processes with systemd
|
||||||
To improve compatibility with systemd, WSL creates various systemd configuration files during boot (under `/run`). These configurations files are used to:
|
To improve compatibility with systemd, WSL creates various systemd configuration files during boot (under `/run`). These configurations files are used to:
|
||||||
|
|
||||||
- Protect the WSL [binfmt interpret](interop.md) from being deleted by `systemd-binfmt.service`
|
- Protect the WSL [binfmt interpret](interop.md) from being deleted by `systemd-binfmt.service`
|
||||||
- Protect the X11 socket from being deleted by `systemd-tmpfiles.serviceè
|
- Protect the X11 socket from being deleted by `systemd-tmpfiles-setup.service`
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
<string id="NestedVirtualizationExplain">When set to disabled, this policy disables nested virtualization configuration via .wslconfig (wsl2.nestedVirtualization). This policy only applies to Store WSL.</string>
|
<string id="NestedVirtualizationExplain">When set to disabled, this policy disables nested virtualization configuration via .wslconfig (wsl2.nestedVirtualization). This policy only applies to Store WSL.</string>
|
||||||
|
|
||||||
<string id="KernelDebugUserSettingConfigurable">Allow kernel debugging</string>
|
<string id="KernelDebugUserSettingConfigurable">Allow kernel debugging</string>
|
||||||
<string id="KernelDebugExplain">When set to disabled, this policy disables kernel kernel debugging configuration via .wslconfig (wsl2.kernelDebugPort). This policy only applies to Store WSL.</string>
|
<string id="KernelDebugExplain">When set to disabled, this policy disables kernel debugging configuration via .wslconfig (wsl2.kernelDebugPort). This policy only applies to Store WSL.</string>
|
||||||
|
|
||||||
<string id="CustomNetworkingUserSettingConfigurable">Allow custom networking configuration</string>
|
<string id="CustomNetworkingUserSettingConfigurable">Allow custom networking configuration</string>
|
||||||
<string id="CustomNetworkingExplain">When set to disabled, this policy disables custom networking configuration via .wslconfig (wsl2.networkingmode). This policy only applies to Store WSL.</string>
|
<string id="CustomNetworkingExplain">When set to disabled, this policy disables custom networking configuration via .wslconfig (wsl2.networkingmode). This policy only applies to Store WSL.</string>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<add key="WSL" value="https://pkgs.dev.azure.com/shine-oss/wsl/_packaging/WslDependencies/nuget/v3/index.json" />
|
<add key="WSL" value="https://pkgs.dev.azure.com/shine-oss/wsl/_packaging/WslDependencies/nuget/v3/index.json" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<disabledPackageSources>
|
<disabledPackageSources>
|
||||||
<!-- Override any User and Computer NuGet package settings to gurantee
|
<!-- Override any User and Computer NuGet package settings to guarantee
|
||||||
Project only (above sources) are enabled and the only ones present. -->
|
Project only (above sources) are enabled and the only ones present. -->
|
||||||
<clear />
|
<clear />
|
||||||
</disabledPackageSources>
|
</disabledPackageSources>
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ try
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop tracking the request, irrespective of the DNS response being succesfully sent
|
// Stop tracking the request, irrespective of the DNS response being successfully sent
|
||||||
const auto removeDnsRequest = wil::scope_exit([&] { m_udpRequests.erase(dnsClientIdentifier.DnsClientId); });
|
const auto removeDnsRequest = wil::scope_exit([&] { m_udpRequests.erase(dnsClientIdentifier.DnsClientId); });
|
||||||
|
|
||||||
sockaddr_in& remoteAddr = it->second;
|
sockaddr_in& remoteAddr = it->second;
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ void DnsTunnelingChannel::ReceiveLoop() noexcept
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the message type from the the message header
|
// Get the message type from the message header
|
||||||
switch (message->MessageType)
|
switch (message->MessageType)
|
||||||
{
|
{
|
||||||
case LxGnsMessageDnsTunneling:
|
case LxGnsMessageDnsTunneling:
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ Interface GnsEngine::OpenAdapterImpl(const GUID& id)
|
||||||
if (adapterId.has_value() && adapterId.value() == id)
|
if (adapterId.has_value() && adapterId.value() == id)
|
||||||
{
|
{
|
||||||
interfaceName = e.path().filename().string();
|
interfaceName = e.path().filename().string();
|
||||||
// Special case _wlanxx interfaces: look for the the wlanxx version instead.
|
// Special case _wlanxx interfaces: look for the wlanxx version instead.
|
||||||
if (interfaceName.compare(0, 5, "_wlan") == 0)
|
if (interfaceName.compare(0, 5, "_wlan") == 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -785,7 +785,7 @@ Arguments:
|
||||||
|
|
||||||
MessageType - Supplies the message type.
|
MessageType - Supplies the message type.
|
||||||
|
|
||||||
Argc - Supplies the command line agrument count.
|
Argc - Supplies the command line argument count.
|
||||||
|
|
||||||
Argv - Supplies the command line arguments.
|
Argv - Supplies the command line arguments.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@ Abstract:
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
//
|
//
|
||||||
// Name of the WSL binfmt_misc intrepreter.
|
// Name of the WSL binfmt_misc interpreter.
|
||||||
//
|
//
|
||||||
|
|
||||||
#define LX_INIT_BINFMT_NAME "WSLInterop"
|
#define LX_INIT_BINFMT_NAME "WSLInterop"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Name of the WSL 'late' binfmt_misc intrepreter.
|
// Name of the WSL 'late' binfmt_misc interpreter.
|
||||||
// This name is used by the wsl-binfmt systemd unit which
|
// This name is used by the wsl-binfmt systemd unit which
|
||||||
// registers the interpreter a second time after systemd-binfmt to make sure
|
// registers the interpreter a second time after systemd-binfmt to make sure
|
||||||
// that wsl's interpreter is always registered last.
|
// that wsl's interpreter is always registered last.
|
||||||
|
|
|
||||||
|
|
@ -854,7 +854,7 @@ try
|
||||||
|
|
||||||
if (WI_IsFlagSet(Config.FeatureFlags.value(), LxInitFeatureRootfsCompressed))
|
if (WI_IsFlagSet(Config.FeatureFlags.value(), LxInitFeatureRootfsCompressed))
|
||||||
{
|
{
|
||||||
LOG_WARNING("{} root file system is compressed, performance may be severly impacted.", DistributionName);
|
LOG_WARNING("{} root file system is compressed, performance may be severely impacted.", DistributionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -1967,7 +1967,7 @@ try
|
||||||
// Initialize the mount options.
|
// Initialize the mount options.
|
||||||
//
|
//
|
||||||
// N.B. If the options weren't specified, ConfigDrvFsOptions will be an
|
// N.B. If the options weren't specified, ConfigDrvFsOptions will be an
|
||||||
// emptry string. Since DrvFs ignores empty mount options, the extra
|
// empty string. Since DrvFs ignores empty mount options, the extra
|
||||||
// comma on the end in that case is not a problem.
|
// comma on the end in that case is not a problem.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
@ -2454,7 +2454,7 @@ Arguments:
|
||||||
|
|
||||||
Return Value:
|
Return Value:
|
||||||
|
|
||||||
The file descriptor represending the mount namespace on soccess, -1 on failure.
|
The file descriptor representing the mount namespace on success, -1 on failure.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
|
|
||||||
|
|
@ -2505,7 +2505,7 @@ try
|
||||||
// Attempt to open the /etc/default/locale file. If the file does not exist
|
// Attempt to open the /etc/default/locale file. If the file does not exist
|
||||||
// then the $LANG environment variable will not be updated.
|
// then the $LANG environment variable will not be updated.
|
||||||
//
|
//
|
||||||
// N.B. This file is being opened by root. The only user-visable content
|
// N.B. This file is being opened by root. The only user-visible content
|
||||||
// will be the contents of the last line of the file that contains
|
// will be the contents of the last line of the file that contains
|
||||||
// "LANG=".
|
// "LANG=".
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,7 @@ try
|
||||||
// For virtio-9p, there are two errors that could indicate the PCI device is not ready:
|
// For virtio-9p, there are two errors that could indicate the PCI device is not ready:
|
||||||
// EBUSY - Returned if all devices with the tag are already in use.
|
// EBUSY - Returned if all devices with the tag are already in use.
|
||||||
// ENOENT - Returned if there are no devices with the tag, which can happen after the VM first boots.
|
// ENOENT - Returned if there are no devices with the tag, which can happen after the VM first boots.
|
||||||
// In this case, check if the the target exists; if it doesn't, ENOENT is for that and there's no reason to retry.
|
// In this case, check if the target exists; if it doesn't, ENOENT is for that and there's no reason to retry.
|
||||||
//
|
//
|
||||||
// For virtiofs, EINVAL will be returned if the tag is not ready.
|
// For virtiofs, EINVAL will be returned if the tag is not ready.
|
||||||
auto savedErrno = wil::ResultFromCaughtException();
|
auto savedErrno = wil::ResultFromCaughtException();
|
||||||
|
|
@ -336,7 +336,7 @@ try
|
||||||
return MountFilesystem(DRVFS_FS_TYPE, Source, Target, Options, ExitCode);
|
return MountFilesystem(DRVFS_FS_TYPE, Source, Target, Options, ExitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use virtiofs if the source of the mount is the root of a drive, otherwise use 9p.
|
// Use virtiofs if the source of the mount is the root of a drive; otherwise, use 9p.
|
||||||
if (WSL_USE_VIRTIO_FS(Config))
|
if (WSL_USE_VIRTIO_FS(Config))
|
||||||
{
|
{
|
||||||
if (wsl::shared::string::IsDriveRoot(Source))
|
if (wsl::shared::string::IsDriveRoot(Source))
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,7 @@ ExecStart=/bin/mount -o bind,ro,X-mount.mkdir -t none /mnt/wslg/.X11-unix /tmp/.
|
||||||
{
|
{
|
||||||
// N.B. ExecStop is required to prevent distributions from removing the WSL binfmt entry on shutdown.
|
// N.B. ExecStop is required to prevent distributions from removing the WSL binfmt entry on shutdown.
|
||||||
auto systemdBinfmtContent = std::format(
|
auto systemdBinfmtContent = std::format(
|
||||||
R"(# Note: This file is generated by WSL to prevent binfmt.d from overriding WSL's binfmt interpretor.
|
R"(# Note: This file is generated by WSL to prevent binfmt.d from overriding WSL's binfmt interpreter.
|
||||||
# To disable this unit, add the following to /etc/wsl.conf:
|
# To disable this unit, add the following to /etc/wsl.conf:
|
||||||
# [boot]
|
# [boot]
|
||||||
# protectBinfmt=false
|
# protectBinfmt=false
|
||||||
|
|
@ -1821,7 +1821,7 @@ Return Value:
|
||||||
if (BytesWritten < 0)
|
if (BytesWritten < 0)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// If writing on stdin's pipe would block, mark the write as pending an continue.
|
// If writing on stdin's pipe would block, mark the write as pending and continue.
|
||||||
// This is required blocking on the write() could lead to a deadlock if the child process
|
// This is required blocking on the write() could lead to a deadlock if the child process
|
||||||
// is blocking trying to write on stderr / stdout while the relay tries to write stdin.
|
// is blocking trying to write on stderr / stdout while the relay tries to write stdin.
|
||||||
//
|
//
|
||||||
|
|
@ -2318,7 +2318,7 @@ Return Value:
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize distro init agruments and environment.
|
// Initialize distro init arguments and environment.
|
||||||
//
|
//
|
||||||
|
|
||||||
auto InitializeStringVector = [&](std::vector<const char*>& PointerVector,
|
auto InitializeStringVector = [&](std::vector<const char*>& PointerVector,
|
||||||
|
|
@ -2685,7 +2685,7 @@ Routine Description:
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
Config - Supplies the distribution configuraiton.
|
Config - Supplies the distribution configuration.
|
||||||
|
|
||||||
Return Value:
|
Return Value:
|
||||||
|
|
||||||
|
|
@ -2845,7 +2845,7 @@ Return Value:
|
||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
// N.B. SIGTTOU along with most other signals are blocked, otherwise
|
// N.B. SIGTTOU along with most other signals are blocked. Otherwise,
|
||||||
// this could generate a signal with the default behavior of
|
// this could generate a signal with the default behavior of
|
||||||
// stopping the process (waiting for SIGCONT to continue).
|
// stopping the process (waiting for SIGCONT to continue).
|
||||||
//
|
//
|
||||||
|
|
@ -3343,7 +3343,7 @@ void WaitForBootProcess(wsl::linux::WslDistributionConfig& Config)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Launch the boot process wait for for it to finish booting.
|
// Launch the boot process wait for it to finish booting.
|
||||||
//
|
//
|
||||||
|
|
||||||
MESSAGE_HEADER Message{};
|
MESSAGE_HEADER Message{};
|
||||||
|
|
|
||||||
|
|
@ -319,7 +319,7 @@ bool IsSameSockAddr(const sockaddr_storage& left, const sockaddr_storage& right)
|
||||||
// Start looking for ports bound to localhost or wildcard.
|
// Start looking for ports bound to localhost or wildcard.
|
||||||
int ScanProcNetTCP(wsl::shared::SocketChannel& channel)
|
int ScanProcNetTCP(wsl::shared::SocketChannel& channel)
|
||||||
{
|
{
|
||||||
// Peridocally scan procfs for listening TCP sockets.
|
// Periodically scan procfs for listening TCP sockets.
|
||||||
std::vector<sockaddr_storage> relays{};
|
std::vector<sockaddr_storage> relays{};
|
||||||
int result = 0;
|
int result = 0;
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|
|
||||||
|
|
@ -762,7 +762,7 @@ void EnableCrashDumpCollection()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the first character is a pipe, then the kernel will interperet this path as a command.
|
// If the first character is a pipe, then the kernel will interpret this path as a command.
|
||||||
constexpr auto core_pattern = "|/" LX_INIT_WSL_CAPTURE_CRASH " %t %E %p %s";
|
constexpr auto core_pattern = "|/" LX_INIT_WSL_CAPTURE_CRASH " %t %E %p %s";
|
||||||
WriteToFile("/proc/sys/kernel/core_pattern", core_pattern);
|
WriteToFile("/proc/sys/kernel/core_pattern", core_pattern);
|
||||||
}
|
}
|
||||||
|
|
@ -1745,7 +1745,7 @@ try
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set the communicaiton channel to expected file descriptor value.
|
// Set the communication channel to expected file descriptor value.
|
||||||
//
|
//
|
||||||
|
|
||||||
if (SocketFd != LX_INIT_UTILITY_VM_INIT_SOCKET_FD)
|
if (SocketFd != LX_INIT_UTILITY_VM_INIT_SOCKET_FD)
|
||||||
|
|
@ -1779,7 +1779,7 @@ try
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Creating the temporary mount can fail if:
|
// Creating the temporary mount can fail if:
|
||||||
// - The distro VHD was mounted read-only (because an fsck is needed)
|
// - The distro VHD was mounted read-only (because a fsck is needed)
|
||||||
// - The distro VHD is full
|
// - The distro VHD is full
|
||||||
//
|
//
|
||||||
// Mount a writable overlay if that's the case so the distro can start.
|
// Mount a writable overlay if that's the case so the distro can start.
|
||||||
|
|
@ -1873,7 +1873,7 @@ try
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Bind mount the init deamon into the distro namespace.
|
// Bind mount the init daemon into the distro namespace.
|
||||||
//
|
//
|
||||||
|
|
||||||
auto Path = std::format("{}{}", Target, LX_INIT_PATH);
|
auto Path = std::format("{}{}", Target, LX_INIT_PATH);
|
||||||
|
|
@ -2107,7 +2107,7 @@ try
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Mount to a temporary location if overlayfs was requested, otherwise mount
|
// Mount to a temporary location if overlayfs was requested; otherwise, mount
|
||||||
// the device directly on the target.
|
// the device directly on the target.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
@ -2260,7 +2260,7 @@ Return Value:
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Chroot to system system distro mount point.
|
// Chroot to system distro mount point.
|
||||||
//
|
//
|
||||||
// N.B. This allows running binaries present in the system distro without having to chroot.
|
// N.B. This allows running binaries present in the system distro without having to chroot.
|
||||||
//
|
//
|
||||||
|
|
@ -2362,7 +2362,7 @@ try
|
||||||
auto* DeviceName = &DevicePath[sizeof(DEVFS_PATH)];
|
auto* DeviceName = &DevicePath[sizeof(DEVFS_PATH)];
|
||||||
|
|
||||||
//
|
//
|
||||||
// Find the partion on the specified device.
|
// Find the partition on the specified device.
|
||||||
//
|
//
|
||||||
// N.B. A retry is needed because there is a delay between when a device is
|
// N.B. A retry is needed because there is a delay between when a device is
|
||||||
// hot-added, and when the device is available in the guest.
|
// hot-added, and when the device is available in the guest.
|
||||||
|
|
@ -2492,7 +2492,7 @@ void ProcessLaunchInitMessage(
|
||||||
//
|
//
|
||||||
// Allow /etc/wsl.conf in the user distro to opt-out of GUI support.
|
// Allow /etc/wsl.conf in the user distro to opt-out of GUI support.
|
||||||
//
|
//
|
||||||
// N.B. A connection for the system disto must established even if the distro opts out
|
// N.B. A connection for the system distro must established even if the distro opts out
|
||||||
// of GUI app support because WslService is waiting to accept a connection.
|
// of GUI app support because WslService is waiting to accept a connection.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
@ -3168,7 +3168,7 @@ Routine Description:
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
MessageFd - Supplies a file desciptor to the socket the message was received
|
MessageFd - Supplies a file descriptor to the socket the message was received
|
||||||
on. This is used for operations that require responses, for example a
|
on. This is used for operations that require responses, for example a
|
||||||
VHD eject request.
|
VHD eject request.
|
||||||
|
|
||||||
|
|
@ -3579,7 +3579,7 @@ Return Value:
|
||||||
// set to SYS_BIND to make bind system call.
|
// set to SYS_BIND to make bind system call.
|
||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
// 32bit:
|
// 32bit:
|
||||||
// If syscall_nr == __NR_socketcall then contine else goto allow:
|
// If syscall_nr == __NR_socketcall then continue else goto allow:
|
||||||
BPF_STMT(BPF_LD + BPF_W + BPF_ABS, syscall_nr),
|
BPF_STMT(BPF_LD + BPF_W + BPF_ABS, syscall_nr),
|
||||||
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, I386_NR_socketcall, 0, 3),
|
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, I386_NR_socketcall, 0, 3),
|
||||||
// if syscall arg0 == SYS_BIND then goto user_notify: else goto allow:
|
// if syscall arg0 == SYS_BIND then goto user_notify: else goto allow:
|
||||||
|
|
@ -3905,7 +3905,7 @@ int main(int Argc, char* Argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Open kmesg for logging and ensure that the file descriptor is not set to one of the standard file descriptors.
|
// Open kmsg for logging and ensure that the file descriptor is not set to one of the standard file descriptors.
|
||||||
//
|
//
|
||||||
// N.B. This is to work around a rare race condition where init is launched without /dev/console set as the controlling terminal.
|
// N.B. This is to work around a rare race condition where init is launched without /dev/console set as the controlling terminal.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,7 @@ unsigned int StartTelemetryAgent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regularily flush messages back to the service.
|
// Regularly flush messages back to the service.
|
||||||
|
|
||||||
auto now = std::chrono::steady_clock::now();
|
auto now = std::chrono::steady_clock::now();
|
||||||
if (drvfsNotifyCommand.has_value() || now > nextFlush)
|
if (drvfsNotifyCommand.has_value() || now > nextFlush)
|
||||||
|
|
|
||||||
|
|
@ -733,8 +733,8 @@ Arguments:
|
||||||
|
|
||||||
CommandLine - Supplies the command line of the process to launch.
|
CommandLine - Supplies the command line of the process to launch.
|
||||||
|
|
||||||
Output - Supplies an optional pointer to an std::string to receive the output of the command.
|
Output - Supplies an optional pointer to a std::string to receive the output of the command.
|
||||||
If no buffer is provied the output will appear in stdout.
|
If no buffer is provided the output will appear in stdout.
|
||||||
|
|
||||||
ExpectedStatus - Supplies the expected return status of the command.
|
ExpectedStatus - Supplies the expected return status of the command.
|
||||||
|
|
||||||
|
|
@ -1433,7 +1433,7 @@ Return Value:
|
||||||
//
|
//
|
||||||
// Check if the prefix matches.
|
// Check if the prefix matches.
|
||||||
//
|
//
|
||||||
// N.B. For Windows paths, this is done case insensitive.
|
// N.B. For Windows paths, this is done case-insensitive.
|
||||||
//
|
//
|
||||||
|
|
||||||
if (!wsl::shared::string::StartsWith(Path, Prefix, WinPath))
|
if (!wsl::shared::string::StartsWith(Path, Prefix, WinPath))
|
||||||
|
|
@ -2894,7 +2894,7 @@ Arguments:
|
||||||
Path - Supplies the path to translate.
|
Path - Supplies the path to translate.
|
||||||
|
|
||||||
Reverse - Supplies a bool, if set perform translation from Windows->Linux
|
Reverse - Supplies a bool, if set perform translation from Windows->Linux
|
||||||
path, otherwise translation from Linux->Windows path.
|
path; otherwise, translation from Linux->Windows path.
|
||||||
|
|
||||||
Return Value:
|
Return Value:
|
||||||
|
|
||||||
|
|
@ -3015,7 +3015,7 @@ Arguments:
|
||||||
Path - Supplies the path to translate.
|
Path - Supplies the path to translate.
|
||||||
|
|
||||||
Reverse - Supplies a bool, if set perform translation from Windows->Linux
|
Reverse - Supplies a bool, if set perform translation from Windows->Linux
|
||||||
path, otherwise translation from Linux->Windows path.
|
path; otherwise, translation from Linux->Windows path.
|
||||||
|
|
||||||
Return Value:
|
Return Value:
|
||||||
|
|
||||||
|
|
@ -3350,7 +3350,7 @@ int ProcessCreateProcessMessage(wsl::shared::SocketChannel& channel, gsl::span<g
|
||||||
}
|
}
|
||||||
else if (execResult == sizeof(execResult))
|
else if (execResult == sizeof(execResult))
|
||||||
{
|
{
|
||||||
// Otherwise return the error code to the service
|
// Otherwise, return the error code to the service
|
||||||
execResult = abs(execResult);
|
execResult = abs(execResult);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public:
|
||||||
THROW_LAST_ERROR_IF(MountEnumCreateEx(&m_mountEnum, mountInfoFile) < 0);
|
THROW_LAST_ERROR_IF(MountEnumCreateEx(&m_mountEnum, mountInfoFile) < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Desctruct this instance of the MountEnum class.
|
// Destruct this instance of the MountEnum class.
|
||||||
~MountEnum()
|
~MountEnum()
|
||||||
{
|
{
|
||||||
MountEnumFree(&m_mountEnum);
|
MountEnumFree(&m_mountEnum);
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ void Interface::ChangeAddress(const Address& address, const std::optional<Addres
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TMessage must be drived from AddressMessage or one of its children
|
// TMessage must be derived from AddressMessage or one of its children
|
||||||
template <typename TAddr, typename TMessage>
|
template <typename TAddr, typename TMessage>
|
||||||
void Interface::ChangeAddressImpl(const Address& address, const std::optional<Address>& broadcastAddress, Operation operation)
|
void Interface::ChangeAddressImpl(const Address& address, const std::optional<Address>& broadcastAddress, Operation operation)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# This makefile is used to work from a linux environement and is not part of the OS build process.
|
# This makefile is used to work from a linux environment and is not part of the OS build process.
|
||||||
|
|
||||||
CXXFLAGS += -std=c++20 -Wall -Wextra -g3 -fPIC -I../inc
|
CXXFLAGS += -std=c++20 -Wall -Wextra -g3 -fPIC -I../inc
|
||||||
LDFLAGS +=
|
LDFLAGS +=
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace details {
|
||||||
new (P9_EXPECTED_STD addressof(value)) T(P9_EXPECTED_STD forward<Args>(args)...);
|
new (P9_EXPECTED_STD addressof(value)) T(P9_EXPECTED_STD forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Storage for the BasicExpected class for types that are trivially destructable.
|
// Storage for the BasicExpected class for types that are trivially destructible.
|
||||||
template <typename T, typename E>
|
template <typename T, typename E>
|
||||||
struct TrivialExpectedStorage
|
struct TrivialExpectedStorage
|
||||||
{
|
{
|
||||||
|
|
@ -98,7 +98,7 @@ namespace details {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default destructor, because the value type is trivially destructable.
|
// Default destructor, because the value type is trivially destructible.
|
||||||
~TrivialExpectedStorage() = default;
|
~TrivialExpectedStorage() = default;
|
||||||
|
|
||||||
bool HasValue;
|
bool HasValue;
|
||||||
|
|
@ -111,7 +111,7 @@ namespace details {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Storage for the BasicExpected class for types that are not trivially destructable.
|
// Storage for the BasicExpected class for types that are not trivially destructible.
|
||||||
template <typename T, typename E>
|
template <typename T, typename E>
|
||||||
struct NonTrivialExpectedStorage
|
struct NonTrivialExpectedStorage
|
||||||
{
|
{
|
||||||
|
|
@ -204,7 +204,7 @@ namespace details {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Class that helps to select between the storage for trivially and non-trivially destructable
|
// Class that helps to select between the storage for trivially and non-trivially destructible
|
||||||
// types.
|
// types.
|
||||||
template <typename T, typename E>
|
template <typename T, typename E>
|
||||||
struct ExpectedStorage
|
struct ExpectedStorage
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace p9fs {
|
||||||
// the message if all dynamic content is omitted. In the case of strings, the
|
// the message if all dynamic content is omitted. In the case of strings, the
|
||||||
// size of the two-byte length field is included, but the string length itself
|
// size of the two-byte length field is included, but the string length itself
|
||||||
// is not. The omitted components are listed with each message type, and the
|
// is not. The omitted components are listed with each message type, and the
|
||||||
// caller is responsible for adding the the right values if necessary.
|
// caller is responsible for adding the right values if necessary.
|
||||||
constexpr UINT32 GetMessageSize(MessageType messageType)
|
constexpr UINT32 GetMessageSize(MessageType messageType)
|
||||||
{
|
{
|
||||||
switch (messageType)
|
switch (messageType)
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ struct Root final : public IRoot
|
||||||
{
|
{
|
||||||
Root(std::shared_ptr<const Share> share, int rootFd, uid_t uid, gid_t gid) : Share{share}, RootFd{rootFd}, Uid{uid}, Gid{gid}
|
Root(std::shared_ptr<const Share> share, int rootFd, uid_t uid, gid_t gid) : Share{share}, RootFd{rootFd}, Uid{uid}, Gid{gid}
|
||||||
{
|
{
|
||||||
Plan9TraceLoggingProvider::LogMessage(std::format("Instanciate root, uid={}", uid));
|
Plan9TraceLoggingProvider::LogMessage(std::format("Instantiate root, uid={}", uid));
|
||||||
if (uid == -1)
|
if (uid == -1)
|
||||||
{
|
{
|
||||||
return; // No uid passed, don't try to get the additional groups.
|
return; // No uid passed, don't try to get the additional groups.
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ Expected<std::shared_ptr<const IRoot>> ShareList::MakeRoot(std::string_view anam
|
||||||
{
|
{
|
||||||
// The server is not running as root, which won't work.
|
// The server is not running as root, which won't work.
|
||||||
// N.B. It's possible to make this work as long as the server has CAP_SETUID, but that
|
// N.B. It's possible to make this work as long as the server has CAP_SETUID, but that
|
||||||
// is currrently not needed.
|
// is currently not needed.
|
||||||
return LxError{LX_EPERM};
|
return LxError{LX_EPERM};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1218,7 +1218,7 @@ private:
|
||||||
|
|
||||||
// Utilize a small stack-allocated buffer that's large enough for the largest response
|
// Utilize a small stack-allocated buffer that's large enough for the largest response
|
||||||
// without dynamic content (which is Rgetattr). Messages requiring a larger response will
|
// without dynamic content (which is Rgetattr). Messages requiring a larger response will
|
||||||
// allocate a dynamic buffer by calling MessageResonse::EnsureSize.
|
// allocate a dynamic buffer by calling MessageResponse::EnsureSize.
|
||||||
// N.B. Message handlers that only return the header (e.g. HandleClunk) don't need to call
|
// N.B. Message handlers that only return the header (e.g. HandleClunk) don't need to call
|
||||||
// EnsureSize since the static buffer is always big enough for that.
|
// EnsureSize since the static buffer is always big enough for that.
|
||||||
gsl::byte staticBuffer[c_staticBufferSize];
|
gsl::byte staticBuffer[c_staticBufferSize];
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ void CoroutineIoIssuer::PostIssue(CoroutineIoOperation& operation, CancelToken&
|
||||||
else if (token.Cancelled())
|
else if (token.Cancelled())
|
||||||
{
|
{
|
||||||
// The IO did not complete synchronously, but the operation has been
|
// The IO did not complete synchronously, but the operation has been
|
||||||
// cancelled. Depending on when the cancel occured, the IO may not have
|
// cancelled. Depending on when the cancel occurred, the IO may not have
|
||||||
// been cancelled, so cancel it now.
|
// been cancelled, so cancel it now.
|
||||||
aio_cancel(operation.ControlBlock.aio_fildes, &operation.ControlBlock);
|
aio_cancel(operation.ControlBlock.aio_fildes, &operation.ControlBlock);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ Scheduler::Unblocker Scheduler::Unblock() noexcept
|
||||||
/// Try to claim queue ownership for the current thread. If this function
|
/// Try to claim queue ownership for the current thread. If this function
|
||||||
/// returns true, then the caller must call RunAndRelease to process the queue.
|
/// returns true, then the caller must call RunAndRelease to process the queue.
|
||||||
///
|
///
|
||||||
/// If fromKick, then the caller is the thread that was explictly kicked to
|
/// If fromKick, then the caller is the thread that was explicitly kicked to
|
||||||
/// process the queue. Otherwise, this is an IO completion or other
|
/// process the queue. Otherwise, this is an IO completion or other
|
||||||
/// opportunistic thread.
|
/// opportunistic thread.
|
||||||
bool Scheduler::Claim(bool fromKick) noexcept
|
bool Scheduler::Claim(bool fromKick) noexcept
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ void LogMessageBuilder::AddRawValue(UINT64 value, int base)
|
||||||
m_message += ConvertNumber(buffer, c_numberBufferSize, value, base);
|
m_message += ConvertNumber(buffer, c_numberBufferSize, value, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds an qid value without any separators or prefix.
|
// Adds a qid value without any separators or prefix.
|
||||||
void LogMessageBuilder::AddRawValue(const Qid& value)
|
void LogMessageBuilder::AddRawValue(const Qid& value)
|
||||||
{
|
{
|
||||||
m_message += "{";
|
m_message += "{";
|
||||||
|
|
|
||||||
|
|
@ -816,7 +816,7 @@ InvalidLine:
|
||||||
{
|
{
|
||||||
// Write out the rest of the remaining
|
// Write out the rest of the remaining
|
||||||
// invalid line. WEOF and '\n' will be
|
// invalid line. WEOF and '\n' will be
|
||||||
// handled/writen by the NewLine label.
|
// handled/written by the NewLine label.
|
||||||
configFileOutput += ch;
|
configFileOutput += ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -375,7 +375,7 @@ public:
|
||||||
const TChar* value = nullptr;
|
const TChar* value = nullptr;
|
||||||
if (e.Positional)
|
if (e.Positional)
|
||||||
{
|
{
|
||||||
value = m_argv[i]; // Positonal arguments directly receive arvg[i]
|
value = m_argv[i]; // Positional arguments directly receive arvg[i]
|
||||||
}
|
}
|
||||||
else if (i + 1 < m_argc)
|
else if (i + 1 < m_argc)
|
||||||
{
|
{
|
||||||
|
|
@ -465,7 +465,7 @@ private:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Otherwise we need an actual value
|
// Otherwise, we need an actual value
|
||||||
if (Value == nullptr)
|
if (Value == nullptr)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ inline unique_socket ConnCheckConnectSocket(int family, const char* hostname, co
|
||||||
|
|
||||||
// Attempts to establish a TCPv4 and a TCPv6 connection to a port on a host.
|
// Attempts to establish a TCPv4 and a TCPv6 connection to a port on a host.
|
||||||
// ipv6hostname is an optional parameter in case the IPv6 equivalent hostname is different.
|
// ipv6hostname is an optional parameter in case the IPv6 equivalent hostname is different.
|
||||||
// example: www.msftconnectest.com and ipv6.msftconnectest.com
|
// example: www.msftconnecttest.com and ipv6.msftconnecttest.com
|
||||||
// This API is blocking/synchronous.
|
// This API is blocking/synchronous.
|
||||||
inline ConnCheckResult CheckConnection(const char* hostname, const char* ipv6hostname, const char* port)
|
inline ConnCheckResult CheckConnection(const char* hostname, const char* ipv6hostname, const char* port)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ Abstract:
|
||||||
#define LX_INIT_DEFAULT_ROUTE_V6_PREFIX LX_INIT_UNSPECIFIED_V6_ADDRESS "/0"
|
#define LX_INIT_DEFAULT_ROUTE_V6_PREFIX LX_INIT_UNSPECIFIED_V6_ADDRESS "/0"
|
||||||
|
|
||||||
//
|
//
|
||||||
// The hard-coded link-local addressess used for communicating over the loopback to the host
|
// The hard-coded link-local addresses used for communicating over the loopback to the host
|
||||||
//
|
//
|
||||||
#define LX_INIT_IPV4_LOOPBACK_GATEWAY_ADDRESS "169.254.73.152"
|
#define LX_INIT_IPV4_LOOPBACK_GATEWAY_ADDRESS "169.254.73.152"
|
||||||
#define LX_INIT_IPV6_LOOPBACK_GATEWAY_ADDRESS "fe80::500:4aef:feef:2aa2"
|
#define LX_INIT_IPV6_LOOPBACK_GATEWAY_ADDRESS "fe80::500:4aef:feef:2aa2"
|
||||||
|
|
@ -155,7 +155,7 @@ Abstract:
|
||||||
//
|
//
|
||||||
// Typical default DrvFs-specific 9p mount options.
|
// Typical default DrvFs-specific 9p mount options.
|
||||||
//
|
//
|
||||||
// N.B. These are used to pre-populate virtiofs shares with default mount options.
|
// N.B. These are used to prepopulate virtiofs shares with default mount options.
|
||||||
// These will match the default values used by the system distro, and will typically
|
// These will match the default values used by the system distro, and will typically
|
||||||
// match the default uid / gid for the user distro. If the values do not match, a new
|
// match the default uid / gid for the user distro. If the values do not match, a new
|
||||||
// virtiofs share will be created.
|
// virtiofs share will be created.
|
||||||
|
|
@ -176,7 +176,7 @@ Abstract:
|
||||||
#define LX_INIT_HVSOCKET_TIMEOUT_SECONDS (30)
|
#define LX_INIT_HVSOCKET_TIMEOUT_SECONDS (30)
|
||||||
|
|
||||||
//
|
//
|
||||||
// The data for begining a port listener.
|
// The data for beginning a port listener.
|
||||||
//
|
//
|
||||||
|
|
||||||
#define LX_INIT_LOCALHOST_RELAY "localhost"
|
#define LX_INIT_LOCALHOST_RELAY "localhost"
|
||||||
|
|
|
||||||
|
|
@ -713,7 +713,7 @@ inline MacAddress ParseMacAddress(const std::basic_string<T>& Input, T Separator
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename TChar>
|
template <typename TChar>
|
||||||
inline std::basic_string<TChar> FormatMacAddress(const MacAddress& input, TChar seperator)
|
inline std::basic_string<TChar> FormatMacAddress(const MacAddress& input, TChar separator)
|
||||||
{
|
{
|
||||||
std::basic_string<TChar> output(17, '\0');
|
std::basic_string<TChar> output(17, '\0');
|
||||||
|
|
||||||
|
|
@ -724,15 +724,15 @@ inline std::basic_string<TChar> FormatMacAddress(const MacAddress& input, TChar
|
||||||
output.size() + 1,
|
output.size() + 1,
|
||||||
MAC_ADDRESS_FORMAT_STRING,
|
MAC_ADDRESS_FORMAT_STRING,
|
||||||
input[0],
|
input[0],
|
||||||
seperator,
|
separator,
|
||||||
input[1],
|
input[1],
|
||||||
seperator,
|
separator,
|
||||||
input[2],
|
input[2],
|
||||||
seperator,
|
separator,
|
||||||
input[3],
|
input[3],
|
||||||
seperator,
|
separator,
|
||||||
input[4],
|
input[4],
|
||||||
seperator,
|
separator,
|
||||||
input[5]);
|
input[5]);
|
||||||
}
|
}
|
||||||
else if constexpr (std::is_same_v<TChar, wchar_t>)
|
else if constexpr (std::is_same_v<TChar, wchar_t>)
|
||||||
|
|
@ -742,15 +742,15 @@ inline std::basic_string<TChar> FormatMacAddress(const MacAddress& input, TChar
|
||||||
output.size() + 1,
|
output.size() + 1,
|
||||||
STRING_TO_WIDE_STRING(MAC_ADDRESS_FORMAT_STRING),
|
STRING_TO_WIDE_STRING(MAC_ADDRESS_FORMAT_STRING),
|
||||||
input[0],
|
input[0],
|
||||||
seperator,
|
separator,
|
||||||
input[1],
|
input[1],
|
||||||
seperator,
|
separator,
|
||||||
input[2],
|
input[2],
|
||||||
seperator,
|
separator,
|
||||||
input[3],
|
input[3],
|
||||||
seperator,
|
separator,
|
||||||
input[4],
|
input[4],
|
||||||
seperator,
|
separator,
|
||||||
input[5]);
|
input[5]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ DistributionList ReadFromManifest(const std::wstring& url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The "Default" string takes precendence. If not present, use the first legacy distro entry.
|
// The "Default" string takes precedence. If not present, use the first legacy distro entry.
|
||||||
if (!distros.Default.has_value() && distros.Distributions.has_value() && distros.Distributions->size() > 0)
|
if (!distros.Default.has_value() && distros.Distributions.has_value() && distros.Distributions->size() > 0)
|
||||||
{
|
{
|
||||||
distros.Default = (*distros.Distributions)[0].Name;
|
distros.Default = (*distros.Distributions)[0].Name;
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ enum Context : ULONGLONG
|
||||||
Install = 0x4000000000,
|
Install = 0x4000000000,
|
||||||
ReadDistroConfig = 0x8000000000,
|
ReadDistroConfig = 0x8000000000,
|
||||||
UpdatePackage = 0x10000000000,
|
UpdatePackage = 0x10000000000,
|
||||||
QueryLatestGithubRelease = 0x20000000000,
|
QueryLatestGitHubRelease = 0x20000000000,
|
||||||
VerifyChecksum = 0x40000000000,
|
VerifyChecksum = 0x40000000000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ std::vector<std::wstring> GetUserLanguages(bool impersonate)
|
||||||
{
|
{
|
||||||
if (g_runningInService)
|
if (g_runningInService)
|
||||||
{
|
{
|
||||||
// N.B. If we're in the service the locale needs to be queried everytime since different users
|
// N.B. If we're in the service the locale needs to be queried every time since different users
|
||||||
// can have different language configurations.
|
// can have different language configurations.
|
||||||
std::optional<wil::unique_coreverttoself_call> revert;
|
std::optional<wil::unique_coreverttoself_call> revert;
|
||||||
if (impersonate)
|
if (impersonate)
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ wil::unique_handle SubProcess::Start()
|
||||||
StartupInfo.StartupInfo.cb = sizeof(StartupInfo);
|
StartupInfo.StartupInfo.cb = sizeof(StartupInfo);
|
||||||
StartupInfo.StartupInfo.dwFlags = STARTF_USESTDHANDLES;
|
StartupInfo.StartupInfo.dwFlags = STARTF_USESTDHANDLES;
|
||||||
|
|
||||||
// N.B. Passing a pseudoconsole requires all standard handlles to be null
|
// N.B. Passing a pseudoconsole requires all standard handles to be null
|
||||||
if (m_pseudoConsole == nullptr)
|
if (m_pseudoConsole == nullptr)
|
||||||
{
|
{
|
||||||
StartupInfo.StartupInfo.hStdInput = ARGUMENT_PRESENT(m_stdIn) ? m_stdIn : GetStdHandle(STD_INPUT_HANDLE);
|
StartupInfo.StartupInfo.hStdInput = ARGUMENT_PRESENT(m_stdIn) ? m_stdIn : GetStdHandle(STD_INPUT_HANDLE);
|
||||||
|
|
|
||||||
|
|
@ -630,7 +630,7 @@ int Install(_In_ std::wstring_view commandLine)
|
||||||
|
|
||||||
if (legacyDistro != nullptr)
|
if (legacyDistro != nullptr)
|
||||||
{
|
{
|
||||||
wsl::windows::common::distribution::Launch(*legacyDistro, installResult.InstalledViaGithub, !installResult.Alreadyinstalled);
|
wsl::windows::common::distribution::Launch(*legacyDistro, installResult.InstalledViaGitHub, !installResult.Alreadyinstalled);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1076,7 +1076,7 @@ LaunchProcessOptions ParseLegacyArguments(_Inout_ std::wstring_view& commandLine
|
||||||
// Strip any leading whitespace.
|
// Strip any leading whitespace.
|
||||||
commandLine = wsl::windows::common::string::StripLeadingWhitespace(commandLine);
|
commandLine = wsl::windows::common::string::StripLeadingWhitespace(commandLine);
|
||||||
|
|
||||||
// Check for a distributon GUID as the first parameter and strip it out if present.
|
// Check for a distribution GUID as the first parameter and strip it out if present.
|
||||||
auto argument = wsl::windows::common::helpers::ParseArgument(commandLine);
|
auto argument = wsl::windows::common::helpers::ParseArgument(commandLine);
|
||||||
auto distroGuid = wsl::shared::string::ToGuid(argument);
|
auto distroGuid = wsl::shared::string::ToGuid(argument);
|
||||||
if (distroGuid.has_value())
|
if (distroGuid.has_value())
|
||||||
|
|
@ -1523,7 +1523,7 @@ int RunDebugShell()
|
||||||
// a pipe is connected, so it's lost.
|
// a pipe is connected, so it's lost.
|
||||||
THROW_IF_WIN32_BOOL_FALSE(WriteFile(pipe.get(), "\n", 1, nullptr, nullptr));
|
THROW_IF_WIN32_BOOL_FALSE(WriteFile(pipe.get(), "\n", 1, nullptr, nullptr));
|
||||||
|
|
||||||
// Create a thread to realy stdin to the pipe.
|
// Create a thread to relay stdin to the pipe.
|
||||||
wsl::windows::common::SvcCommIo Io;
|
wsl::windows::common::SvcCommIo Io;
|
||||||
auto exitEvent = wil::unique_event(wil::EventOptions::ManualReset);
|
auto exitEvent = wil::unique_event(wil::EventOptions::ManualReset);
|
||||||
std::thread inputThread(
|
std::thread inputThread(
|
||||||
|
|
|
||||||
|
|
@ -314,10 +314,10 @@ void wsl::core::Config::Initialize(_In_opt_ HANDLE UserToken)
|
||||||
MemorySizeBytes = std::min<UINT64>(MemorySizeBytes, MaximumMemorySizeBytes);
|
MemorySizeBytes = std::min<UINT64>(MemorySizeBytes, MaximumMemorySizeBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the user-defined swap size if one was specified, otherwise set to 25%
|
// Use the user-defined swap size if one was specified; otherwise, set to 25%
|
||||||
// the memory size rounded up to the nearest GB.
|
// the memory size rounded up to the nearest GB.
|
||||||
//
|
//
|
||||||
// N.B. This heuristic is modeled after RedHat and Ubuntu's recommended swap size.
|
// N.B. This heuristic is modeled after Red Hat and Ubuntu's recommended swap size.
|
||||||
if (SwapSizeBytes == UINT64_MAX)
|
if (SwapSizeBytes == UINT64_MAX)
|
||||||
{
|
{
|
||||||
SwapSizeBytes = ((MemorySizeBytes / 4 + _1GB - 1) & ~(_1GB - 1));
|
SwapSizeBytes = ((MemorySizeBytes / 4 + _1GB - 1) & ~(_1GB - 1));
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ try
|
||||||
//
|
//
|
||||||
// Currently, there are 3 possible levels of Hyper-V firewall OS support:
|
// Currently, there are 3 possible levels of Hyper-V firewall OS support:
|
||||||
// 1 - No Hyper-V firewall OS support.
|
// 1 - No Hyper-V firewall OS support.
|
||||||
// 2 - Initial Hyper-V firewall support (Support for mirrrored mode only).
|
// 2 - Initial Hyper-V firewall support (Support for mirrored mode only).
|
||||||
// To check for this support, we query for the 'MSFT_NetFirewallHyperVVMCreator' object.
|
// To check for this support, we query for the 'MSFT_NetFirewallHyperVVMCreator' object.
|
||||||
// 3 - Enterprise Hyper-V firewall support (Support for NAT mode, configuring default settings values, and configuring per-profile configs).
|
// 3 - Enterprise Hyper-V firewall support (Support for NAT mode, configuring default settings values, and configuring per-profile configs).
|
||||||
// To check for this support, we query for the 'MSFT_NetFirewallHyperVProfile' object.
|
// To check for this support, we query for the 'MSFT_NetFirewallHyperVProfile' object.
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ inline bool operator<(const SOCKADDR_INET& lhs, const SOCKADDR_INET& rhs) noexce
|
||||||
return lhs.Ipv4.sin_addr.S_un.S_addr < rhs.Ipv4.sin_addr.S_un.S_addr;
|
return lhs.Ipv4.sin_addr.S_un.S_addr < rhs.Ipv4.sin_addr.S_un.S_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// implmenting the comparison operation following the shortcut from mstcpip.h IN6_ADDR_EQUAL
|
// implementing the comparison operation following the shortcut from mstcpip.h IN6_ADDR_EQUAL
|
||||||
const __int64 UNALIGNED* lhsRawPointer = (__int64 UNALIGNED*)(&lhs.Ipv6.sin6_addr);
|
const __int64 UNALIGNED* lhsRawPointer = (__int64 UNALIGNED*)(&lhs.Ipv6.sin6_addr);
|
||||||
const __int64 UNALIGNED* rhsRawPointer = (__int64 UNALIGNED*)(&rhs.Ipv6.sin6_addr);
|
const __int64 UNALIGNED* rhsRawPointer = (__int64 UNALIGNED*)(&rhs.Ipv6.sin6_addr);
|
||||||
if (lhsRawPointer[0] == rhsRawPointer[0])
|
if (lhsRawPointer[0] == rhsRawPointer[0])
|
||||||
|
|
@ -94,7 +94,7 @@ inline bool operator>(const SOCKADDR_INET& lhs, const SOCKADDR_INET& rhs) noexce
|
||||||
return lhs.Ipv4.sin_addr.S_un.S_addr > rhs.Ipv4.sin_addr.S_un.S_addr;
|
return lhs.Ipv4.sin_addr.S_un.S_addr > rhs.Ipv4.sin_addr.S_un.S_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// implmenting the comparison operation following the shortcut from mstcpip.h IN6_ADDR_EQUAL
|
// implementing the comparison operation following the shortcut from mstcpip.h IN6_ADDR_EQUAL
|
||||||
const __int64 UNALIGNED* lhsRawPointer = (__int64 UNALIGNED*)(&lhs.Ipv6.sin6_addr);
|
const __int64 UNALIGNED* lhsRawPointer = (__int64 UNALIGNED*)(&lhs.Ipv6.sin6_addr);
|
||||||
const __int64 UNALIGNED* rhsRawPointer = (__int64 UNALIGNED*)(&rhs.Ipv6.sin6_addr);
|
const __int64 UNALIGNED* rhsRawPointer = (__int64 UNALIGNED*)(&rhs.Ipv6.sin6_addr);
|
||||||
if (lhsRawPointer[0] == rhsRawPointer[0])
|
if (lhsRawPointer[0] == rhsRawPointer[0])
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ try
|
||||||
std::tie(installResult.Name, installResult.Id) =
|
std::tie(installResult.Name, installResult.Id) =
|
||||||
InstallModernDistribution(*distro, version, localName, location, vhdSize, fixedVhd);
|
InstallModernDistribution(*distro, version, localName, location, vhdSize, fixedVhd);
|
||||||
|
|
||||||
installResult.InstalledViaGithub = true;
|
installResult.InstalledViaGitHub = true;
|
||||||
}
|
}
|
||||||
else if (const auto* distro = std::get_if<Distribution>(&*installResult.Distribution))
|
else if (const auto* distro = std::get_if<Distribution>(&*installResult.Distribution))
|
||||||
{
|
{
|
||||||
|
|
@ -193,7 +193,7 @@ try
|
||||||
}
|
}
|
||||||
|
|
||||||
installResult.Name = distro->FriendlyName;
|
installResult.Name = distro->FriendlyName;
|
||||||
installResult.InstalledViaGithub = useGitHub;
|
installResult.InstalledViaGitHub = useGitHub;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ public:
|
||||||
std::wstring Name;
|
std::wstring Name;
|
||||||
std::optional<GUID> Id;
|
std::optional<GUID> Id;
|
||||||
std::optional<wsl::windows::common::distribution::TDistribution> Distribution;
|
std::optional<wsl::windows::common::distribution::TDistribution> Distribution;
|
||||||
bool InstalledViaGithub{};
|
bool InstalledViaGitHub{};
|
||||||
bool Alreadyinstalled{};
|
bool Alreadyinstalled{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ void wsl::windows::common::security::ApplyProcessMitigationPolicies()
|
||||||
LOG_IF_WIN32_BOOL_FALSE(SetProcessMitigationPolicy(ProcessDynamicCodePolicy, &codePolicy, sizeof(codePolicy)));
|
LOG_IF_WIN32_BOOL_FALSE(SetProcessMitigationPolicy(ProcessDynamicCodePolicy, &codePolicy, sizeof(codePolicy)));
|
||||||
|
|
||||||
// Note: Enabling PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY::DisallowWin32kSystemCalls
|
// Note: Enabling PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY::DisallowWin32kSystemCalls
|
||||||
// breaks the service initialization logic (CoIntializeSecurity fails).
|
// breaks the service initialization logic (CoInitializeSecurity fails).
|
||||||
|
|
||||||
PROCESS_MITIGATION_FONT_DISABLE_POLICY fontPolicy{};
|
PROCESS_MITIGATION_FONT_DISABLE_POLICY fontPolicy{};
|
||||||
fontPolicy.DisableNonSystemFonts = true;
|
fontPolicy.DisableNonSystemFonts = true;
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ revert_dir_case_sensitivity EnableNtfsDirCaseSensitivity()
|
||||||
|
|
||||||
//
|
//
|
||||||
// Just in case, make sure at least the main enable flag is set after
|
// Just in case, make sure at least the main enable flag is set after
|
||||||
// reverting, otherwise WSL will break.
|
// reverting; otherwise, WSL will break.
|
||||||
//
|
//
|
||||||
|
|
||||||
WI_SetFlag(Flags, c_enableDirCaseSensitivity);
|
WI_SetFlag(Flags, c_enableDirCaseSensitivity);
|
||||||
|
|
@ -326,7 +326,7 @@ void EnsureCaseSensitiveDirectoryRecursive(_In_ HANDLE Directory)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// After all children are processed, mark the directory case sensitive.
|
// After all children are processed, mark the directory case-sensitive.
|
||||||
//
|
//
|
||||||
// N.B. This is done with a retry because if the NtfsEnableDirCaseSensitivity
|
// N.B. This is done with a retry because if the NtfsEnableDirCaseSensitivity
|
||||||
// flag was just changed from 3 to 1, NTFS may not have updated its
|
// flag was just changed from 3 to 1, NTFS may not have updated its
|
||||||
|
|
@ -562,7 +562,7 @@ void wsl::windows::common::filesystem::CreateRootFs(_In_ PCWSTR Path, _In_ ULONG
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Make sure the directory is marked case sensitive.
|
// Make sure the directory is marked case-sensitive.
|
||||||
//
|
//
|
||||||
// N.B. This is done without impersonating the client because setting this
|
// N.B. This is done without impersonating the client because setting this
|
||||||
// attribute requires the "delete subfolders and files" permission on
|
// attribute requires the "delete subfolders and files" permission on
|
||||||
|
|
@ -649,7 +649,7 @@ std::pair<ULONG, ULONG> wsl::windows::common::filesystem::EnumerateFixedDrives(H
|
||||||
|
|
||||||
void wsl::windows::common::filesystem::EnsureCaseSensitiveDirectory(_In_ PCWSTR Path, _In_ ULONG Flags)
|
void wsl::windows::common::filesystem::EnsureCaseSensitiveDirectory(_In_ PCWSTR Path, _In_ ULONG Flags)
|
||||||
{
|
{
|
||||||
// N.B. Passing SYNCHRONIZE and FILE_SYNCHRONOUS_IO_NONALERT is required, otherwise NtQueryDirectoryFile
|
// N.B. Passing SYNCHRONIZE and FILE_SYNCHRONOUS_IO_NONALERT is required; otherwise, NtQueryDirectoryFile
|
||||||
// might return STATUS_PENDING, which would break our folder enumeration logic.
|
// might return STATUS_PENDING, which would break our folder enumeration logic.
|
||||||
|
|
||||||
const wil::unique_hfile Directory{CreateFileW(
|
const wil::unique_hfile Directory{CreateFileW(
|
||||||
|
|
@ -753,8 +753,8 @@ void wsl::windows::common::filesystem::EnsureDirectoryWithAttributes(
|
||||||
SetExtendedAttributes(Path, LX_S_IFDIR | Mode, Uid, Gid, DistroVersion);
|
SetExtendedAttributes(Path, LX_S_IFDIR | Mode, Uid, Gid, DistroVersion);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Mark a new directory case sensitive, or upgrade the entire tree if it
|
// Mark a new directory case-sensitive, or upgrade the entire tree if it
|
||||||
// exists. If the root is already case sensitive, it's assumed the entire
|
// exists. If the root is already case-sensitive, it's assumed the entire
|
||||||
// tree is.
|
// tree is.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
@ -804,7 +804,7 @@ std::pair<std::string, std::string> wsl::windows::common::filesystem::GetHostAnd
|
||||||
WI_VERIFY(GetComputerNameExA(ComputerNameDnsDomain, nullptr, &size) == FALSE);
|
WI_VERIFY(GetComputerNameExA(ComputerNameDnsDomain, nullptr, &size) == FALSE);
|
||||||
|
|
||||||
// If there is no domain name, initialize with a default. Truncate the
|
// If there is no domain name, initialize with a default. Truncate the
|
||||||
// domain name to the max size that the the driver allows.
|
// domain name to the max size that the driver allows.
|
||||||
// N.B. If the buffer is too small, GetComputerNameEx() sets 'size' to the string size,
|
// N.B. If the buffer is too small, GetComputerNameEx() sets 'size' to the string size,
|
||||||
// ** including ** the null terminator. On success it returns the string size,
|
// ** including ** the null terminator. On success it returns the string size,
|
||||||
// See: https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getcomputernameexa
|
// See: https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getcomputernameexa
|
||||||
|
|
@ -909,7 +909,7 @@ std::string wsl::windows::common::filesystem::GetWindowsHosts(const std::filesys
|
||||||
std::string LineCopy = Line;
|
std::string LineCopy = Line;
|
||||||
|
|
||||||
// Each line is in the following format:
|
// Each line is in the following format:
|
||||||
// <host-adress> <host-alias1> <host-alias2> ...
|
// <host-address> <host-alias1> <host-alias2> ...
|
||||||
//
|
//
|
||||||
// N.B. There must be at least one host aliases for each host address.
|
// N.B. There must be at least one host aliases for each host address.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ DEFINE_ENUM_FLAG_OPERATORS(TempFileFlags);
|
||||||
// Used only in unit tests.
|
// Used only in unit tests.
|
||||||
constexpr ULONG c_case_sensitive_folders_only = 0x100;
|
constexpr ULONG c_case_sensitive_folders_only = 0x100;
|
||||||
|
|
||||||
// Make sure that the above flag doesn't conflict with create intance flags
|
// Make sure that the above flag doesn't conflict with create instance flags
|
||||||
static_assert((LXSS_CREATE_INSTANCE_FLAGS_ALL & c_case_sensitive_folders_only) == 0);
|
static_assert((LXSS_CREATE_INSTANCE_FLAGS_ALL & c_case_sensitive_folders_only) == 0);
|
||||||
|
|
||||||
struct TempFile
|
struct TempFile
|
||||||
|
|
@ -124,7 +124,7 @@ std::pair<ULONG, ULONG> EnumerateFixedDrives(HANDLE Token = nullptr);
|
||||||
bool EnsureDirectory(_In_ LPCWSTR pPath);
|
bool EnsureDirectory(_In_ LPCWSTR pPath);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marks every directory in a tree case sensitive.
|
/// Marks every directory in a tree case-sensitive.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void EnsureCaseSensitiveDirectory(_In_ PCWSTR Path, _In_ ULONG Flags);
|
void EnsureCaseSensitiveDirectory(_In_ PCWSTR Path, _In_ ULONG Flags);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ std::string FormatCommandLine(gsl::span<gsl::byte> CommandLineData, USHORT Comma
|
||||||
//
|
//
|
||||||
// N.B. Any empty arguments or arguments that contain whitespace must be
|
// N.B. Any empty arguments or arguments that contain whitespace must be
|
||||||
// encapsulated in quotes. Quotes must also be escaped according to
|
// encapsulated in quotes. Quotes must also be escaped according to
|
||||||
// stardard command-line parsing rules:
|
// standard command-line parsing rules:
|
||||||
// https://msdn.microsoft.com/en-us/library/17w5ykft.aspx.
|
// https://msdn.microsoft.com/en-us/library/17w5ykft.aspx.
|
||||||
//
|
//
|
||||||
// This logic is largely taken from AppendQuotedForWindows in
|
// This logic is largely taken from AppendQuotedForWindows in
|
||||||
|
|
|
||||||
|
|
@ -392,7 +392,7 @@ Arguments:
|
||||||
|
|
||||||
BufferSize - Supplies the size of the buffer in bytes.
|
BufferSize - Supplies the size of the buffer in bytes.
|
||||||
|
|
||||||
SizeReceieved - Supplies a buffer to store the number of bytes received.
|
SizeReceived - Supplies a buffer to store the number of bytes received.
|
||||||
|
|
||||||
Return Value:
|
Return Value:
|
||||||
|
|
||||||
|
|
@ -469,7 +469,7 @@ Arguments:
|
||||||
|
|
||||||
BufferSize - Supplies the size of the buffer in bytes.
|
BufferSize - Supplies the size of the buffer in bytes.
|
||||||
|
|
||||||
SizeReceieved - Supplies a buffer to store the number of bytes received.
|
SizeReceived - Supplies a buffer to store the number of bytes received.
|
||||||
|
|
||||||
IoStatus - Supplies a pointer to an io status block.
|
IoStatus - Supplies a pointer to an io status block.
|
||||||
|
|
||||||
|
|
@ -754,7 +754,7 @@ LxBusClientWaitForConnection(_In_ HANDLE ServerPortHandle, _Out_ PLXBUS_IPC_SERV
|
||||||
|
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Waits for for a client connection on the provided server port.
|
Waits for a client connection on the provided server port.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
|
|
@ -780,7 +780,7 @@ LxBusClientWaitForLxProcess(_In_ HANDLE LxProcessHandle, _Out_ PLXBUS_IPC_LX_PRO
|
||||||
|
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Waits for for a client connection on the provided server port.
|
Waits for a client connection on the provided server port.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -552,14 +552,14 @@ wsl::windows::common::SvcComm::SvcComm()
|
||||||
THROW_IF_FAILED(m_userSession->QueryInterface(IID_PPV_ARGS(&clientSecurity)));
|
THROW_IF_FAILED(m_userSession->QueryInterface(IID_PPV_ARGS(&clientSecurity)));
|
||||||
|
|
||||||
// Get the current proxy blanket settings.
|
// Get the current proxy blanket settings.
|
||||||
DWORD authnSvc, authzSvc, authnLvl, capabilites;
|
DWORD authnSvc, authzSvc, authnLvl, capabilities;
|
||||||
THROW_IF_FAILED(clientSecurity->QueryBlanket(m_userSession.get(), &authnSvc, &authzSvc, NULL, &authnLvl, NULL, NULL, &capabilites));
|
THROW_IF_FAILED(clientSecurity->QueryBlanket(m_userSession.get(), &authnSvc, &authzSvc, NULL, &authnLvl, NULL, NULL, &capabilities));
|
||||||
|
|
||||||
// Make sure that dynamic cloaking is used.
|
// Make sure that dynamic cloaking is used.
|
||||||
WI_ClearFlag(capabilites, EOAC_STATIC_CLOAKING);
|
WI_ClearFlag(capabilities, EOAC_STATIC_CLOAKING);
|
||||||
WI_SetFlag(capabilites, EOAC_DYNAMIC_CLOAKING);
|
WI_SetFlag(capabilities, EOAC_DYNAMIC_CLOAKING);
|
||||||
THROW_IF_FAILED(clientSecurity->SetBlanket(
|
THROW_IF_FAILED(clientSecurity->SetBlanket(
|
||||||
m_userSession.get(), authnSvc, authzSvc, NULL, authnLvl, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, capabilites));
|
m_userSession.get(), authnSvc, authzSvc, NULL, authnLvl, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, capabilities));
|
||||||
}
|
}
|
||||||
|
|
||||||
wsl::windows::common::SvcComm::~SvcComm()
|
wsl::windows::common::SvcComm::~SvcComm()
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ using namespace wsl::windows::common::wslutil;
|
||||||
constexpr auto c_latestReleaseUrl = L"https://api.github.com/repos/Microsoft/WSL/releases/latest";
|
constexpr auto c_latestReleaseUrl = L"https://api.github.com/repos/Microsoft/WSL/releases/latest";
|
||||||
constexpr auto c_releaseListUrl = L"https://api.github.com/repos/Microsoft/WSL/releases";
|
constexpr auto c_releaseListUrl = L"https://api.github.com/repos/Microsoft/WSL/releases";
|
||||||
constexpr auto c_specificReleaseListUrl = L"https://api.github.com/repos/Microsoft/WSL/releases/tags/";
|
constexpr auto c_specificReleaseListUrl = L"https://api.github.com/repos/Microsoft/WSL/releases/tags/";
|
||||||
constexpr auto c_userAgent = L"wsl-install"; // required to use the Github API
|
constexpr auto c_userAgent = L"wsl-install"; // required to use the GitHub API
|
||||||
constexpr auto c_pipePrefix = L"\\\\.\\pipe\\";
|
constexpr auto c_pipePrefix = L"\\\\.\\pipe\\";
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
@ -171,7 +171,7 @@ static const std::map<Context, LPCWSTR> g_contextStrings{
|
||||||
X(UnregisterDistro),
|
X(UnregisterDistro),
|
||||||
X(RegisterLxBus),
|
X(RegisterLxBus),
|
||||||
X(MountDisk),
|
X(MountDisk),
|
||||||
X(QueryLatestGithubRelease),
|
X(QueryLatestGitHubRelease),
|
||||||
X(DebugShell),
|
X(DebugShell),
|
||||||
X(Plugin),
|
X(Plugin),
|
||||||
X(CallMsi),
|
X(CallMsi),
|
||||||
|
|
@ -255,7 +255,7 @@ int UpdatePackageImpl(bool preRelease, bool repair)
|
||||||
PrintMessage(Localization::MessageCheckingForUpdates());
|
PrintMessage(Localization::MessageCheckingForUpdates());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto [version, release] = GetLatestGithubRelease(preRelease);
|
auto [version, release] = GetLatestGitHubRelease(preRelease);
|
||||||
|
|
||||||
if (!repair && ParseWslPackageVersion(version) <= wsl::shared::PackageVersion)
|
if (!repair && ParseWslPackageVersion(version) <= wsl::shared::PackageVersion)
|
||||||
{
|
{
|
||||||
|
|
@ -825,7 +825,7 @@ std::wstring wsl::windows::common::wslutil::GetErrorString(HRESULT result)
|
||||||
|
|
||||||
return Localization::MessageOsNotSupported(helpers::GetWindowsVersionString().c_str(), kbUrl.c_str());
|
return Localization::MessageOsNotSupported(helpers::GetWindowsVersionString().c_str(), kbUrl.c_str());
|
||||||
|
|
||||||
// All the errors below this comment are not supposed to be reachable here (since there's meant to be emmited from the
|
// All the errors below this comment are not supposed to be reachable here (since there's meant to be emitted from the
|
||||||
// service). But if we somehow hit them here, it's better show something useful to the user.
|
// service). But if we somehow hit them here, it's better show something useful to the user.
|
||||||
case WSL_E_VM_MODE_MOUNT_NAME_ALREADY_EXISTS:
|
case WSL_E_VM_MODE_MOUNT_NAME_ALREADY_EXISTS:
|
||||||
return Localization::MessageDiskMountNameAlreadyExists();
|
return Localization::MessageDiskMountNameAlreadyExists();
|
||||||
|
|
@ -899,7 +899,7 @@ std::wstring wsl::windows::common::wslutil::GetErrorString(HRESULT result)
|
||||||
return GetSystemErrorString(result);
|
return GetSystemErrorString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<std::pair<std::wstring, GithubReleaseAsset>> wsl::windows::common::wslutil::GetGithubAssetFromRelease(const GithubRelease& Release)
|
std::optional<std::pair<std::wstring, GitHubReleaseAsset>> wsl::windows::common::wslutil::GetGitHubAssetFromRelease(const GitHubRelease& Release)
|
||||||
{
|
{
|
||||||
auto findAsset = [&Release](LPCWSTR Suffix) {
|
auto findAsset = [&Release](LPCWSTR Suffix) {
|
||||||
for (const auto& asset : Release.assets)
|
for (const auto& asset : Release.assets)
|
||||||
|
|
@ -913,7 +913,7 @@ std::optional<std::pair<std::wstring, GithubReleaseAsset>> wsl::windows::common:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::optional<std::pair<std::wstring, GithubReleaseAsset>>();
|
return std::optional<std::pair<std::wstring, GitHubReleaseAsset>>();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Look for an MSI package first
|
// Look for an MSI package first
|
||||||
|
|
@ -929,31 +929,31 @@ std::optional<std::pair<std::wstring, GithubReleaseAsset>> wsl::windows::common:
|
||||||
return asset.value();
|
return asset.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<std::wstring, GithubReleaseAsset> wsl::windows::common::wslutil::GetLatestGithubRelease(bool preRelease)
|
std::pair<std::wstring, GitHubReleaseAsset> wsl::windows::common::wslutil::GetLatestGitHubRelease(bool preRelease)
|
||||||
{
|
{
|
||||||
ExecutionContext context(Context::QueryLatestGithubRelease);
|
ExecutionContext context(Context::QueryLatestGitHubRelease);
|
||||||
|
|
||||||
auto registryKey = registry::OpenLxssMachineKey();
|
auto registryKey = registry::OpenLxssMachineKey();
|
||||||
const auto url =
|
const auto url =
|
||||||
registry::ReadString(registryKey.get(), nullptr, c_githubUrlOverrideRegistryValue, preRelease ? c_releaseListUrl : c_latestReleaseUrl);
|
registry::ReadString(registryKey.get(), nullptr, c_githubUrlOverrideRegistryValue, preRelease ? c_releaseListUrl : c_latestReleaseUrl);
|
||||||
WSL_LOG("PollLatestGithubRelease", TraceLoggingValue(url.c_str(), "url"));
|
WSL_LOG("PollLatestGitHubRelease", TraceLoggingValue(url.c_str(), "url"));
|
||||||
|
|
||||||
winrt::Windows::Web::Http::HttpClient client;
|
winrt::Windows::Web::Http::HttpClient client;
|
||||||
client.DefaultRequestHeaders().Append(L"User-Agent", c_userAgent);
|
client.DefaultRequestHeaders().Append(L"User-Agent", c_userAgent);
|
||||||
const auto response = client.GetAsync(winrt::Windows::Foundation::Uri(url)).get();
|
const auto response = client.GetAsync(winrt::Windows::Foundation::Uri(url)).get();
|
||||||
response.EnsureSuccessStatusCode();
|
response.EnsureSuccessStatusCode();
|
||||||
|
|
||||||
return GetLatestGithubRelease(preRelease, response.Content().ReadAsStringAsync().get().c_str());
|
return GetLatestGitHubRelease(preRelease, response.Content().ReadAsStringAsync().get().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<std::wstring, GithubReleaseAsset> wsl::windows::common::wslutil::GetLatestGithubRelease(bool preRelease, LPCWSTR releases)
|
std::pair<std::wstring, GitHubReleaseAsset> wsl::windows::common::wslutil::GetLatestGitHubRelease(bool preRelease, LPCWSTR releases)
|
||||||
{
|
{
|
||||||
std::optional<GithubRelease> parsed{};
|
std::optional<GitHubRelease> parsed{};
|
||||||
|
|
||||||
if (preRelease)
|
if (preRelease)
|
||||||
{
|
{
|
||||||
std::optional<std::tuple<uint32_t, uint32_t, uint32_t>> highestVersion;
|
std::optional<std::tuple<uint32_t, uint32_t, uint32_t>> highestVersion;
|
||||||
for (const auto& e : wsl::shared::FromJson<std::vector<GithubRelease>>(releases))
|
for (const auto& e : wsl::shared::FromJson<std::vector<GitHubRelease>>(releases))
|
||||||
{
|
{
|
||||||
auto version = ParseWslPackageVersion(e.name);
|
auto version = ParseWslPackageVersion(e.name);
|
||||||
if (!highestVersion.has_value() || version > highestVersion)
|
if (!highestVersion.has_value() || version > highestVersion)
|
||||||
|
|
@ -965,21 +965,21 @@ std::pair<std::wstring, GithubReleaseAsset> wsl::windows::common::wslutil::GetLa
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
parsed = wsl::shared::FromJson<GithubRelease>(releases);
|
parsed = wsl::shared::FromJson<GitHubRelease>(releases);
|
||||||
}
|
}
|
||||||
|
|
||||||
THROW_HR_IF(E_UNEXPECTED, !parsed.has_value());
|
THROW_HR_IF(E_UNEXPECTED, !parsed.has_value());
|
||||||
|
|
||||||
// Find the latest release with an msix package asset
|
// Find the latest release with an msix package asset
|
||||||
auto asset = GetGithubAssetFromRelease(parsed.value());
|
auto asset = GetGitHubAssetFromRelease(parsed.value());
|
||||||
THROW_HR_IF_MSG(E_UNEXPECTED, !asset.has_value(), "No suitable WSL release found on github");
|
THROW_HR_IF_MSG(E_UNEXPECTED, !asset.has_value(), "No suitable WSL release found on github");
|
||||||
|
|
||||||
return asset.value();
|
return asset.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
GithubRelease wsl::windows::common::wslutil::GetGithubReleaseByTag(_In_ const std::wstring& inTag)
|
GitHubRelease wsl::windows::common::wslutil::GetGitHubReleaseByTag(_In_ const std::wstring& inTag)
|
||||||
{
|
{
|
||||||
ExecutionContext context(Context::QueryLatestGithubRelease);
|
ExecutionContext context(Context::QueryLatestGitHubRelease);
|
||||||
|
|
||||||
const winrt::Windows::Web::Http::HttpClient client;
|
const winrt::Windows::Web::Http::HttpClient client;
|
||||||
client.DefaultRequestHeaders().Append(L"User-Agent", c_userAgent);
|
client.DefaultRequestHeaders().Append(L"User-Agent", c_userAgent);
|
||||||
|
|
@ -989,7 +989,7 @@ GithubRelease wsl::windows::common::wslutil::GetGithubReleaseByTag(_In_ const st
|
||||||
|
|
||||||
const auto content = response.Content().ReadAsStringAsync().get();
|
const auto content = response.Content().ReadAsStringAsync().get();
|
||||||
|
|
||||||
return wsl::shared::FromJson<GithubRelease>(content.c_str());
|
return wsl::shared::FromJson<GitHubRelease>(content.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
int wsl::windows::common::wslutil::GetLogicalProcessorCount()
|
int wsl::windows::common::wslutil::GetLogicalProcessorCount()
|
||||||
|
|
|
||||||
|
|
@ -41,26 +41,26 @@ inline constexpr GUID WslTerminalNamespace = {0xbe9372fe, 0x59e1, 0x4876, {0xbd,
|
||||||
inline constexpr GUID GeneratedProfilesTerminalNamespace = {0x2bde4a90, 0xd05f, 0x401c, {0x94, 0x92, 0xe4, 0x8, 0x84, 0xea, 0xd1, 0xd8}};
|
inline constexpr GUID GeneratedProfilesTerminalNamespace = {0x2bde4a90, 0xd05f, 0x401c, {0x94, 0x92, 0xe4, 0x8, 0x84, 0xea, 0xd1, 0xd8}};
|
||||||
|
|
||||||
inline auto c_msixPackageFamilyName = L"MicrosoftCorporationII.WindowsSubsystemForLinux_8wekyb3d8bbwe";
|
inline auto c_msixPackageFamilyName = L"MicrosoftCorporationII.WindowsSubsystemForLinux_8wekyb3d8bbwe";
|
||||||
inline auto c_githubUrlOverrideRegistryValue = L"GithubUrlOverride";
|
inline auto c_githubUrlOverrideRegistryValue = L"GitHubUrlOverride";
|
||||||
inline auto c_vhdFileExtension = L".vhd";
|
inline auto c_vhdFileExtension = L".vhd";
|
||||||
inline auto c_vhdxFileExtension = L".vhdx";
|
inline auto c_vhdxFileExtension = L".vhdx";
|
||||||
|
|
||||||
struct GithubReleaseAsset
|
struct GitHubReleaseAsset
|
||||||
{
|
{
|
||||||
std::wstring url;
|
std::wstring url;
|
||||||
uint64_t id{};
|
uint64_t id{};
|
||||||
std::wstring name;
|
std::wstring name;
|
||||||
|
|
||||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(GithubReleaseAsset, url, id, name);
|
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(GitHubReleaseAsset, url, id, name);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GithubRelease
|
struct GitHubRelease
|
||||||
{
|
{
|
||||||
std::wstring name;
|
std::wstring name;
|
||||||
std::vector<GithubReleaseAsset> assets;
|
std::vector<GitHubReleaseAsset> assets;
|
||||||
std::wstring created_at;
|
std::wstring created_at;
|
||||||
|
|
||||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(GithubRelease, name, assets, created_at);
|
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(GitHubRelease, name, assets, created_at);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
@ -98,13 +98,13 @@ DWORD GetDefaultVersion(void);
|
||||||
|
|
||||||
std::wstring GetErrorString(_In_ HRESULT result);
|
std::wstring GetErrorString(_In_ HRESULT result);
|
||||||
|
|
||||||
std::optional<std::pair<std::wstring, GithubReleaseAsset>> GetGithubAssetFromRelease(const GithubRelease& Release);
|
std::optional<std::pair<std::wstring, GitHubReleaseAsset>> GetGitHubAssetFromRelease(const GitHubRelease& Release);
|
||||||
|
|
||||||
std::pair<std::wstring, GithubReleaseAsset> GetLatestGithubRelease(_In_ bool preRelease);
|
std::pair<std::wstring, GitHubReleaseAsset> GetLatestGitHubRelease(_In_ bool preRelease);
|
||||||
|
|
||||||
std::pair<std::wstring, GithubReleaseAsset> GetLatestGithubRelease(_In_ bool preRelease, _In_ LPCWSTR releases);
|
std::pair<std::wstring, GitHubReleaseAsset> GetLatestGitHubRelease(_In_ bool preRelease, _In_ LPCWSTR releases);
|
||||||
|
|
||||||
GithubRelease GetGithubReleaseByTag(_In_ const std::wstring& Version);
|
GitHubRelease GetGitHubReleaseByTag(_In_ const std::wstring& Version);
|
||||||
|
|
||||||
int GetLogicalProcessorCount();
|
int GetLogicalProcessorCount();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -448,7 +448,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Invokes an instance method with zero -> 5 arguments from the instantiated IWbemClassObject
|
// Invokes an instance method with zero -> 5 arguments from the instantiated IWbemClassObject
|
||||||
// Returns a WmiInstace containing the [out] parameters from the method call
|
// Returns a WmiInstance containing the [out] parameters from the method call
|
||||||
// (the property "ReturnValue" contains the return value)
|
// (the property "ReturnValue" contains the return value)
|
||||||
WmiInstance execute_method(PCWSTR method)
|
WmiInstance execute_method(PCWSTR method)
|
||||||
{
|
{
|
||||||
|
|
@ -468,11 +468,11 @@ public:
|
||||||
|
|
||||||
// Instantiate a class object to iterate through each property
|
// Instantiate a class object to iterate through each property
|
||||||
const WmiClassObject propertyObject(m_wbemServices, inParamsDefinition);
|
const WmiClassObject propertyObject(m_wbemServices, inParamsDefinition);
|
||||||
auto propertyItererator = propertyObject.property_begin();
|
auto propertyIterator = propertyObject.property_begin();
|
||||||
|
|
||||||
// write the property
|
// write the property
|
||||||
WmiInstance propertyclassObject(m_wbemServices, inParamsInstance);
|
WmiInstance propertyclassObject(m_wbemServices, inParamsInstance);
|
||||||
propertyclassObject.set(*propertyItererator, arg1);
|
propertyclassObject.set(*propertyIterator, arg1);
|
||||||
|
|
||||||
// execute the method with the properties set
|
// execute the method with the properties set
|
||||||
return execute_method_impl(method, inParamsInstance.get());
|
return execute_method_impl(method, inParamsInstance.get());
|
||||||
|
|
@ -491,13 +491,13 @@ public:
|
||||||
|
|
||||||
// Instantiate a class object to iterate through each property
|
// Instantiate a class object to iterate through each property
|
||||||
const WmiClassObject propertyObject(m_wbemServices, inParamsDefinition);
|
const WmiClassObject propertyObject(m_wbemServices, inParamsDefinition);
|
||||||
auto propertyItererator = propertyObject.property_begin();
|
auto propertyIterator = propertyObject.property_begin();
|
||||||
|
|
||||||
// write each property
|
// write each property
|
||||||
WmiInstance propertyclassObject(m_wbemServices, inParamsInstance);
|
WmiInstance propertyclassObject(m_wbemServices, inParamsInstance);
|
||||||
propertyclassObject.set(*propertyItererator, arg1);
|
propertyclassObject.set(*propertyIterator, arg1);
|
||||||
++propertyItererator;
|
++propertyIterator;
|
||||||
propertyclassObject.set(*propertyItererator, arg2);
|
propertyclassObject.set(*propertyIterator, arg2);
|
||||||
|
|
||||||
// execute the method with the properties set
|
// execute the method with the properties set
|
||||||
return execute_method_impl(method, inParamsInstance.get());
|
return execute_method_impl(method, inParamsInstance.get());
|
||||||
|
|
@ -516,15 +516,15 @@ public:
|
||||||
|
|
||||||
// Instantiate a class object to iterate through each property
|
// Instantiate a class object to iterate through each property
|
||||||
const WmiClassObject propertyObject(m_wbemServices, inParamsDefinition);
|
const WmiClassObject propertyObject(m_wbemServices, inParamsDefinition);
|
||||||
auto propertyItererator = propertyObject.property_begin();
|
auto propertyIterator = propertyObject.property_begin();
|
||||||
|
|
||||||
// write each property
|
// write each property
|
||||||
WmiInstance propertyclassObject(m_wbemServices, inParamsInstance);
|
WmiInstance propertyclassObject(m_wbemServices, inParamsInstance);
|
||||||
propertyclassObject.set(*propertyItererator, arg1);
|
propertyclassObject.set(*propertyIterator, arg1);
|
||||||
++propertyItererator;
|
++propertyIterator;
|
||||||
propertyclassObject.set(*propertyItererator, arg2);
|
propertyclassObject.set(*propertyIterator, arg2);
|
||||||
++propertyItererator;
|
++propertyIterator;
|
||||||
propertyclassObject.set(*propertyItererator, arg3);
|
propertyclassObject.set(*propertyIterator, arg3);
|
||||||
|
|
||||||
// execute the method with the properties set
|
// execute the method with the properties set
|
||||||
return execute_method_impl(method, inParamsInstance.get());
|
return execute_method_impl(method, inParamsInstance.get());
|
||||||
|
|
@ -543,17 +543,17 @@ public:
|
||||||
|
|
||||||
// Instantiate a class object to iterate through each property
|
// Instantiate a class object to iterate through each property
|
||||||
const WmiClassObject propertyObject(m_wbemServices, inParamsDefinition);
|
const WmiClassObject propertyObject(m_wbemServices, inParamsDefinition);
|
||||||
auto propertyItererator = propertyObject.property_begin();
|
auto propertyIterator = propertyObject.property_begin();
|
||||||
|
|
||||||
// write each property
|
// write each property
|
||||||
WmiInstance propertyclassObject(m_wbemServices, inParamsInstance);
|
WmiInstance propertyclassObject(m_wbemServices, inParamsInstance);
|
||||||
propertyclassObject.set(*propertyItererator, arg1);
|
propertyclassObject.set(*propertyIterator, arg1);
|
||||||
++propertyItererator;
|
++propertyIterator;
|
||||||
propertyclassObject.set(*propertyItererator, arg2);
|
propertyclassObject.set(*propertyIterator, arg2);
|
||||||
++propertyItererator;
|
++propertyIterator;
|
||||||
propertyclassObject.set(*propertyItererator, arg3);
|
propertyclassObject.set(*propertyIterator, arg3);
|
||||||
++propertyItererator;
|
++propertyIterator;
|
||||||
propertyclassObject.set(*propertyItererator, arg4);
|
propertyclassObject.set(*propertyIterator, arg4);
|
||||||
|
|
||||||
// execute the method with the properties set
|
// execute the method with the properties set
|
||||||
return execute_method_impl(method, inParamsInstance.get());
|
return execute_method_impl(method, inParamsInstance.get());
|
||||||
|
|
@ -572,20 +572,20 @@ public:
|
||||||
|
|
||||||
// Instantiate a class object to iterate through each property
|
// Instantiate a class object to iterate through each property
|
||||||
const WmiClassObject propertyObject(m_wbemServices, inParamsDefinition);
|
const WmiClassObject propertyObject(m_wbemServices, inParamsDefinition);
|
||||||
auto propertyItererator = propertyObject.property_begin();
|
auto propertyIterator = propertyObject.property_begin();
|
||||||
|
|
||||||
// write each property
|
// write each property
|
||||||
//
|
//
|
||||||
WmiInstance propertyclassObject(m_wbemServices, inParamsInstance);
|
WmiInstance propertyclassObject(m_wbemServices, inParamsInstance);
|
||||||
propertyclassObject.set(*propertyItererator, arg1);
|
propertyclassObject.set(*propertyIterator, arg1);
|
||||||
++propertyItererator;
|
++propertyIterator;
|
||||||
propertyclassObject.set(*propertyItererator, arg2);
|
propertyclassObject.set(*propertyIterator, arg2);
|
||||||
++propertyItererator;
|
++propertyIterator;
|
||||||
propertyclassObject.set(*propertyItererator, arg3);
|
propertyclassObject.set(*propertyIterator, arg3);
|
||||||
++propertyItererator;
|
++propertyIterator;
|
||||||
propertyclassObject.set(*propertyItererator, arg4);
|
propertyclassObject.set(*propertyIterator, arg4);
|
||||||
++propertyItererator;
|
++propertyIterator;
|
||||||
propertyclassObject.set(*propertyItererator, arg5);
|
propertyclassObject.set(*propertyIterator, arg5);
|
||||||
|
|
||||||
// execute the method with the properties set
|
// execute the method with the properties set
|
||||||
return execute_method_impl(method, inParamsInstance.get());
|
return execute_method_impl(method, inParamsInstance.get());
|
||||||
|
|
@ -807,7 +807,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WmiService m_wbemServices;
|
WmiService m_wbemServices;
|
||||||
// Marking wbemEnumerator mutabale to allow for const correctness of begin() and end()
|
// Marking wbemEnumerator mutable to allow for const correctness of begin() and end()
|
||||||
// specifically, invoking Reset() is an implementation detail and should not affect external contracts
|
// specifically, invoking Reset() is an implementation detail and should not affect external contracts
|
||||||
mutable wil::com_ptr<IEnumWbemClassObject> m_wbemEnumerator;
|
mutable wil::com_ptr<IEnumWbemClassObject> m_wbemEnumerator;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -479,7 +479,7 @@ inline bool WmiReadFromVariant(_In_ const VARIANT* variant, _Inout_ std::vector<
|
||||||
|
|
||||||
inline wil::unique_variant WmiMakeVariant(const std::vector<unsigned short>& data)
|
inline wil::unique_variant WmiMakeVariant(const std::vector<unsigned short>& data)
|
||||||
{
|
{
|
||||||
// WMI marshaler complaines type mismatch using VT_UI2 | VT_ARRAY, and VT_I4 | VT_ARRAY works fine.
|
// WMI marshaler complains type mismatch using VT_UI2 | VT_ARRAY, and VT_I4 | VT_ARRAY works fine.
|
||||||
auto* const tempSafeArray = SafeArrayCreateVector(VT_I4, 0, static_cast<ULONG>(data.size()));
|
auto* const tempSafeArray = SafeArrayCreateVector(VT_I4, 0, static_cast<ULONG>(data.size()));
|
||||||
THROW_IF_NULL_ALLOC(tempSafeArray);
|
THROW_IF_NULL_ALLOC(tempSafeArray);
|
||||||
auto guardArray = wil::scope_exit([&]() noexcept { SafeArrayDestroy(tempSafeArray); });
|
auto guardArray = wil::scope_exit([&]() noexcept { SafeArrayDestroy(tempSafeArray); });
|
||||||
|
|
@ -506,7 +506,7 @@ inline wil::unique_variant WmiMakeVariant(const std::vector<unsigned short>& dat
|
||||||
|
|
||||||
inline bool WmiReadFromVariant(_In_ const VARIANT* variant, _Inout_ std::vector<unsigned short>* value)
|
inline bool WmiReadFromVariant(_In_ const VARIANT* variant, _Inout_ std::vector<unsigned short>* value)
|
||||||
{
|
{
|
||||||
// WMI marshaler complaines type mismatch using VT_UI2 | VT_ARRAY, and VT_I4 | VT_ARRAY works fine.
|
// WMI marshaler complains type mismatch using VT_UI2 | VT_ARRAY, and VT_I4 | VT_ARRAY works fine.
|
||||||
if (IsVariantEmptyOrNull(variant))
|
if (IsVariantEmptyOrNull(variant))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ enum WslConfigEntry
|
||||||
AutoProxyEnabled,
|
AutoProxyEnabled,
|
||||||
InitialAutoProxyTimeout,
|
InitialAutoProxyTimeout,
|
||||||
DNSProxyEnabled,
|
DNSProxyEnabled,
|
||||||
DNSTunellingEnabled,
|
DNSTunnelingEnabled,
|
||||||
BestEffortDNSParsingEnabled,
|
BestEffortDNSParsingEnabled,
|
||||||
AutoMemoryReclaim,
|
AutoMemoryReclaim,
|
||||||
GUIApplicationsEnabled,
|
GUIApplicationsEnabled,
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ struct WSLSessionInformation
|
||||||
|
|
||||||
struct WSLDistributionInformation
|
struct WSLDistributionInformation
|
||||||
{
|
{
|
||||||
GUID Id; // Distribution ID, guaranteed to be the same accross reboots
|
GUID Id; // Distribution ID, guaranteed to be the same across reboots
|
||||||
LPCWSTR Name;
|
LPCWSTR Name;
|
||||||
uint64_t PidNamespace;
|
uint64_t PidNamespace;
|
||||||
LPCWSTR PackageFamilyName; // Package family name, or NULL if none
|
LPCWSTR PackageFamilyName; // Package family name, or NULL if none
|
||||||
|
|
@ -78,7 +78,7 @@ struct WSLDistributionInformation
|
||||||
|
|
||||||
struct WslOfflineDistributionInformation
|
struct WslOfflineDistributionInformation
|
||||||
{
|
{
|
||||||
GUID Id; // Distribution ID, guaranteed to be the same accross reboots
|
GUID Id; // Distribution ID, guaranteed to be the same across reboots
|
||||||
LPCWSTR Name;
|
LPCWSTR Name;
|
||||||
LPCWSTR PackageFamilyName; // Package family name, or NULL if none
|
LPCWSTR PackageFamilyName; // Package family name, or NULL if none
|
||||||
LPCWSTR Flavor; // Type of distribution (ubuntu, debian, ...). Introduced in 2.4.4
|
LPCWSTR Flavor; // Type of distribution (ubuntu, debian, ...). Introduced in 2.4.4
|
||||||
|
|
@ -120,7 +120,7 @@ typedef HRESULT (*WSLPluginAPI_OnDistributionStarted)(const struct WSLSessionInf
|
||||||
// In this case, it's possible for this notification to be called multiple times for the same distribution.
|
// In this case, it's possible for this notification to be called multiple times for the same distribution.
|
||||||
typedef HRESULT (*WSLPluginAPI_OnDistributionStopping)(const struct WSLSessionInformation* Session, const struct WSLDistributionInformation* Distribution);
|
typedef HRESULT (*WSLPluginAPI_OnDistributionStopping)(const struct WSLSessionInformation* Session, const struct WSLDistributionInformation* Distribution);
|
||||||
|
|
||||||
// Called when a distribution is registered or unregisteed.
|
// Called when a distribution is registered or unregistered.
|
||||||
// Returning failure will NOT cause the operation to fail.
|
// Returning failure will NOT cause the operation to fail.
|
||||||
typedef HRESULT (*WSLPluginAPI_OnDistributionRegistered)(const struct WSLSessionInformation* Session, const struct WslOfflineDistributionInformation* Distribution);
|
typedef HRESULT (*WSLPluginAPI_OnDistributionRegistered)(const struct WSLSessionInformation* Session, const struct WslOfflineDistributionInformation* Distribution);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ namespace Windows { namespace Internal {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Otherwise take a reference on the MTA apartment.
|
// Otherwise, take a reference on the MTA apartment.
|
||||||
m_hrMtaInitialized = CoIncrementMTAUsage(&m_mtaUsageCookie);
|
m_hrMtaInitialized = CoIncrementMTAUsage(&m_mtaUsageCookie);
|
||||||
}
|
}
|
||||||
RETURN_IF_FAILED(m_hrMtaInitialized);
|
RETURN_IF_FAILED(m_hrMtaInitialized);
|
||||||
|
|
@ -277,7 +277,7 @@ namespace Windows { namespace Internal {
|
||||||
RETURN_IF_WIN32_BOOL_FALSE(MakeAbsoluteSD(
|
RETURN_IF_WIN32_BOOL_FALSE(MakeAbsoluteSD(
|
||||||
pSDRelative, pSDAbsolute, &cbSDAbsolute, pDacl, &cbDacl, pSacl, &cbSacl, pOwner, &cbOwner, pPrimaryGroup, &cbPrimaryGroup));
|
pSDRelative, pSDAbsolute, &cbSDAbsolute, pDacl, &cbDacl, pSacl, &cbSacl, pOwner, &cbOwner, pPrimaryGroup, &cbPrimaryGroup));
|
||||||
|
|
||||||
// ...and now we can call CoInitializeSecuirity
|
// ...and now we can call CoInitializeSecurity
|
||||||
RETURN_IF_FAILED(CoInitializeSecurity(
|
RETURN_IF_FAILED(CoInitializeSecurity(
|
||||||
pSDAbsolute, -1, nullptr, nullptr, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IDENTIFY, NULL, EOAC_NONE, nullptr));
|
pSDAbsolute, -1, nullptr, nullptr, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IDENTIFY, NULL, EOAC_NONE, nullptr));
|
||||||
|
|
||||||
|
|
@ -296,7 +296,7 @@ namespace Windows { namespace Internal {
|
||||||
// COM callback object to support unloading shared-process services
|
// COM callback object to support unloading shared-process services
|
||||||
Microsoft::WRL::ComPtr<IContextCallback> m_icc;
|
Microsoft::WRL::ComPtr<IContextCallback> m_icc;
|
||||||
|
|
||||||
// COM Server descritptor
|
// COM Server descriptor
|
||||||
ServerDescriptor m_serverDescriptor{};
|
ServerDescriptor m_serverDescriptor{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -644,7 +644,7 @@ namespace Windows { namespace Internal {
|
||||||
// control codes to the service.
|
// control codes to the service.
|
||||||
//
|
//
|
||||||
// We stop asynchronously to have the same codepath as system
|
// We stop asynchronously to have the same codepath as system
|
||||||
// stop requestes.
|
// stop requests.
|
||||||
//
|
//
|
||||||
reinterpret_cast<TBase*>(this)->OnSystemShutdown();
|
reinterpret_cast<TBase*>(this)->OnSystemShutdown();
|
||||||
StopAsync();
|
StopAsync();
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ Module Name:
|
||||||
|
|
||||||
Abstract:
|
Abstract:
|
||||||
|
|
||||||
This file contains version definitions for WSL binairies.
|
This file contains version definitions for WSL binaries.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ WslConfigSetting GetWslConfigSetting(WslConfig_t wslConfig, WslConfigEntry wslCo
|
||||||
case IgnoredPorts:
|
case IgnoredPorts:
|
||||||
{
|
{
|
||||||
// The IgnoredPorts member is stored as a set of 16-bit unsigned integers.
|
// The IgnoredPorts member is stored as a set of 16-bit unsigned integers.
|
||||||
// These are convereted back to a string here for the caller to consume.
|
// These are converted back to a string here for the caller to consume.
|
||||||
wslConfig->IgnoredPortsStr.clear();
|
wslConfig->IgnoredPortsStr.clear();
|
||||||
std::vector<uint16_t> ignoredPorts{wslConfig->Config.IgnoredPorts.begin(), wslConfig->Config.IgnoredPorts.end()};
|
std::vector<uint16_t> ignoredPorts{wslConfig->Config.IgnoredPorts.begin(), wslConfig->Config.IgnoredPorts.end()};
|
||||||
std::sort(ignoredPorts.begin(), ignoredPorts.end());
|
std::sort(ignoredPorts.begin(), ignoredPorts.end());
|
||||||
|
|
@ -144,7 +144,7 @@ WslConfigSetting GetWslConfigSetting(WslConfig_t wslConfig, WslConfigEntry wslCo
|
||||||
static_assert(std::is_same<decltype(wslConfigSetting.BoolValue), decltype(wslConfig->Config.EnableDnsProxy)>::value);
|
static_assert(std::is_same<decltype(wslConfigSetting.BoolValue), decltype(wslConfig->Config.EnableDnsProxy)>::value);
|
||||||
wslConfigSetting.BoolValue = wslConfig->Config.EnableDnsProxy;
|
wslConfigSetting.BoolValue = wslConfig->Config.EnableDnsProxy;
|
||||||
break;
|
break;
|
||||||
case DNSTunellingEnabled:
|
case DNSTunnelingEnabled:
|
||||||
static_assert(std::is_same<decltype(wslConfigSetting.BoolValue), decltype(wslConfig->Config.EnableDnsTunneling)>::value);
|
static_assert(std::is_same<decltype(wslConfigSetting.BoolValue), decltype(wslConfig->Config.EnableDnsTunneling)>::value);
|
||||||
wslConfigSetting.BoolValue = wslConfig->Config.EnableDnsTunneling;
|
wslConfigSetting.BoolValue = wslConfig->Config.EnableDnsTunneling;
|
||||||
break;
|
break;
|
||||||
|
|
@ -451,7 +451,7 @@ unsigned long SetWslConfigSetting(WslConfig_t wslConfig, WslConfigSetting wslCon
|
||||||
case DNSProxyEnabled:
|
case DNSProxyEnabled:
|
||||||
return SetWslConfigSetting(
|
return SetWslConfigSetting(
|
||||||
wslConfig, ConfigSetting::DnsProxy, defaultConfig.EnableDnsProxy, wslConfigSetting.BoolValue, wslConfig->Config.EnableDnsProxy);
|
wslConfig, ConfigSetting::DnsProxy, defaultConfig.EnableDnsProxy, wslConfigSetting.BoolValue, wslConfig->Config.EnableDnsProxy);
|
||||||
case DNSTunellingEnabled:
|
case DNSTunnelingEnabled:
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<decltype(wslConfigSetting.BoolValue), decltype(wslConfig->Config.EnableDnsTunneling)>::value);
|
static_assert(std::is_same<decltype(wslConfigSetting.BoolValue), decltype(wslConfig->Config.EnableDnsTunneling)>::value);
|
||||||
ConfigKey key({ConfigSetting::DnsTunneling, ConfigSetting::Experimental::DnsTunneling}, wslConfigSetting.BoolValue);
|
ConfigKey key({ConfigSetting::DnsTunneling, ConfigSetting::Experimental::DnsTunneling}, wslConfigSetting.BoolValue);
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ namespace Property {
|
||||||
inline DistributionPropertyWithDefault<DWORD> RunOOBE{L"RunOOBE", 0};
|
inline DistributionPropertyWithDefault<DWORD> RunOOBE{L"RunOOBE", 0};
|
||||||
inline DistributionPropertyWithDefault<DWORD> Modern{L"Modern", 0};
|
inline DistributionPropertyWithDefault<DWORD> Modern{L"Modern", 0};
|
||||||
|
|
||||||
inline DistributionPropertyWithDefault<std::vector<std::string>> DefaultEnvironmnent{
|
inline DistributionPropertyWithDefault<std::vector<std::string>> DefaultEnvironment{
|
||||||
L"DefaultEnvironment",
|
L"DefaultEnvironment",
|
||||||
{"HOSTTYPE=x86_64",
|
{"HOSTTYPE=x86_64",
|
||||||
"LANG=en_US.UTF-8",
|
"LANG=en_US.UTF-8",
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ try
|
||||||
|
|
||||||
m_dnsChannel.Stop();
|
m_dnsChannel.Stop();
|
||||||
|
|
||||||
// Stop interface change notificaions
|
// Stop interface change notifications
|
||||||
m_interfaceNotificationHandle.reset();
|
m_interfaceNotificationHandle.reset();
|
||||||
|
|
||||||
GenerateTelemetry();
|
GenerateTelemetry();
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ CreateLxProcessData LxssCreateProcess::ParseArguments(
|
||||||
return Parsed;
|
return Parsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static function defintions
|
// static function definitions
|
||||||
std::vector<gsl::byte> LxssCreateProcess::CreateMessage(_In_ LX_MESSAGE_TYPE MessageType, _In_ const CreateLxProcessData& CreateProcessData, _In_ ULONG DefaultUid)
|
std::vector<gsl::byte> LxssCreateProcess::CreateMessage(_In_ LX_MESSAGE_TYPE MessageType, _In_ const CreateLxProcessData& CreateProcessData, _In_ ULONG DefaultUid)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
|
@ -226,7 +226,7 @@ std::vector<gsl::byte> LxssCreateProcess::CreateMessage(_In_ LX_MESSAGE_TYPE Mes
|
||||||
Common->CurrentWorkingDirectoryOffset = wsl::shared::string::CopyToSpan(CreateProcessData.CurrentWorkingDirectory, CommonSpan, Offset);
|
Common->CurrentWorkingDirectoryOffset = wsl::shared::string::CopyToSpan(CreateProcessData.CurrentWorkingDirectory, CommonSpan, Offset);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Populate the CommmandLine strings.
|
// Populate the CommandLine strings.
|
||||||
//
|
//
|
||||||
|
|
||||||
WI_ASSERT(CreateProcessData.CommandLine.size() <= USHORT_MAX);
|
WI_ASSERT(CreateProcessData.CommandLine.size() <= USHORT_MAX);
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ try
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// note that the DropReason is not included in AreProxyStringsIdentical as we don't want to toast if that is only change,
|
// note that the DropReason is not included in AreProxyStringsIdentical as we don't want to toast if that is only change,
|
||||||
// but we still want to make sure the drop reason is updated, otherwise we risk not reporting the correct drop reason to user
|
// but we still want to make sure the drop reason is updated; otherwise, we risk not reporting the correct drop reason to user
|
||||||
if (newProxySettings.UnsupportedProxyDropReason != m_proxySettings->UnsupportedProxyDropReason)
|
if (newProxySettings.UnsupportedProxyDropReason != m_proxySettings->UnsupportedProxyDropReason)
|
||||||
{
|
{
|
||||||
m_proxySettings->UnsupportedProxyDropReason = newProxySettings.UnsupportedProxyDropReason;
|
m_proxySettings->UnsupportedProxyDropReason = newProxySettings.UnsupportedProxyDropReason;
|
||||||
|
|
@ -552,7 +552,7 @@ std::optional<HttpProxySettings> HttpProxyStateTracker::WaitForInitialProxySetti
|
||||||
void HttpProxyStateTracker::ConfigureNetworkingMode(wsl::core::NetworkingMode mode) noexcept
|
void HttpProxyStateTracker::ConfigureNetworkingMode(wsl::core::NetworkingMode mode) noexcept
|
||||||
{
|
{
|
||||||
auto lock = m_proxySettingsLock.lock();
|
auto lock = m_proxySettingsLock.lock();
|
||||||
// if we fallback to NAT mode need to strip bad settings
|
// if we fall back to NAT mode need to strip bad settings
|
||||||
if (m_proxySettings.has_value() && mode != m_networkMode)
|
if (m_proxySettings.has_value() && mode != m_networkMode)
|
||||||
{
|
{
|
||||||
FilterProxySettingsByNetworkConfiguration(m_proxySettings.value(), mode);
|
FilterProxySettingsByNetworkConfiguration(m_proxySettings.value(), mode);
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If no proxy queries have completed, wait for timeout for result.
|
/// If no proxy queries have completed, wait for timeout for result.
|
||||||
/// Otherwise return the proxy settings.
|
/// Otherwise, return the proxy settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
std::optional<HttpProxySettings> WaitForInitialProxySettings();
|
std::optional<HttpProxySettings> WaitForInitialProxySettings();
|
||||||
|
|
||||||
|
|
@ -199,7 +199,7 @@ private:
|
||||||
QueryState m_queryState{QueryState::NoQuery};
|
QueryState m_queryState{QueryState::NoQuery};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to impersonate user, as it is required for the proxy queries to run as the user, otherwise the results will be incorrect.
|
/// Used to impersonate user, as it is required for the proxy queries to run as the user; otherwise, the results will be incorrect.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
wil::unique_handle m_userToken{};
|
wil::unique_handle m_userToken{};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ void LxssInstance::_ConfigureFilesystem(_In_ ULONG Flags)
|
||||||
// Part of this process will try to upgrade existing LxFs folders to
|
// Part of this process will try to upgrade existing LxFs folders to
|
||||||
// enable the per-directory case sensitivity flag. To allow easy detection
|
// enable the per-directory case sensitivity flag. To allow easy detection
|
||||||
// of already processed folders, and resumption in case the process is
|
// of already processed folders, and resumption in case the process is
|
||||||
// interrupted, directories are only marked case sensitive after their
|
// interrupted, directories are only marked case-sensitive after their
|
||||||
// children are processed.
|
// children are processed.
|
||||||
//
|
//
|
||||||
// Paths for LXSS instances look like so:
|
// Paths for LXSS instances look like so:
|
||||||
|
|
@ -474,7 +474,7 @@ void LxssInstance::_ConfigureFilesystem(_In_ ULONG Flags)
|
||||||
ensureDirectoryWithAttributes(LXSS_ROOTFS_DIRECTORY, LXSS_ROOTFS_PERMISSIONS);
|
ensureDirectoryWithAttributes(LXSS_ROOTFS_DIRECTORY, LXSS_ROOTFS_PERMISSIONS);
|
||||||
|
|
||||||
// If this is the legacy distribution, ensure that the additional LxFs
|
// If this is the legacy distribution, ensure that the additional LxFs
|
||||||
// directories exist and have the correct attributes. Otherwise ensure that
|
// directories exist and have the correct attributes. Otherwise, ensure that
|
||||||
// the rootfs/mnt directory exists for DrvFs mounts.
|
// the rootfs/mnt directory exists for DrvFs mounts.
|
||||||
switch (m_configuration.Version)
|
switch (m_configuration.Version)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers connection targets with the Plan 9 Redirector for the calling user, if they're
|
/// Registers connection targets with the Plan 9 Redirector for the calling user, if they're
|
||||||
/// not already regsistered.
|
/// not already registered.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void RegisterPlan9ConnectionTarget(_In_ HANDLE userToken) override;
|
void RegisterPlan9ConnectionTarget(_In_ HANDLE userToken) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ class LxssNetworkingFirewallPort;
|
||||||
class LxssNetworkingNat;
|
class LxssNetworkingNat;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Emulate iptables functionailty.
|
/// Emulate iptables functionality.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class LxssIpTables
|
class LxssIpTables
|
||||||
{
|
{
|
||||||
|
|
@ -298,7 +298,7 @@ public:
|
||||||
LxssNetworkingFirewallPort(const std::shared_ptr<LxssNetworkingFirewall>& Firewall, const Microsoft::WRL::ComPtr<INetFwRule>& Existing);
|
LxssNetworkingFirewallPort(const std::shared_ptr<LxssNetworkingFirewall>& Firewall, const Microsoft::WRL::ComPtr<INetFwRule>& Existing);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desstructor.
|
/// Destructor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
~LxssNetworkingFirewallPort();
|
~LxssNetworkingFirewallPort();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ LxssUserCallback::LxssUserCallback(_In_ HANDLE Handle, _In_ LXBUS_USER_CALLBACK_
|
||||||
// Allocate a buffer of the requested size.
|
// Allocate a buffer of the requested size.
|
||||||
m_buffer.resize(OutputBufferSize);
|
m_buffer.resize(OutputBufferSize);
|
||||||
|
|
||||||
// Setup the threapool wait callback.
|
// Set up the threadpool wait callback.
|
||||||
PTP_WAIT_CALLBACK ThreadpoolCallback;
|
PTP_WAIT_CALLBACK ThreadpoolCallback;
|
||||||
ThreadpoolCallback = reinterpret_cast<PTP_WAIT_CALLBACK>(&ThreadpoolCallbackProxy);
|
ThreadpoolCallback = reinterpret_cast<PTP_WAIT_CALLBACK>(&ThreadpoolCallbackProxy);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ private:
|
||||||
// N.B. Keep this as the last member so that it is the first to be
|
// N.B. Keep this as the last member so that it is the first to be
|
||||||
// destructed. This will ensure that if the threadpool callback
|
// destructed. This will ensure that if the threadpool callback
|
||||||
// races with instance destruction, all of the fields will be valid.
|
// races with instance destruction, all of the fields will be valid.
|
||||||
// At completion of this member's destruction, any oustanding
|
// At completion of this member's destruction, any outstanding
|
||||||
// threadpool thread should have completed and the callback
|
// threadpool thread should have completed and the callback
|
||||||
// will have been unregistered.
|
// will have been unregistered.
|
||||||
wil::unique_threadpool_wait m_threadpoolWait;
|
wil::unique_threadpool_wait m_threadpoolWait;
|
||||||
|
|
|
||||||
|
|
@ -719,7 +719,7 @@ try
|
||||||
E_INVALIDARG,
|
E_INVALIDARG,
|
||||||
((DefaultUid == LX_UID_INVALID) || (Flags != LXSS_DISTRO_FLAGS_UNCHANGED && WI_IsAnyFlagSet(Flags, ~LXSS_DISTRO_FLAGS_ALL))));
|
((DefaultUid == LX_UID_INVALID) || (Flags != LXSS_DISTRO_FLAGS_UNCHANGED && WI_IsAnyFlagSet(Flags, ~LXSS_DISTRO_FLAGS_ALL))));
|
||||||
|
|
||||||
// If the configuration is changed, terminate the distribuiton so the new settings will take effect.
|
// If the configuration is changed, terminate the distribution so the new settings will take effect.
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
if (DefaultUid != distribution.Read(Property::DefaultUid))
|
if (DefaultUid != distribution.Read(Property::DefaultUid))
|
||||||
{
|
{
|
||||||
|
|
@ -946,7 +946,7 @@ HRESULT LxssUserSessionImpl::MoveDistribution(_In_ LPCGUID DistroGuid, _In_ LPCW
|
||||||
THROW_IF_WIN32_BOOL_FALSE(MoveFileEx(
|
THROW_IF_WIN32_BOOL_FALSE(MoveFileEx(
|
||||||
newVhdPath.c_str(), distro.VhdFilePath.c_str(), MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH));
|
newVhdPath.c_str(), distro.VhdFilePath.c_str(), MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH));
|
||||||
|
|
||||||
// Write the location back to the original path in case the second registry write failed. Otherwise this is a no-op.
|
// Write the location back to the original path in case the second registry write failed. Otherwise, this is a no-op.
|
||||||
registration.Write(Property::BasePath, distro.BasePath.c_str());
|
registration.Write(Property::BasePath, distro.BasePath.c_str());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -1186,7 +1186,7 @@ try
|
||||||
*Version = configuration.Version;
|
*Version = configuration.Version;
|
||||||
*DefaultUid = registration.Read(Property::DefaultUid);
|
*DefaultUid = registration.Read(Property::DefaultUid);
|
||||||
*Flags = configuration.Flags;
|
*Flags = configuration.Flags;
|
||||||
const auto defaultEnvironment = registration.Read(Property::DefaultEnvironmnent);
|
const auto defaultEnvironment = registration.Read(Property::DefaultEnvironment);
|
||||||
*DefaultEnvironmentCount = gsl::narrow_cast<ULONG>(defaultEnvironment.size());
|
*DefaultEnvironmentCount = gsl::narrow_cast<ULONG>(defaultEnvironment.size());
|
||||||
auto environment(wil::make_unique_cotaskmem<LPSTR[]>(defaultEnvironment.size()));
|
auto environment(wil::make_unique_cotaskmem<LPSTR[]>(defaultEnvironment.size()));
|
||||||
for (size_t index = 0; index < defaultEnvironment.size(); index += 1)
|
for (size_t index = 0; index < defaultEnvironment.size(); index += 1)
|
||||||
|
|
@ -1379,12 +1379,12 @@ HRESULT LxssUserSessionImpl::RegisterDistribution(
|
||||||
|
|
||||||
// Determine the filesystem version. If WslFs is not enabled, downgrade
|
// Determine the filesystem version. If WslFs is not enabled, downgrade
|
||||||
// the version.
|
// the version.
|
||||||
ULONG FilesytemVersion = LXSS_DISTRO_VERSION_CURRENT;
|
ULONG FilesystemVersion = LXSS_DISTRO_VERSION_CURRENT;
|
||||||
if (wsl::windows::common::registry::ReadDword(lxssKey.get(), nullptr, WSL_NEW_DISTRO_LXFS, 0) != 0)
|
if (wsl::windows::common::registry::ReadDword(lxssKey.get(), nullptr, WSL_NEW_DISTRO_LXFS, 0) != 0)
|
||||||
{
|
{
|
||||||
if (LXSS_DISTRO_USES_WSL_FS(FilesytemVersion) != FALSE)
|
if (LXSS_DISTRO_USES_WSL_FS(FilesystemVersion) != FALSE)
|
||||||
{
|
{
|
||||||
FilesytemVersion = LXSS_DISTRO_VERSION_1;
|
FilesystemVersion = LXSS_DISTRO_VERSION_1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1452,7 +1452,7 @@ HRESULT LxssUserSessionImpl::RegisterDistribution(
|
||||||
lxssKey.get(),
|
lxssKey.get(),
|
||||||
DistributionId,
|
DistributionId,
|
||||||
DistributionName,
|
DistributionName,
|
||||||
FilesytemVersion,
|
FilesystemVersion,
|
||||||
distributionPath.c_str(),
|
distributionPath.c_str(),
|
||||||
flags,
|
flags,
|
||||||
LX_UID_ROOT,
|
LX_UID_ROOT,
|
||||||
|
|
@ -1571,7 +1571,7 @@ HRESULT LxssUserSessionImpl::RegisterDistribution(
|
||||||
THROW_HR_IF(WSL_E_IMPORT_FAILED, exitStatus != 0);
|
THROW_HR_IF(WSL_E_IMPORT_FAILED, exitStatus != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Invoke the init binary with the option to export the distribuiton information via stdout.
|
// Invoke the init binary with the option to export the distribution information via stdout.
|
||||||
{
|
{
|
||||||
std::pair<wil::unique_handle, wil::unique_handle> input;
|
std::pair<wil::unique_handle, wil::unique_handle> input;
|
||||||
THROW_IF_WIN32_BOOL_FALSE(CreatePipe(&input.first, &input.second, nullptr, 0));
|
THROW_IF_WIN32_BOOL_FALSE(CreatePipe(&input.first, &input.second, nullptr, 0));
|
||||||
|
|
@ -1929,7 +1929,7 @@ HRESULT LxssUserSessionImpl::SetVersion(_In_ LPCGUID DistroGuid, _In_ ULONG Vers
|
||||||
commandLine += " -v";
|
commandLine += " -v";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the bsdtar elf binary expand the the tar file using the socket as stdin.
|
// Run the bsdtar elf binary expand the tar file using the socket as stdin.
|
||||||
commandLine += " -C " LXSS_ROOTFS_MOUNT LXSS_BSDTAR_EXTRACT_ARGS;
|
commandLine += " -C " LXSS_ROOTFS_MOUNT LXSS_BSDTAR_EXTRACT_ARGS;
|
||||||
auto elfContext = _RunElfBinary(
|
auto elfContext = _RunElfBinary(
|
||||||
commandLine.c_str(),
|
commandLine.c_str(),
|
||||||
|
|
@ -2097,7 +2097,7 @@ HRESULT LxssUserSessionImpl::Shutdown(_In_ bool PreventNewInstances, bool ForceT
|
||||||
WI_ASSERT(!PreventNewInstances || !m_disableNewInstanceCreation);
|
WI_ASSERT(!PreventNewInstances || !m_disableNewInstanceCreation);
|
||||||
|
|
||||||
// This is used when the session is being deleted.
|
// This is used when the session is being deleted.
|
||||||
// This is in place to prevent a CreateInstace() call from succeeding
|
// This is in place to prevent a CreateInstance() call from succeeding
|
||||||
// after the session is shut down since this would mean that the destructor,
|
// after the session is shut down since this would mean that the destructor,
|
||||||
// which could run on that thread (if the session already dropped its LxssUserSessionImpl reference)
|
// which could run on that thread (if the session already dropped its LxssUserSessionImpl reference)
|
||||||
// would have to do all the cleanup work.
|
// would have to do all the cleanup work.
|
||||||
|
|
@ -2566,7 +2566,7 @@ std::shared_ptr<LxssRunningInstance> LxssUserSessionImpl::_CreateInstance(_In_op
|
||||||
if (instance->GetIdleTimeout() >= 0)
|
if (instance->GetIdleTimeout() >= 0)
|
||||||
{
|
{
|
||||||
// Register a client termination callback with the lifetime manager. If the
|
// Register a client termination callback with the lifetime manager. If the
|
||||||
// ignore client callback flag is specifed and there are no other clients,
|
// ignore client callback flag is specified and there are no other clients,
|
||||||
// the timer is immediately queued.
|
// the timer is immediately queued.
|
||||||
wil::unique_handle currentProcess{};
|
wil::unique_handle currentProcess{};
|
||||||
if (WI_IsFlagClear(Flags, LXSS_CREATE_INSTANCE_FLAGS_IGNORE_CLIENT))
|
if (WI_IsFlagClear(Flags, LXSS_CREATE_INSTANCE_FLAGS_IGNORE_CLIENT))
|
||||||
|
|
@ -2766,7 +2766,7 @@ void LxssUserSessionImpl::_CreateVm()
|
||||||
|
|
||||||
m_vmId.store(vmId);
|
m_vmId.store(vmId);
|
||||||
|
|
||||||
// Create the utiliy VM and register for callbacks.
|
// Create the utility VM and register for callbacks.
|
||||||
m_utilityVm = WslCoreVm::Create(m_userToken, std::move(config), vmId);
|
m_utilityVm = WslCoreVm::Create(m_userToken, std::move(config), vmId);
|
||||||
|
|
||||||
m_utilityVm->GetRuntimeId();
|
m_utilityVm->GetRuntimeId();
|
||||||
|
|
@ -3661,8 +3661,8 @@ bool LxssUserSessionImpl::_ValidateDistro(_In_ HKEY LxssKey, _In_ LPCGUID Distro
|
||||||
void LxssUserSessionImpl::_ValidateDistributionNameAndPathNotInUse(
|
void LxssUserSessionImpl::_ValidateDistributionNameAndPathNotInUse(
|
||||||
_In_ HKEY LxssKey, _In_opt_ LPCWSTR Path, _In_opt_ LPCWSTR Name, const std::optional<GUID>& Exclude)
|
_In_ HKEY LxssKey, _In_opt_ LPCWSTR Path, _In_opt_ LPCWSTR Name, const std::optional<GUID>& Exclude)
|
||||||
{
|
{
|
||||||
// Use the cannonical path to compare distribution registration paths.
|
// Use the canonical path to compare distribution registration paths.
|
||||||
// The cannonical path allows us to compare paths regardless of symlinks.
|
// The canonical path allows us to compare paths regardless of symlinks.
|
||||||
//
|
//
|
||||||
// Even with this, it's theoretically possible to use different drive mounts to have two paths
|
// Even with this, it's theoretically possible to use different drive mounts to have two paths
|
||||||
// that will point to the same underlying folder. To catch this, we'd need to use BY_HANDLE_FILE_INFORMATION and compare file & volume indexes.
|
// that will point to the same underlying folder. To catch this, we'd need to use BY_HANDLE_FILE_INFORMATION and compare file & volume indexes.
|
||||||
|
|
@ -3939,12 +3939,12 @@ CreateLxProcessContext LxssUserSessionImpl::s_GetCreateProcessContext(_In_ const
|
||||||
const auto registration = DistributionRegistration::Open(lxssKey.get(), DistroGuid);
|
const auto registration = DistributionRegistration::Open(lxssKey.get(), DistroGuid);
|
||||||
|
|
||||||
context.Flags = registration.Read(Property::Flags);
|
context.Flags = registration.Read(Property::Flags);
|
||||||
context.DefaultEnvironment = registration.Read(Property::DefaultEnvironmnent);
|
context.DefaultEnvironment = registration.Read(Property::DefaultEnvironment);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
context.Flags = DistributionRegistration::ApplyGlobalFlagsOverride(LXSS_DISTRO_FLAGS_DEFAULT | LXSS_DISTRO_FLAGS_VM_MODE);
|
context.Flags = DistributionRegistration::ApplyGlobalFlagsOverride(LXSS_DISTRO_FLAGS_DEFAULT | LXSS_DISTRO_FLAGS_VM_MODE);
|
||||||
context.DefaultEnvironment = Property::DefaultEnvironmnent.DefaultValue;
|
context.DefaultEnvironment = Property::DefaultEnvironment.DefaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.UserToken = wsl::windows::common::security::GetUserToken(TokenImpersonation);
|
context.UserToken = wsl::windows::common::security::GetUserToken(TokenImpersonation);
|
||||||
|
|
|
||||||
|
|
@ -199,12 +199,12 @@ public:
|
||||||
IFACEMETHOD(SetVersion)(_In_ LPCGUID DistroGuid, _In_ ULONG Version, _In_ HANDLE StdErrHandle, _Out_ LXSS_ERROR_INFO* Error) override;
|
IFACEMETHOD(SetVersion)(_In_ LPCGUID DistroGuid, _In_ ULONG Version, _In_ HANDLE StdErrHandle, _Out_ LXSS_ERROR_INFO* Error) override;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Passtrough a disk to the utility VM.
|
/// Pass through a disk to the utility VM.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IFACEMETHOD(AttachDisk)(_In_ LPCWSTR Disk, _In_ ULONG Flags, _Out_ LXSS_ERROR_INFO* Error) override;
|
IFACEMETHOD(AttachDisk)(_In_ LPCWSTR Disk, _In_ ULONG Flags, _Out_ LXSS_ERROR_INFO* Error) override;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Detach a passtrough disk from the utility VM.
|
/// Detach a passthrough disk from the utility VM.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IFACEMETHOD(DetachDisk)(_In_ LPCWSTR Disk, _Out_ int* Result, _Out_ int* Step, _Out_ LXSS_ERROR_INFO* Error) override;
|
IFACEMETHOD(DetachDisk)(_In_ LPCWSTR Disk, _Out_ int* Result, _Out_ int* Step, _Out_ LXSS_ERROR_INFO* Error) override;
|
||||||
|
|
||||||
|
|
@ -479,12 +479,12 @@ public:
|
||||||
SetVersion(_In_ LPCGUID DistroGuid, _In_ ULONG Version, _In_ HANDLE StdErrHandle);
|
SetVersion(_In_ LPCGUID DistroGuid, _In_ ULONG Version, _In_ HANDLE StdErrHandle);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Passtrough a disk to the utility VM.
|
/// Pass through a disk to the utility VM.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
HRESULT AttachDisk(_In_ LPCWSTR Disk, _In_ ULONG Flags);
|
HRESULT AttachDisk(_In_ LPCWSTR Disk, _In_ ULONG Flags);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Detach a passtrough a disk from the utility VM.
|
/// Detach a passthrough a disk from the utility VM.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
HRESULT DetachDisk(_In_ LPCWSTR Disk, _Out_ int* Result, _Out_ int* Step);
|
HRESULT DetachDisk(_In_ LPCWSTR Disk, _Out_ int* Result, _Out_ int* Step);
|
||||||
|
|
||||||
|
|
@ -755,7 +755,7 @@ private:
|
||||||
static wil::unique_hkey s_OpenLxssUserKey();
|
static wil::unique_hkey s_OpenLxssUserKey();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ensures the distribuiton name is valid.
|
/// Ensures the distribution name is valid.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static void s_ValidateDistroName(_In_ LPCWSTR Name);
|
static void s_ValidateDistroName(_In_ LPCWSTR Name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ void ClearSessionsAndBlockNewInstances()
|
||||||
auto sessionsLock = g_sessionLock.lock_exclusive();
|
auto sessionsLock = g_sessionLock.lock_exclusive();
|
||||||
sessions = std::move(g_sessions);
|
sessions = std::move(g_sessions);
|
||||||
|
|
||||||
// This is required because the moved-from std::optional<T> isn't made empty, so this needs to be done explicitely.
|
// This is required because the moved-from std::optional<T> isn't made empty, so this needs to be done explicitly.
|
||||||
g_sessions.reset();
|
g_sessions.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ using wsl::windows::common::hcs::unique_hcn_endpoint;
|
||||||
|
|
||||||
// This static list is used to keep of which endpoints are in use by other users.
|
// This static list is used to keep of which endpoints are in use by other users.
|
||||||
// It's needed because when we see an endpoint with the same ip address we want,
|
// It's needed because when we see an endpoint with the same ip address we want,
|
||||||
// we have no way to differenciate between an endpoint that we previously used
|
// we have no way to differentiate between an endpoint that we previously used
|
||||||
// that didn't get deleted, and an endpoint acitvely in use by another user.
|
// that didn't get deleted, and an endpoint actively in use by another user.
|
||||||
static wil::srwlock g_endpointsInUseLock;
|
static wil::srwlock g_endpointsInUseLock;
|
||||||
static std::vector<GUID> g_endpointsInUse;
|
static std::vector<GUID> g_endpointsInUse;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ std::vector<std::string> RingBuffer::GetLastDelimitedStrings(char Delimiter, siz
|
||||||
{
|
{
|
||||||
if (!partial.empty())
|
if (!partial.empty())
|
||||||
{
|
{
|
||||||
// The debug CRT will fasttail if begin[size] is accessed
|
// The debug CRT will fastfail if begin[size] is accessed
|
||||||
// But in this case it's not a problem because begin.size() - i would be == 0
|
// But in this case it's not a problem because begin.size() - i would be == 0
|
||||||
std::string partial_begin{&begin.data()[i], begin.size() - i};
|
std::string partial_begin{&begin.data()[i], begin.size() - i};
|
||||||
results.emplace(results.begin(), partial_begin + partial);
|
results.emplace(results.begin(), partial_begin + partial);
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ void WslService::ServiceStopped()
|
||||||
// Tear down telemetry.
|
// Tear down telemetry.
|
||||||
WslTraceLoggingUninitialize();
|
WslTraceLoggingUninitialize();
|
||||||
|
|
||||||
// unitialize COM. This must be done here because this call can cause cleanups that will be fail
|
// uninitialize COM. This must be done here because this call can cause cleanups that will be fail
|
||||||
// if the CRT is shutting down.
|
// if the CRT is shutting down.
|
||||||
m_coInit.reset();
|
m_coInit.reset();
|
||||||
}
|
}
|
||||||
|
|
@ -285,7 +285,7 @@ CATCH_LOG()
|
||||||
void WslService::CheckForUpdates(_Inout_ PTP_CALLBACK_INSTANCE, _Inout_ PVOID Context, _Inout_ PTP_TIMER)
|
void WslService::CheckForUpdates(_Inout_ PTP_CALLBACK_INSTANCE, _Inout_ PVOID Context, _Inout_ PTP_TIMER)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto [version, _] = GetLatestGithubRelease(false);
|
auto [version, _] = GetLatestGitHubRelease(false);
|
||||||
if (ParseWslPackageVersion(version) > ParseWslPackageVersion(TEXT(WSL_PACKAGE_VERSION)))
|
if (ParseWslPackageVersion(version) > ParseWslPackageVersion(TEXT(WSL_PACKAGE_VERSION)))
|
||||||
{
|
{
|
||||||
WSL_LOG("WSL Package update is available", TraceLoggingLevel(WINEVENT_LEVEL_INFO));
|
WSL_LOG("WSL Package update is available", TraceLoggingLevel(WINEVENT_LEVEL_INFO));
|
||||||
|
|
@ -294,7 +294,7 @@ try
|
||||||
SetThreadpoolTimer(static_cast<WslService*>(Context)->m_updateCheckTimer.get(), nullptr, 0, 0);
|
SetThreadpoolTimer(static_cast<WslService*>(Context)->m_updateCheckTimer.get(), nullptr, 0, 0);
|
||||||
|
|
||||||
// Get current release date
|
// Get current release date
|
||||||
std::wstring currentReleaseCreatedAtDate = GetGithubReleaseByTag(TEXT(WSL_PACKAGE_VERSION)).created_at;
|
std::wstring currentReleaseCreatedAtDate = GetGitHubReleaseByTag(TEXT(WSL_PACKAGE_VERSION)).created_at;
|
||||||
|
|
||||||
std::tm tm = {};
|
std::tm tm = {};
|
||||||
std::wstring dateTimeFormat = L"%Y-%m-%dT%H:%M:%SZ";
|
std::wstring dateTimeFormat = L"%Y-%m-%dT%H:%M:%SZ";
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ std::pair<uint16_t, uint16_t> wsl::core::networking::GuestNetworkService::Alloca
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// N.B. Use an odd number of ports to avoid Linux kernel warning about prefering different parity for start / end values.
|
// N.B. Use an odd number of ports to avoid Linux kernel warning about preferring different parity for start / end values.
|
||||||
static constexpr auto c_ephemeralPortRangeSize = 4095;
|
static constexpr auto c_ephemeralPortRangeSize = 4095;
|
||||||
THROW_IF_FAILED(m_allocatePortRange.value()(m_service.get(), c_ephemeralPortRangeSize, &m_reservedPortRange, &port));
|
THROW_IF_FAILED(m_allocatePortRange.value()(m_service.get(), c_ephemeralPortRangeSize, &m_reservedPortRange, &port));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ wsl::core::networking::DnsInfo wsl::core::networking::HostDnsInfo::GetDnsSetting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Give precedence to interfaces that have IPv4 DNS servers, otherwise give precedence to the lower interface index.
|
// Give precedence to interfaces that have IPv4 DNS servers; otherwise, give precedence to the lower interface index.
|
||||||
return (FirstHasIpv4 ^ SecondHasIpv4) ? FirstHasIpv4 : (First->IfIndex < Second->IfIndex);
|
return (FirstHasIpv4 ^ SecondHasIpv4) ? FirstHasIpv4 : (First->IfIndex < Second->IfIndex);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ try
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WSL_LOG(
|
WSL_LOG(
|
||||||
"IpStateTracking::SyncFirewallState - FirewallTrackedIpAddresses is syncd with the preferredNetwork",
|
"IpStateTracking::SyncFirewallState - FirewallTrackedIpAddresses is synced with the preferredNetwork",
|
||||||
TraceLoggingValue(FirewallTrackedIpAddresses.size(), "FirewallTrackedIpAddresses.size"));
|
TraceLoggingValue(FirewallTrackedIpAddresses.size(), "FirewallTrackedIpAddresses.size"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ void WslCoreVm::Initialize(const GUID& VmId, const wil::shared_handle& UserToken
|
||||||
}
|
}
|
||||||
CATCH_LOG();
|
CATCH_LOG();
|
||||||
|
|
||||||
// If a private kernel was not speicifed, use the default.
|
// If a private kernel was not specified, use the default.
|
||||||
m_defaultKernel = m_vmConfig.KernelPath.empty();
|
m_defaultKernel = m_vmConfig.KernelPath.empty();
|
||||||
if (m_defaultKernel)
|
if (m_defaultKernel)
|
||||||
{
|
{
|
||||||
|
|
@ -1144,7 +1144,7 @@ ULONG WslCoreVm::AttachDiskLockHeld(
|
||||||
{
|
{
|
||||||
if (found != m_attachedDisks.end())
|
if (found != m_attachedDisks.end())
|
||||||
{
|
{
|
||||||
// Prevent user from launching a distro vhd after manually mounting it, otherwise return the LUN of the mounted disk.
|
// Prevent user from launching a distro vhd after manually mounting it; otherwise, return the LUN of the mounted disk.
|
||||||
THROW_HR_IF(WSL_E_USER_VHD_ALREADY_ATTACHED, found->first.User);
|
THROW_HR_IF(WSL_E_USER_VHD_ALREADY_ATTACHED, found->first.User);
|
||||||
|
|
||||||
return found->second.Lun;
|
return found->second.Lun;
|
||||||
|
|
@ -2521,7 +2521,7 @@ void WslCoreVm::RegisterCallbacks(_In_ const std::function<void(ULONG)>& DistroE
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// The VM has already been terminated, invoke the callback on a seperate thread.
|
// The VM has already been terminated, invoke the callback on a separate thread.
|
||||||
std::thread([terminationCallback = std::move(TerminationCallback), runtimeId = m_runtimeId]() {
|
std::thread([terminationCallback = std::move(TerminationCallback), runtimeId = m_runtimeId]() {
|
||||||
wsl::windows::common::wslutil::SetThreadDescription(L"TerminationCallback");
|
wsl::windows::common::wslutil::SetThreadDescription(L"TerminationCallback");
|
||||||
terminationCallback(runtimeId);
|
terminationCallback(runtimeId);
|
||||||
|
|
@ -2962,7 +2962,7 @@ void WslCoreVm::ValidateNetworkingMode()
|
||||||
{
|
{
|
||||||
if (!wsl::core::MirroredNetworking::IsHyperVFirewallSupported(m_vmConfig))
|
if (!wsl::core::MirroredNetworking::IsHyperVFirewallSupported(m_vmConfig))
|
||||||
{
|
{
|
||||||
// Since hyper-V firewall is enabled by default, only show the warning if the user explicitely asked for it.
|
// Since hyper-V firewall is enabled by default, only show the warning if the user explicitly asked for it.
|
||||||
if (m_vmConfig.FirewallConfigPresence == ConfigKeyPresence::Present)
|
if (m_vmConfig.FirewallConfigPresence == ConfigKeyPresence::Present)
|
||||||
{
|
{
|
||||||
EMIT_USER_WARNING(Localization::MessageHyperVFirewallNotSupported());
|
EMIT_USER_WARNING(Localization::MessageHyperVFirewallNotSupported());
|
||||||
|
|
@ -3001,7 +3001,7 @@ void WslCoreVm::ValidateNetworkingMode()
|
||||||
// If DNS tunneling was requested, ensure it is supported by Windows.
|
// If DNS tunneling was requested, ensure it is supported by Windows.
|
||||||
if (m_vmConfig.EnableDnsTunneling && !IsDnsTunnelingSupported())
|
if (m_vmConfig.EnableDnsTunneling && !IsDnsTunnelingSupported())
|
||||||
{
|
{
|
||||||
// Since DNS tunneling is enabled by default, only show the warning if the user explicitely asked for it.
|
// Since DNS tunneling is enabled by default, only show the warning if the user explicitly asked for it.
|
||||||
if (m_vmConfig.DnsTunnelingConfigPresence == ConfigKeyPresence::Present)
|
if (m_vmConfig.DnsTunnelingConfigPresence == ConfigKeyPresence::Present)
|
||||||
{
|
{
|
||||||
EMIT_USER_WARNING(Localization::MessageDnsTunnelingNotSupported());
|
EMIT_USER_WARNING(Localization::MessageDnsTunnelingNotSupported());
|
||||||
|
|
|
||||||
|
|
@ -590,7 +590,7 @@ wsl::core::networking::WslMirroredNetworkManager::WslMirroredNetworkManager(
|
||||||
// Subscribe for network change notifications. This is done before
|
// Subscribe for network change notifications. This is done before
|
||||||
// obtaining the initial list of networks to connect to, in order to
|
// obtaining the initial list of networks to connect to, in order to
|
||||||
// avoid a race condition between the initial enumeration and any network
|
// avoid a race condition between the initial enumeration and any network
|
||||||
// changes that may be occuring at the same time. The subscription will
|
// changes that may be occurring at the same time. The subscription will
|
||||||
// receive network change events, but will not be able to react to them
|
// receive network change events, but will not be able to react to them
|
||||||
// the lock is released.
|
// the lock is released.
|
||||||
m_hcnCallback = windows::common::hcs::RegisterServiceCallback(HcnCallback, this);
|
m_hcnCallback = windows::common::hcs::RegisterServiceCallback(HcnCallback, this);
|
||||||
|
|
@ -1026,7 +1026,7 @@ _Check_return_ bool wsl::core::networking::WslMirroredNetworkManager::SyncIpStat
|
||||||
const auto makingIpInterfaceUpdate = endpoint.Network->PendingIPInterfaceUpdate;
|
const auto makingIpInterfaceUpdate = endpoint.Network->PendingIPInterfaceUpdate;
|
||||||
// Linux may delete routes behind us when making interface, address, and route changes
|
// Linux may delete routes behind us when making interface, address, and route changes
|
||||||
// will track when to refresh v4 and v6 routes to ensure routes are still present after changes
|
// will track when to refresh v4 and v6 routes to ensure routes are still present after changes
|
||||||
// a few custmomers have seen this when we update temporary v6 addresses, for example
|
// a few customers have seen this when we update temporary v6 addresses, for example
|
||||||
auto refreshAllRoutes = false;
|
auto refreshAllRoutes = false;
|
||||||
|
|
||||||
// First: update Linux with any interface updates
|
// First: update Linux with any interface updates
|
||||||
|
|
@ -1237,7 +1237,7 @@ _Check_return_ bool wsl::core::networking::WslMirroredNetworkManager::SyncIpStat
|
||||||
{
|
{
|
||||||
auto trackedAddress = endpoint.StateTracking->IpAddresses.emplace(TrackedIpAddress(hostAddress)).first;
|
auto trackedAddress = endpoint.StateTracking->IpAddresses.emplace(TrackedIpAddress(hostAddress)).first;
|
||||||
// detect if previously sync'd addresses need to be updated
|
// detect if previously sync'd addresses need to be updated
|
||||||
// this addresses issues we've seen where addresses were removed from Linux without our knowlege
|
// this addresses issues we've seen where addresses were removed from Linux without our knowledge
|
||||||
shouldRefreshAllAddresses |= trackedAddress->SyncStatus == PendingAdd || trackedAddress->SyncStatus == PendingUpdate;
|
shouldRefreshAllAddresses |= trackedAddress->SyncStatus == PendingAdd || trackedAddress->SyncStatus == PendingUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1383,7 +1383,7 @@ _Check_return_ bool wsl::core::networking::WslMirroredNetworkManager::SyncIpStat
|
||||||
{
|
{
|
||||||
const auto trackedRoute = endpoint.StateTracking->Routes.emplace(TrackedRoute(hostRoute)).first;
|
const auto trackedRoute = endpoint.StateTracking->Routes.emplace(TrackedRoute(hostRoute)).first;
|
||||||
// detect if previously sync'd routes need to be updated
|
// detect if previously sync'd routes need to be updated
|
||||||
// this addresses issues we've seen where routes were removed from Linux without our knowlege
|
// this addresses issues we've seen where routes were removed from Linux without our knowledge
|
||||||
// and routes couldn't be updated later because required routes, like the prefix route, wasn't there
|
// and routes couldn't be updated later because required routes, like the prefix route, wasn't there
|
||||||
refreshAllRoutes |= trackedRoute->SyncStatus == PendingAdd || trackedRoute->SyncStatus == PendingUpdate;
|
refreshAllRoutes |= trackedRoute->SyncStatus == PendingAdd || trackedRoute->SyncStatus == PendingUpdate;
|
||||||
}
|
}
|
||||||
|
|
@ -1686,7 +1686,7 @@ try
|
||||||
// mirroredConnectedInterfaces won't equal m_hostConnectedInterfaces when:
|
// mirroredConnectedInterfaces won't equal m_hostConnectedInterfaces when:
|
||||||
// - there are hidden host interfaces
|
// - there are hidden host interfaces
|
||||||
// i.e., interfaces are in m_networkEndpoints but not in m_hostConnectedInterfaces
|
// i.e., interfaces are in m_networkEndpoints but not in m_hostConnectedInterfaces
|
||||||
// - when HNS hasn't yet mirrored an connected host interface
|
// - when HNS hasn't yet mirrored a connected host interface
|
||||||
// i.e. interfaces are in m_hostConnectedInterfaces but not in m_networkEndpoints
|
// i.e. interfaces are in m_hostConnectedInterfaces but not in m_networkEndpoints
|
||||||
//
|
//
|
||||||
// if HNS has not yet mirrored a host interface, we should not indicate we are in sync
|
// if HNS has not yet mirrored a host interface, we should not indicate we are in sync
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ interface IVmFiovGuestMemoryFastNotification : IUnknown
|
||||||
]
|
]
|
||||||
interface ICallingProcessInfo : IUnknown
|
interface ICallingProcessInfo : IUnknown
|
||||||
{
|
{
|
||||||
HRESULT OpenCallerProcessHandle(DWORD desiredAccess, [out, annotation("_Out_")] HANDLE *callerPocessHandle);
|
HRESULT OpenCallerProcessHandle(DWORD desiredAccess, [out, annotation("_Out_")] HANDLE *callerProcessHandle);
|
||||||
};
|
};
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -220,8 +220,8 @@ try
|
||||||
|
|
||||||
// Launch the interop server.
|
// Launch the interop server.
|
||||||
//
|
//
|
||||||
// See Github #7568. There needs to be a console for interop.
|
// See GitHub #7568. There needs to be a console for interop.
|
||||||
// From Github #8161 we learned we can't be attached to the same
|
// From GitHub #8161 we learned we can't be attached to the same
|
||||||
// console as wsl.exe. If we are we will be terminated and unable
|
// console as wsl.exe. If we are we will be terminated and unable
|
||||||
// to serve daemonized processes after the console is closed.
|
// to serve daemonized processes after the console is closed.
|
||||||
wsl::windows::common::helpers::CreateConsole(nullptr);
|
wsl::windows::common::helpers::CreateConsole(nullptr);
|
||||||
|
|
@ -258,7 +258,7 @@ try
|
||||||
{
|
{
|
||||||
wsl::shared::SocketChannel channel{wil::unique_socket{reinterpret_cast<SOCKET>(handle.release())}, "Interop-wslhost"};
|
wsl::shared::SocketChannel channel{wil::unique_socket{reinterpret_cast<SOCKET>(handle.release())}, "Interop-wslhost"};
|
||||||
|
|
||||||
// This is required because there could have been messages beetween the process and wsl.exe, and wslhost has no way to know what the sequence numbers were.
|
// This is required because there could have been messages between the process and wsl.exe, and wslhost has no way to know what the sequence numbers were.
|
||||||
channel.IgnoreSequenceNumbers();
|
channel.IgnoreSequenceNumbers();
|
||||||
|
|
||||||
wsl::windows::common::interop::VmModeWorkerThread(channel, vmId, true);
|
wsl::windows::common::interop::VmModeWorkerThread(channel, vmId, true);
|
||||||
|
|
|
||||||
|
|
@ -479,7 +479,7 @@ extern "C" UINT __stdcall CleanMsixState(MSIHANDLE install)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Because of a probable bug in MSIX / Packaged COM, it's possible that an old registration is still present on the machine,
|
* Because of a probable bug in MSIX / Packaged COM, it's possible that an old registration is still present on the machine,
|
||||||
* which will break instanciations of LxssUserSessions.
|
* which will break instantiations of LxssUserSessions.
|
||||||
* Because this method executes after all MSIX packages have been removed, we know that this registration shouldn't be there,
|
* Because this method executes after all MSIX packages have been removed, we know that this registration shouldn't be there,
|
||||||
* so delete it if it still happens to be there.
|
* so delete it if it still happens to be there.
|
||||||
* See: https://github.com/microsoft/WSL/issues/10782
|
* See: https://github.com/microsoft/WSL/issues/10782
|
||||||
|
|
@ -598,7 +598,7 @@ catch (...)
|
||||||
wsl::windows::common::filesystem::TempFile ExtractMsix(MSIHANDLE install)
|
wsl::windows::common::filesystem::TempFile ExtractMsix(MSIHANDLE install)
|
||||||
{
|
{
|
||||||
// N.B. We need to open the database this way instead of calling MsiGetActiveDatabase() because
|
// N.B. We need to open the database this way instead of calling MsiGetActiveDatabase() because
|
||||||
// this is defered action so we don't have access to the MSI context here.
|
// this is deferred action so we don't have access to the MSI context here.
|
||||||
// The MSIX needs to be extracted like this because in the case of an upgrade this action runs before 'MoveFiles' so the WSL directory isn't available yet.
|
// The MSIX needs to be extracted like this because in the case of an upgrade this action runs before 'MoveFiles' so the WSL directory isn't available yet.
|
||||||
|
|
||||||
const auto installTarget = GetInstallTarget(install);
|
const auto installTarget = GetInstallTarget(install);
|
||||||
|
|
@ -699,7 +699,7 @@ try
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
// For convenience, automatically trust the MSIX's certificate if this is NOT an official build and
|
// For convenience, automatically trust the MSIX's certificate if this is NOT an official build and
|
||||||
// the package installation failed because of an unstrusted certificate.
|
// the package installation failed because of an untrusted certificate.
|
||||||
#ifndef WSL_OFFICIAL_BUILD
|
#ifndef WSL_OFFICIAL_BUILD
|
||||||
auto error = wil::ResultFromCaughtException();
|
auto error = wil::ResultFromCaughtException();
|
||||||
if (error == CERT_E_UNTRUSTEDROOT)
|
if (error == CERT_E_UNTRUSTEDROOT)
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ void wsl::windows::wslrelay::localhost::Relay::StopPortListener(_In_ unsigned sh
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Search through the woker threads and terminate any that match the address family and port.
|
// Search through the worker threads and terminate any that match the address family and port.
|
||||||
auto lock = m_lock.lock_exclusive();
|
auto lock = m_lock.lock_exclusive();
|
||||||
const auto iter = m_RelayThreads.find({Family, Port});
|
const auto iter = m_RelayThreads.find({Family, Port});
|
||||||
if (iter != m_RelayThreads.end())
|
if (iter != m_RelayThreads.end())
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public class RuntimeHelper
|
||||||
return openPicker.PickSingleFileAsync();
|
return openPicker.PickSingleFileAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TryMoveFocusPrevousControl(Button? button)
|
public static void TryMoveFocusPreviousControl(Button? button)
|
||||||
{
|
{
|
||||||
if (button == null)
|
if (button == null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace LibWsl
|
||||||
AutoProxyEnabled = 11,
|
AutoProxyEnabled = 11,
|
||||||
InitialAutoProxyTimeout = 12,
|
InitialAutoProxyTimeout = 12,
|
||||||
DNSProxyEnabled = 13,
|
DNSProxyEnabled = 13,
|
||||||
DNSTunellingEnabled = 14,
|
DNSTunnelingEnabled = 14,
|
||||||
BestEffortDNSParsingEnabled = 15,
|
BestEffortDNSParsingEnabled = 15,
|
||||||
AutoMemoryReclaim = 16,
|
AutoMemoryReclaim = 16,
|
||||||
GUIApplicationsEnabled = 17,
|
GUIApplicationsEnabled = 17,
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ public partial class NetworkingViewModel : WslConfigSettingViewModel
|
||||||
_autoProxy = wslConfigService.GetWslConfigSetting(WslConfigEntry.AutoProxyEnabled);
|
_autoProxy = wslConfigService.GetWslConfigSetting(WslConfigEntry.AutoProxyEnabled);
|
||||||
_initialAutoProxyTimeout = wslConfigService.GetWslConfigSetting(WslConfigEntry.InitialAutoProxyTimeout);
|
_initialAutoProxyTimeout = wslConfigService.GetWslConfigSetting(WslConfigEntry.InitialAutoProxyTimeout);
|
||||||
_dNSProxy = wslConfigService.GetWslConfigSetting(WslConfigEntry.DNSProxyEnabled);
|
_dNSProxy = wslConfigService.GetWslConfigSetting(WslConfigEntry.DNSProxyEnabled);
|
||||||
_dNSTunneling = wslConfigService.GetWslConfigSetting(WslConfigEntry.DNSTunellingEnabled);
|
_dNSTunneling = wslConfigService.GetWslConfigSetting(WslConfigEntry.DNSTunnelingEnabled);
|
||||||
_bestEffortDNS = wslConfigService.GetWslConfigSetting(WslConfigEntry.BestEffortDNSParsingEnabled);
|
_bestEffortDNS = wslConfigService.GetWslConfigSetting(WslConfigEntry.BestEffortDNSParsingEnabled);
|
||||||
|
|
||||||
string defaultIgnoredPorts = wslConfigService.GetWslConfigSetting(WslConfigEntry.IgnoredPorts, true).StringValue;
|
string defaultIgnoredPorts = wslConfigService.GetWslConfigSetting(WslConfigEntry.IgnoredPorts, true).StringValue;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace WslSettings.ViewModels.Settings
|
||||||
{
|
{
|
||||||
if (newValue == null || !regex.IsMatch(newValue))
|
if (newValue == null || !regex.IsMatch(newValue))
|
||||||
{
|
{
|
||||||
// Notify the property so it can revert back to its' previous value.
|
// Notify the property so it can revert back to its previous value.
|
||||||
OnPropertyChanged(propertyName);
|
OnPropertyChanged(propertyName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public sealed partial class FileSystemPage : Page
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RuntimeHelper.TryMoveFocusPrevousControl(sender as Button);
|
RuntimeHelper.TryMoveFocusPreviousControl(sender as Button);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DefaultVHDSizeTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
private void DefaultVHDSizeTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ public sealed partial class MemAndProcPage : Page
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RuntimeHelper.TryMoveFocusPrevousControl(sender as Button);
|
RuntimeHelper.TryMoveFocusPreviousControl(sender as Button);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void SwapFilePath_Click(object sender, RoutedEventArgs e)
|
public async void SwapFilePath_Click(object sender, RoutedEventArgs e)
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public sealed partial class NetworkingPage : Page
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RuntimeHelper.TryMoveFocusPrevousControl(sender as Button);
|
RuntimeHelper.TryMoveFocusPreviousControl(sender as Button);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitialAutoProxyTimeoutTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
private void InitialAutoProxyTimeoutTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public sealed partial class OptionalFeaturesPage : Page
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RuntimeHelper.TryMoveFocusPrevousControl(sender as Button);
|
RuntimeHelper.TryMoveFocusPreviousControl(sender as Button);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VMIdleTimeoutTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
private void VMIdleTimeoutTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ For example, consider the file below, named `ExampleTest.cpp`:
|
||||||
|
|
||||||
#include "Common.h" // referring to /test/Common.h, where general utility functions for interacting with WSL in regards to testing reside
|
#include "Common.h" // referring to /test/Common.h, where general utility functions for interacting with WSL in regards to testing reside
|
||||||
|
|
||||||
#define INLINE_TEST_METHOD_MARKUP // optional, but defined within the directory cmake build instructions. this is the practice that the pre-existing tests use
|
#define INLINE_TEST_METHOD_MARKUP // optional, but defined within the directory cmake build instructions. this is the practice that the preexisting tests use
|
||||||
|
|
||||||
namespace ExampleTest
|
namespace ExampleTest
|
||||||
{
|
{
|
||||||
|
|
@ -107,13 +107,13 @@ For example, consider the file below, named `ExampleTest.cpp`:
|
||||||
} //namespace ExampleTest
|
} //namespace ExampleTest
|
||||||
```
|
```
|
||||||
|
|
||||||
For more in-depth examples of writing TAEF tests, check out `/tests/MountTests.cpp` and [here](https://docs.microsoft.com/windows-hardware/drivers/taef/authoring-tests-in-c--#advanced-authoring-tests-in-c).
|
For more in-depth examples of writing TAEF tests, check out `/tests/MountTests.cpp` and [Advanced Authoring Tests in C++](https://docs.microsoft.com/windows-hardware/drivers/taef/authoring-tests-in-c--#advanced-authoring-tests-in-c).
|
||||||
|
|
||||||
## Building Tests
|
## Building Tests
|
||||||
|
|
||||||
### CMake
|
### CMake
|
||||||
|
|
||||||
For examples on how to get your test/s building within the repo, please view `/test/CMakeLists.txt` for the structure of creating add to the `wsltest.dll`. For additional information on how to use CMake, try [here](https://cmake.org/documentation/).
|
For examples on how to get your test/s building within the repo, please view `/test/CMakeLists.txt` for the structure of creating add to the `wsltest.dll`. For additional information on how to use CMake, try [CMake Documentation and Community](https://cmake.org/documentation/).
|
||||||
|
|
||||||
### Building
|
### Building
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,7 @@ Return Value:
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check that removing the first directory fails if a thread is still
|
// Check that removing the first directory fails if a thread is still
|
||||||
// associated, otherwise it succeeds.
|
// associated; otherwise, it succeeds.
|
||||||
//
|
//
|
||||||
|
|
||||||
LxtCheckErrno(mkdir(CGROUP_TEST_MOUNT_POINT_DIR1, 0777));
|
LxtCheckErrno(mkdir(CGROUP_TEST_MOUNT_POINT_DIR1, 0777));
|
||||||
|
|
@ -390,7 +390,7 @@ ErrorExit:
|
||||||
typedef struct _CGROUP_TEST_PROCFS_ENTRY
|
typedef struct _CGROUP_TEST_PROCFS_ENTRY
|
||||||
{
|
{
|
||||||
char Name[CGROUP_TEST_MAX_NAME_LENGTH];
|
char Name[CGROUP_TEST_MAX_NAME_LENGTH];
|
||||||
int Hierarcy;
|
int Hierarchy;
|
||||||
int NumCgroups;
|
int NumCgroups;
|
||||||
int Enabled;
|
int Enabled;
|
||||||
} CGROUP_TEST_PROCFS_ENTRY, *PCGROUP_TEST_PROCFS_ENTRY;
|
} CGROUP_TEST_PROCFS_ENTRY, *PCGROUP_TEST_PROCFS_ENTRY;
|
||||||
|
|
@ -444,7 +444,7 @@ Return Value:
|
||||||
Line,
|
Line,
|
||||||
"%s\t%d\t%d\t%d",
|
"%s\t%d\t%d\t%d",
|
||||||
Data->Entries[NumCgroups].Name,
|
Data->Entries[NumCgroups].Name,
|
||||||
&Data->Entries[NumCgroups].Hierarcy,
|
&Data->Entries[NumCgroups].Hierarchy,
|
||||||
&Data->Entries[NumCgroups].NumCgroups,
|
&Data->Entries[NumCgroups].NumCgroups,
|
||||||
&Data->Entries[NumCgroups].Enabled);
|
&Data->Entries[NumCgroups].Enabled);
|
||||||
|
|
||||||
|
|
@ -464,7 +464,7 @@ ErrorExit:
|
||||||
|
|
||||||
typedef struct _CGROUP_TEST_PROCFS_PID_ENTRY
|
typedef struct _CGROUP_TEST_PROCFS_PID_ENTRY
|
||||||
{
|
{
|
||||||
int Hierarcy;
|
int Hierarchy;
|
||||||
char Subsystems[CGROUP_TEST_DEFAULT_BUFFER_SIZE];
|
char Subsystems[CGROUP_TEST_DEFAULT_BUFFER_SIZE];
|
||||||
char CgroupPath[CGROUP_TEST_DEFAULT_BUFFER_SIZE];
|
char CgroupPath[CGROUP_TEST_DEFAULT_BUFFER_SIZE];
|
||||||
} CGROUP_TEST_PROCFS_PID_ENTRY, *PCGROUP_TEST_PROCFS_PID_ENTRY;
|
} CGROUP_TEST_PROCFS_PID_ENTRY, *PCGROUP_TEST_PROCFS_PID_ENTRY;
|
||||||
|
|
@ -510,7 +510,7 @@ Return Value:
|
||||||
sscanf(
|
sscanf(
|
||||||
Line,
|
Line,
|
||||||
"%d:%[^:]:%[^:\n]",
|
"%d:%[^:]:%[^:\n]",
|
||||||
&Data->Entries[NumCgroups].Hierarcy,
|
&Data->Entries[NumCgroups].Hierarchy,
|
||||||
Data->Entries[NumCgroups].Subsystems,
|
Data->Entries[NumCgroups].Subsystems,
|
||||||
Data->Entries[NumCgroups].CgroupPath);
|
Data->Entries[NumCgroups].CgroupPath);
|
||||||
|
|
||||||
|
|
@ -580,7 +580,7 @@ Return Value:
|
||||||
if (strcmp(ProcfsNew.Entries[Index].Name, "devices") == 0)
|
if (strcmp(ProcfsNew.Entries[Index].Name, "devices") == 0)
|
||||||
{
|
{
|
||||||
LxtCheckNotEqual(Found, 1, "%d");
|
LxtCheckNotEqual(Found, 1, "%d");
|
||||||
LxtCheckNotEqual(ProcfsNew.Entries[Index].Hierarcy, 0, "%d");
|
LxtCheckNotEqual(ProcfsNew.Entries[Index].Hierarchy, 0, "%d");
|
||||||
Found = 1;
|
Found = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -598,7 +598,7 @@ Return Value:
|
||||||
if (strstr(ProcfsPidNew.Entries[Index].Subsystems, "devices") != NULL)
|
if (strstr(ProcfsPidNew.Entries[Index].Subsystems, "devices") != NULL)
|
||||||
{
|
{
|
||||||
LxtCheckNotEqual(Found, 1, "%d");
|
LxtCheckNotEqual(Found, 1, "%d");
|
||||||
LxtCheckNotEqual(ProcfsPidNew.Entries[Index].Hierarcy, 0, "%d");
|
LxtCheckNotEqual(ProcfsPidNew.Entries[Index].Hierarchy, 0, "%d");
|
||||||
LxtCheckStringEqual(ProcfsPidNew.Entries[Index].CgroupPath, "/");
|
LxtCheckStringEqual(ProcfsPidNew.Entries[Index].CgroupPath, "/");
|
||||||
Found = 1;
|
Found = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -933,7 +933,7 @@ Return Value:
|
||||||
if (strcmp(ProcfsNew.Entries[Index].Name, "devices") == 0)
|
if (strcmp(ProcfsNew.Entries[Index].Name, "devices") == 0)
|
||||||
{
|
{
|
||||||
LxtCheckNotEqual(Found, 1, "%d");
|
LxtCheckNotEqual(Found, 1, "%d");
|
||||||
LxtCheckNotEqual(ProcfsNew.Entries[Index].Hierarcy, 0, "%d");
|
LxtCheckNotEqual(ProcfsNew.Entries[Index].Hierarchy, 0, "%d");
|
||||||
Found = 1;
|
Found = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ Return Value:
|
||||||
LxtCheckErrno(BytesRead = recv(Fd, Buffer, sizeof(Buffer), 0));
|
LxtCheckErrno(BytesRead = recv(Fd, Buffer, sizeof(Buffer), 0));
|
||||||
if (BytesRead != 0)
|
if (BytesRead != 0)
|
||||||
{
|
{
|
||||||
LxtLogError("recv should return 0 bytes read, but it retured %d bytes", BytesRead);
|
LxtLogError("recv should return 0 bytes read, but it returned %d bytes", BytesRead);
|
||||||
|
|
||||||
goto ErrorExit;
|
goto ErrorExit;
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +158,7 @@ Return Value:
|
||||||
LxtCheckErrno(BytesRead = recv(Fd, Buffer, 0, 0));
|
LxtCheckErrno(BytesRead = recv(Fd, Buffer, 0, 0));
|
||||||
if (BytesRead != 0)
|
if (BytesRead != 0)
|
||||||
{
|
{
|
||||||
LxtLogError("recv should return 0 bytes read, but it retured %d bytes", BytesRead);
|
LxtLogError("recv should return 0 bytes read, but it returned %d bytes", BytesRead);
|
||||||
|
|
||||||
goto ErrorExit;
|
goto ErrorExit;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue