microsoft / microsoft/WSL

Add executable to invoke Windows interop directly

Open
#9,204 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

**Is your feature request related to a problem? Please describe.**

There are multiple possible handlers for PE files under WSL. One of them is Windows interop; others include Mono and WINE. (Admittedly the use cases for running WINE under WSL are few, but not zero.) This requires that you disable the binfmt handlers for all but one of them in order to get the handler you want to prioritize, while invoking the others manually - i.e.,

`mono .\example.exe`

Trouble is, if the one you use most often isn't Windows interop but you do want to use Windows interop, there isn't a way to invoke interop manually.

**Describe the solution you'd like**
Provide an executable - say, _winstart_, or some such name - which invokes Windows interop in the same way as the binfmt handler, but which can be invoked manually as

`winstart /mnt/c/Windows/notepad.exe`

**Describe alternatives you've considered**
Any number of ugly kluges involving switching around binfmt handlers at the last minute.

**Additional context**
None.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the existing Windows interop binfmt handler and how it is invoked for PE files under WSL. Define the executable's command-line behavior around the proposed `winstart /mnt/c/Windows/notepad.exe` example, and verify that it invokes Windows interop manually without requiring binfmt handler changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.