wslapi.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _WSLAPI_H_
  7. #define _WSLAPI_H_
  8. #include <apiset.h>
  9. #include <apisetcconv.h>
  10. #include <wtypes.h>
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  15. BOOL WslIsDistributionRegistered(PCWSTR distributionName);
  16. HRESULT WslRegisterDistribution(PCWSTR distributionName, PCWSTR tarGzFilename);
  17. HRESULT WslUnregisterDistribution(PCWSTR distributionName);
  18. typedef enum {
  19. WSL_DISTRIBUTION_FLAGS_NONE = 0x0,
  20. WSL_DISTRIBUTION_FLAGS_ENABLE_INTEROP = 0x1,
  21. WSL_DISTRIBUTION_FLAGS_APPEND_NT_PATH = 0x2,
  22. WSL_DISTRIBUTION_FLAGS_ENABLE_DRIVE_MOUNTING = 0x4
  23. } WSL_DISTRIBUTION_FLAGS;
  24. #define WSL_DISTRIBUTION_FLAGS_VALID (WSL_DISTRIBUTION_FLAGS_ENABLE_INTEROP | WSL_DISTRIBUTION_FLAGS_APPEND_NT_PATH | WSL_DISTRIBUTION_FLAGS_ENABLE_DRIVE_MOUNTING)
  25. #define WSL_DISTRIBUTION_FLAGS_DEFAULT (WSL_DISTRIBUTION_FLAGS_ENABLE_INTEROP | WSL_DISTRIBUTION_FLAGS_APPEND_NT_PATH | WSL_DISTRIBUTION_FLAGS_ENABLE_DRIVE_MOUNTING)
  26. HRESULT WslConfigureDistribution(PCWSTR distributionName, ULONG defaultUID, WSL_DISTRIBUTION_FLAGS wslDistributionFlags);
  27. HRESULT WslGetDistributionConfiguration(PCWSTR distributionName, ULONG* distributionVersion, ULONG* defaultUID, WSL_DISTRIBUTION_FLAGS* wslDistributionFlags, PSTR** defaultEnvironmentVariables, ULONG* defaultEnvironmentVariableCount);
  28. HRESULT WslLaunchInteractive(PCWSTR distributionName, PCWSTR command, BOOL useCurrentWorkingDirectory, DWORD* exitCode);
  29. HRESULT WslLaunch(PCWSTR distributionName, PCWSTR command, BOOL useCurrentWorkingDirectory, HANDLE stdIn, HANDLE stdOut, HANDLE stdErr, HANDLE* process);
  30. #endif
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif