Skip to content

Commit

Permalink
Fixed ci pipeline.
Browse files Browse the repository at this point in the history
Updated readme.
  • Loading branch information
Gitii committed Dec 25, 2021
1 parent 57ce77b commit 559eae4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -20,7 +20,12 @@ jobs:
5.0.x
6.0.x
- name: Decode the Pfx
run: echo "${{ secrets.SIGNING_KEY }}" | base64 --decode > ./sgKey.snk
run: |
$signing_keys_payload = [System.Convert]::FromBase64String("${{ secrets.SIGNING_KEY }}")
$currentDirectory = Get-Location
$certificatePath = Join-Path -Path $currentDirectory -ChildPath "sgKey.snk"
[IO.File]::WriteAllBytes("$certificatePath", $signing_keys_payload)
if (-! $?) { exit 1 } else { exit $LastExitCode }
- name: Build
run: dotnet build --configuration Release
- name: Test
Expand Down
28 changes: 15 additions & 13 deletions Community.Wsl.Sdk/Strategies/NativeMethods/BaseNativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,17 @@ public enum DistroFlags
/// No flags are being supplied.
/// </summary>
None = 0x0,

/// <summary>
/// Allow the distribution to interoperate with Windows processes (for example, the user can invoke "cmd.exe" or "notepad.exe" from within a WSL session).
/// </summary>
EnableInterop = 0x1,

/// <summary>
/// Add the Windows %PATH% environment variable values to WSL sessions.
/// </summary>
AppendNtPath = 0x2,

/// <summary>
/// Automatically mount Windows drives inside of WSL sessions (for example, "C:" will be available under "/mnt/c").
/// </summary>
Expand Down Expand Up @@ -112,9 +115,7 @@ int nSize
);

public const int STD_INPUT_HANDLE = -10;

public const int STD_OUTPUT_HANDLE = -11;

public const int STD_ERROR_HANDLE = -12;

public abstract IntPtr GetStdHandle(int nStdHandle);
Expand All @@ -123,10 +124,10 @@ int nSize

public abstract int WaitForSingleObject(IntPtr hHandle, int dwMilliseconds);

public const int WAIT_ABANDONED = 0x00000080,
WAIT_OBJECT_0 = 0x00000000,
WAIT_TIMEOUT = 0x00000102,
WAIT_FAILED = unchecked((int)0xFFFFFFFF);
public const int WAIT_ABANDONED = 0x00000080;
public const int WAIT_OBJECT_0 = 0x00000000;
public const int WAIT_TIMEOUT = 0x00000102;
public const int WAIT_FAILED = unchecked((int)0xFFFFFFFF);

public abstract bool GetExitCodeProcess(IntPtr hProcess, out int lpExitCode);

Expand All @@ -135,13 +136,11 @@ int nSize
[StructLayout(LayoutKind.Sequential)]
public struct SECURITY_ATTRIBUTES
{
[MarshalAs(UnmanagedType.U4)]
public int nLength;
[MarshalAs(UnmanagedType.U4)] public int nLength;

public IntPtr lpSecurityDescriptor;

[MarshalAs(UnmanagedType.Bool)]
public bool bInheritHandle;
[MarshalAs(UnmanagedType.Bool)] public bool bInheritHandle;
}

public abstract bool DuplicateHandle(
Expand All @@ -157,10 +156,13 @@ DuplicateOptions dwOptions
[Flags]
public enum DuplicateOptions : uint
{
DUPLICATE_CLOSE_SOURCE = (0x00000001), // Closes the source handle. This occurs regardless of any error status returned.
DUPLICATE_SAME_ACCESS = (0x00000002) //Ignores the dwDesiredAccess parameter. The duplicate handle has the same access as the source handle.
DUPLICATE_CLOSE_SOURCE =
(0x00000001), // Closes the source handle. This occurs regardless of any error status returned.

DUPLICATE_SAME_ACCESS =
(0x00000002) //Ignores the dwDesiredAccess parameter. The duplicate handle has the same access as the source handle.
}

public const uint STILL_ACTIVE = 0x00000103;
}
}
}
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ features into existing Windows applications. You can enumerate, query, executing

## Supported Operating Systems

- Windows 10 x64 16299 or higher
- Windows 10 x64 16299 or higher
- Windows 11 x64

## How to use
Expand All @@ -24,6 +24,15 @@ There are two different implementations of `IWslApi`:

It's recommended to use the alternative because it's more versatile and easier to use.

## How to install

This package is available on `nuget.org`: https://www.nuget.org/packages/Community.Wsl.Sdk
You can add a reference using `dotnet / nuget`:

```shell
dotnet add package Community.Wsl.Sdk
```

## API

### WSL Api
Expand Down

0 comments on commit 559eae4

Please sign in to comment.