1 #![allow(unused_variables, non_upper_case_globals, non_snake_case, unused_unsafe, non_camel_case_types, dead_code, clippy::all)]
2 #[derive(:: std :: cmp :: PartialEq, :: std :: cmp :: Eq, :: std :: marker :: Copy, :: std :: clone :: Clone, :: std :: default :: Default, :: std :: fmt :: Debug)]
3 #[repr(transparent)]
4 pub struct WSL_DISTRIBUTION_FLAGS(pub u32);
5 pub const WSL_DISTRIBUTION_FLAGS_NONE: WSL_DISTRIBUTION_FLAGS = WSL_DISTRIBUTION_FLAGS(0u32);
6 pub const WSL_DISTRIBUTION_FLAGS_ENABLE_INTEROP: WSL_DISTRIBUTION_FLAGS = WSL_DISTRIBUTION_FLAGS(1u32);
7 pub const WSL_DISTRIBUTION_FLAGS_APPEND_NT_PATH: WSL_DISTRIBUTION_FLAGS = WSL_DISTRIBUTION_FLAGS(2u32);
8 pub const WSL_DISTRIBUTION_FLAGS_ENABLE_DRIVE_MOUNTING: WSL_DISTRIBUTION_FLAGS = WSL_DISTRIBUTION_FLAGS(4u32);
9 impl ::std::convert::From<u32> for WSL_DISTRIBUTION_FLAGS {
from(value: u32) -> Self10     fn from(value: u32) -> Self {
11         Self(value)
12     }
13 }
14 unsafe impl ::windows::runtime::Abi for WSL_DISTRIBUTION_FLAGS {
15     type Abi = Self;
16     type DefaultType = Self;
17 }
18 impl ::std::ops::BitOr for WSL_DISTRIBUTION_FLAGS {
19     type Output = Self;
bitor(self, rhs: Self) -> Self20     fn bitor(self, rhs: Self) -> Self {
21         Self(self.0 | rhs.0)
22     }
23 }
24 impl ::std::ops::BitAnd for WSL_DISTRIBUTION_FLAGS {
25     type Output = Self;
bitand(self, rhs: Self) -> Self26     fn bitand(self, rhs: Self) -> Self {
27         Self(self.0 & rhs.0)
28     }
29 }
30 impl ::std::ops::BitOrAssign for WSL_DISTRIBUTION_FLAGS {
bitor_assign(&mut self, rhs: Self)31     fn bitor_assign(&mut self, rhs: Self) {
32         self.0.bitor_assign(rhs.0)
33     }
34 }
35 impl ::std::ops::BitAndAssign for WSL_DISTRIBUTION_FLAGS {
bitand_assign(&mut self, rhs: Self)36     fn bitand_assign(&mut self, rhs: Self) {
37         self.0.bitand_assign(rhs.0)
38     }
39 }
40 impl ::std::ops::Not for WSL_DISTRIBUTION_FLAGS {
41     type Output = Self;
not(self) -> Self42     fn not(self) -> Self {
43         Self(self.0.not())
44     }
45 }
46 #[cfg(feature = "Win32_Foundation")]
47 #[inline]
WslConfigureDistribution<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>>(distributionname: Param0, defaultuid: u32, wsldistributionflags: WSL_DISTRIBUTION_FLAGS) -> ::windows::runtime::Result<()>48 pub unsafe fn WslConfigureDistribution<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>>(distributionname: Param0, defaultuid: u32, wsldistributionflags: WSL_DISTRIBUTION_FLAGS) -> ::windows::runtime::Result<()> {
49     #[cfg(windows)]
50     {
51         #[link(name = "windows")]
52         extern "system" {
53             fn WslConfigureDistribution(distributionname: super::super::Foundation::PWSTR, defaultuid: u32, wsldistributionflags: WSL_DISTRIBUTION_FLAGS) -> ::windows::runtime::HRESULT;
54         }
55         WslConfigureDistribution(distributionname.into_param().abi(), ::std::mem::transmute(defaultuid), ::std::mem::transmute(wsldistributionflags)).ok()
56     }
57     #[cfg(not(windows))]
58     unimplemented!("Unsupported target OS");
59 }
60 #[cfg(feature = "Win32_Foundation")]
61 #[inline]
WslGetDistributionConfiguration<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>>(distributionname: Param0, distributionversion: *mut u32, defaultuid: *mut u32, wsldistributionflags: *mut WSL_DISTRIBUTION_FLAGS, defaultenvironmentvariables: *mut *mut super::super::Foundation::PSTR, defaultenvironmentvariablecount: *mut u32) -> ::windows::runtime::Result<()>62 pub unsafe fn WslGetDistributionConfiguration<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>>(distributionname: Param0, distributionversion: *mut u32, defaultuid: *mut u32, wsldistributionflags: *mut WSL_DISTRIBUTION_FLAGS, defaultenvironmentvariables: *mut *mut super::super::Foundation::PSTR, defaultenvironmentvariablecount: *mut u32) -> ::windows::runtime::Result<()> {
63     #[cfg(windows)]
64     {
65         #[link(name = "windows")]
66         extern "system" {
67             fn WslGetDistributionConfiguration(distributionname: super::super::Foundation::PWSTR, distributionversion: *mut u32, defaultuid: *mut u32, wsldistributionflags: *mut WSL_DISTRIBUTION_FLAGS, defaultenvironmentvariables: *mut *mut super::super::Foundation::PSTR, defaultenvironmentvariablecount: *mut u32) -> ::windows::runtime::HRESULT;
68         }
69         WslGetDistributionConfiguration(distributionname.into_param().abi(), ::std::mem::transmute(distributionversion), ::std::mem::transmute(defaultuid), ::std::mem::transmute(wsldistributionflags), ::std::mem::transmute(defaultenvironmentvariables), ::std::mem::transmute(defaultenvironmentvariablecount)).ok()
70     }
71     #[cfg(not(windows))]
72     unimplemented!("Unsupported target OS");
73 }
74 #[cfg(feature = "Win32_Foundation")]
75 #[inline]
WslIsDistributionRegistered<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>>(distributionname: Param0) -> super::super::Foundation::BOOL76 pub unsafe fn WslIsDistributionRegistered<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>>(distributionname: Param0) -> super::super::Foundation::BOOL {
77     #[cfg(windows)]
78     {
79         #[link(name = "windows")]
80         extern "system" {
81             fn WslIsDistributionRegistered(distributionname: super::super::Foundation::PWSTR) -> super::super::Foundation::BOOL;
82         }
83         ::std::mem::transmute(WslIsDistributionRegistered(distributionname.into_param().abi()))
84     }
85     #[cfg(not(windows))]
86     unimplemented!("Unsupported target OS");
87 }
88 #[cfg(feature = "Win32_Foundation")]
89 #[inline]
WslLaunch<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::runtime::IntoParam<'a, super::super::Foundation::BOOL>, Param3: ::windows::runtime::IntoParam<'a, super::super::Foundation::HANDLE>, Param4: ::windows::runtime::IntoParam<'a, super::super::Foundation::HANDLE>, Param5: ::windows::runtime::IntoParam<'a, super::super::Foundation::HANDLE>>( distributionname: Param0, command: Param1, usecurrentworkingdirectory: Param2, stdin: Param3, stdout: Param4, stderr: Param5, ) -> ::windows::runtime::Result<super::super::Foundation::HANDLE>90 pub unsafe fn WslLaunch<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::runtime::IntoParam<'a, super::super::Foundation::BOOL>, Param3: ::windows::runtime::IntoParam<'a, super::super::Foundation::HANDLE>, Param4: ::windows::runtime::IntoParam<'a, super::super::Foundation::HANDLE>, Param5: ::windows::runtime::IntoParam<'a, super::super::Foundation::HANDLE>>(
91     distributionname: Param0,
92     command: Param1,
93     usecurrentworkingdirectory: Param2,
94     stdin: Param3,
95     stdout: Param4,
96     stderr: Param5,
97 ) -> ::windows::runtime::Result<super::super::Foundation::HANDLE> {
98     #[cfg(windows)]
99     {
100         #[link(name = "windows")]
101         extern "system" {
102             fn WslLaunch(distributionname: super::super::Foundation::PWSTR, command: super::super::Foundation::PWSTR, usecurrentworkingdirectory: super::super::Foundation::BOOL, stdin: super::super::Foundation::HANDLE, stdout: super::super::Foundation::HANDLE, stderr: super::super::Foundation::HANDLE, process: *mut super::super::Foundation::HANDLE) -> ::windows::runtime::HRESULT;
103         }
104         let mut result__: <super::super::Foundation::HANDLE as ::windows::runtime::Abi>::Abi = ::std::mem::zeroed();
105         WslLaunch(distributionname.into_param().abi(), command.into_param().abi(), usecurrentworkingdirectory.into_param().abi(), stdin.into_param().abi(), stdout.into_param().abi(), stderr.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::HANDLE>(result__)
106     }
107     #[cfg(not(windows))]
108     unimplemented!("Unsupported target OS");
109 }
110 #[cfg(feature = "Win32_Foundation")]
111 #[inline]
WslLaunchInteractive<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::runtime::IntoParam<'a, super::super::Foundation::BOOL>>(distributionname: Param0, command: Param1, usecurrentworkingdirectory: Param2) -> ::windows::runtime::Result<u32>112 pub unsafe fn WslLaunchInteractive<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::runtime::IntoParam<'a, super::super::Foundation::BOOL>>(distributionname: Param0, command: Param1, usecurrentworkingdirectory: Param2) -> ::windows::runtime::Result<u32> {
113     #[cfg(windows)]
114     {
115         #[link(name = "windows")]
116         extern "system" {
117             fn WslLaunchInteractive(distributionname: super::super::Foundation::PWSTR, command: super::super::Foundation::PWSTR, usecurrentworkingdirectory: super::super::Foundation::BOOL, exitcode: *mut u32) -> ::windows::runtime::HRESULT;
118         }
119         let mut result__: <u32 as ::windows::runtime::Abi>::Abi = ::std::mem::zeroed();
120         WslLaunchInteractive(distributionname.into_param().abi(), command.into_param().abi(), usecurrentworkingdirectory.into_param().abi(), &mut result__).from_abi::<u32>(result__)
121     }
122     #[cfg(not(windows))]
123     unimplemented!("Unsupported target OS");
124 }
125 #[cfg(feature = "Win32_Foundation")]
126 #[inline]
WslRegisterDistribution<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>>(distributionname: Param0, targzfilename: Param1) -> ::windows::runtime::Result<()>127 pub unsafe fn WslRegisterDistribution<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>>(distributionname: Param0, targzfilename: Param1) -> ::windows::runtime::Result<()> {
128     #[cfg(windows)]
129     {
130         #[link(name = "windows")]
131         extern "system" {
132             fn WslRegisterDistribution(distributionname: super::super::Foundation::PWSTR, targzfilename: super::super::Foundation::PWSTR) -> ::windows::runtime::HRESULT;
133         }
134         WslRegisterDistribution(distributionname.into_param().abi(), targzfilename.into_param().abi()).ok()
135     }
136     #[cfg(not(windows))]
137     unimplemented!("Unsupported target OS");
138 }
139 #[cfg(feature = "Win32_Foundation")]
140 #[inline]
WslUnregisterDistribution<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>>(distributionname: Param0) -> ::windows::runtime::Result<()>141 pub unsafe fn WslUnregisterDistribution<'a, Param0: ::windows::runtime::IntoParam<'a, super::super::Foundation::PWSTR>>(distributionname: Param0) -> ::windows::runtime::Result<()> {
142     #[cfg(windows)]
143     {
144         #[link(name = "windows")]
145         extern "system" {
146             fn WslUnregisterDistribution(distributionname: super::super::Foundation::PWSTR) -> ::windows::runtime::HRESULT;
147         }
148         WslUnregisterDistribution(distributionname.into_param().abi()).ok()
149     }
150     #[cfg(not(windows))]
151     unimplemented!("Unsupported target OS");
152 }
153