| 1 | /*++ |
| 2 | |
| 3 | Copyright (c) Microsoft. All rights reserved. |
| 4 | |
| 5 | Module Name: |
| 6 | |
| 7 | wdk.h |
| 8 | |
| 9 | Abstract: |
| 10 | |
| 11 | This file contains various definitions that are needed for WSL to build. |
| 12 | |
| 13 | --*/ |
| 14 | |
| 15 | #pragma once |
| 16 | |
| 17 | #include <winternl.h> |
| 18 | #include <computedefs.h> |
| 19 | #include <winnt.h> |
| 20 | #include <windns.h> |
| 21 | |
| 22 | #define STATUS_NOT_FOUND ((NTSTATUS)0xC0000225L) |
| 23 | #define STATUS_NO_SUCH_DEVICE ((NTSTATUS)0xC000000EL) |
| 24 | #define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L) |
| 25 | #define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005L) |
| 26 | #define STATUS_DEVICE_NOT_CONNECTED ((NTSTATUS)0xC000009DL) |
| 27 | #define STATUS_DIRECTORY_NOT_EMPTY ((NTSTATUS)0xC0000101L) |
| 28 | #define STATUS_FILE_IS_A_DIRECTORY ((NTSTATUS)0xC00000BAL) |
| 29 | #define STATUS_NOT_A_DIRECTORY ((NTSTATUS)0xC0000103L) |
| 30 | #define STATUS_NOT_SUPPORTED ((NTSTATUS)0xC00000BBL) |
| 31 | #define STATUS_REDIRECTOR_STARTED ((NTSTATUS)0xC00000FCL) |
| 32 | #define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034L) |
| 33 | #define STATUS_OBJECT_NAME_COLLISION ((NTSTATUS)0xC0000035L) |
| 34 | #define STATUS_OBJECT_PATH_NOT_FOUND ((NTSTATUS)0xC000003AL) |
| 35 | #define STATUS_INTERNAL_ERROR ((NTSTATUS)0xC00000E5L) |
| 36 | #define STATUS_CANCELLED ((NTSTATUS)0xC0000120L) |
| 37 | #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) |
| 38 | #define STATUS_NO_MORE_FILES ((NTSTATUS)0x80000006L) |
| 39 | #define STATUS_NO_SUCH_FILE ((NTSTATUS)0xC000000FL) |
| 40 | #define STATUS_SHUTDOWN_IN_PROGRESS ((NTSTATUS)0xC00002FEL) |
| 41 | #define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L) |
| 42 | #define STATUS_CONNECTION_DISCONNECTED ((NTSTATUS)0xC000020CL) |
| 43 | #define STATUS_RETRY ((NTSTATUS)0xC000022DL) |
| 44 | |
| 45 | #define IOCTL_DISK_ARE_VOLUMES_READY CTL_CODE(IOCTL_DISK_BASE, 0x0087, METHOD_BUFFERED, FILE_READ_ACCESS) |
| 46 | #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF) |
| 47 | |
| 48 | #define JobObjectTimerVirtualizationInformation ((JOBOBJECTINFOCLASS)23) // TODO: Undocumented. |
| 49 | #define ThreadExplicitCaseSensitivity ((THREADINFOCLASS)43) // TODO: Undocumented. |
| 50 | #define FileAttributeTagInformation ((FILE_INFORMATION_CLASS)35) |
| 51 | #define FileStatLxInformation ((FILE_INFORMATION_CLASS)70) |
| 52 | #define FileCaseSensitiveInformation ((FILE_INFORMATION_CLASS)71) |
| 53 | #define FileFullDirectoryInformation ((FILE_INFORMATION_CLASS)2) |
| 54 | #define FileStatInformation ((FILE_INFORMATION_CLASS)68) |
| 55 | |
| 56 | #define IO_REPARSE_TAG_LX_SYMLINK (0xA000001D) |
| 57 | |
| 58 | #define ARGUMENT_PRESENT(x) (((x) != NULL)) |
| 59 | #define MAXULONG ULONG_MAX |
| 60 | |
| 61 | // Note: These flags are documented but not in the SDK. |
| 62 | // See: https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_stat_lx_information |
| 63 | #define LX_FILE_METADATA_HAS_UID 0x1 |
| 64 | #define LX_FILE_METADATA_HAS_GID 0x2 |
| 65 | #define LX_FILE_METADATA_HAS_MODE 0x4 |
| 66 | |
| 67 | // Note: This flag is documented but not in the SDK. |
| 68 | // See: https://learn.microsoft.com/en-us/windows/console/readconsoleinputex |
| 69 | #define CONSOLE_READ_NOWAIT 0x0002 |
| 70 | |
| 71 | // Note: This flag is already published in: https://github.com/microsoft/terminal/blob/main/dep/Console/condrv.h |
| 72 | #define IOCTL_CONDRV_GET_SERVER_PID CTL_CODE(FILE_DEVICE_CONSOLE, 8, METHOD_NEITHER, FILE_ANY_ACCESS) |
| 73 | |
| 74 | #define VM_E_INVALID_STATE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1001) // TODO: Undocumented. |
| 75 | |
| 76 | // {FC36C5C6-7A87-4841-A47A-1D352987055B} |
| 77 | DEFINE_GUID(VIRTIO_PLAN9_DEVICE_ID, 0xFC36C5C6, 0x7A87, 0x4841, 0xA4, 0x7A, 0x1D, 0x35, 0x29, 0x87, 0x05, 0x5B); // TODO: Undocumented. |
| 78 | |
| 79 | // {a8679153-843f-467f-ad7e-f429328f7568} |
| 80 | DEFINE_GUID(FLEXIO_DEVICE_ID, 0xa8679153, 0x843f, 0x467f, 0xad, 0x7e, 0xf4, 0x29, 0x32, 0x8f, 0x75, 0x68); // TODO: Undocumented. |
| 81 | |
| 82 | typedef struct _KEY_FLAGS_INFORMATION // TODO: Undocumented. |
| 83 | { |
| 84 | ULONG UserFlags; |
| 85 | ULONG KeyFlags; // LSB bit set --> Key is Volatile |
| 86 | // second to LSB bit set --> Key is symlink |
| 87 | |
| 88 | ULONG ControlFlags; // combination of the above |
| 89 | } KEY_FLAGS_INFORMATION, *PKEY_FLAGS_INFORMATION; |
| 90 | |
| 91 | typedef enum _EVENT_TYPE |
| 92 | { |
| 93 | NotificationEvent, |
| 94 | SynchronizationEvent |
| 95 | } EVENT_TYPE; |
| 96 | |
| 97 | typedef IO_STATUS_BLOCK* PIO_STATUS_BLOCK; |
| 98 | |
| 99 | #define RtlEqualLuid(L1, L2) (((L1)->LowPart == (L2)->LowPart) && ((L1)->HighPart == (L2)->HighPart)) |
| 100 | |
| 101 | typedef enum _FSINFOCLASS |
| 102 | { |
| 103 | FileFsDeviceInformation = 4, |
| 104 | FileIdBothDirectoryInformation = 37 |
| 105 | } FS_INFORMATION_CLASS, |
| 106 | *PFS_INFORMATION_CLASS; |
| 107 | |
| 108 | typedef struct _FILE_FS_DEVICE_INFORMATION |
| 109 | { // ntddk nthal |
| 110 | DEVICE_TYPE DeviceType; // ntddk nthal |
| 111 | ULONG Characteristics; // ntddk nthal |
| 112 | } FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION; // ntddk nthal |
| 113 | |
| 114 | typedef struct _REPARSE_DATA_BUFFER |
| 115 | { |
| 116 | ULONG ReparseTag; |
| 117 | USHORT ReparseDataLength; |
| 118 | USHORT Reserved; |
| 119 | union |
| 120 | { |
| 121 | struct |
| 122 | { |
| 123 | USHORT SubstituteNameOffset; |
| 124 | USHORT SubstituteNameLength; |
| 125 | USHORT PrintNameOffset; |
| 126 | USHORT PrintNameLength; |
| 127 | ULONG Flags; |
| 128 | WCHAR PathBuffer[1]; |
| 129 | } SymbolicLinkReparseBuffer; |
| 130 | struct |
| 131 | { |
| 132 | USHORT SubstituteNameOffset; |
| 133 | USHORT SubstituteNameLength; |
| 134 | USHORT PrintNameOffset; |
| 135 | USHORT PrintNameLength; |
| 136 | WCHAR PathBuffer[1]; |
| 137 | } MountPointReparseBuffer; |
| 138 | struct |
| 139 | { |
| 140 | UCHAR DataBuffer[1]; |
| 141 | } GenericReparseBuffer; |
| 142 | } DUMMYUNIONNAME; |
| 143 | } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; |
| 144 | |
| 145 | typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION |
| 146 | { |
| 147 | ULONG FileAttributes; |
| 148 | ULONG ReparseTag; |
| 149 | } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION; |
| 150 | |
| 151 | #define REPARSE_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer) |
| 152 | |
| 153 | typedef struct _FILE_GET_EA_INFORMATION |
| 154 | { |
| 155 | ULONG NextEntryOffset; |
| 156 | UCHAR EaNameLength; |
| 157 | CHAR EaName[1]; |
| 158 | } FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION; |
| 159 | |
| 160 | typedef struct _FILE_FULL_EA_INFORMATION |
| 161 | { |
| 162 | ULONG NextEntryOffset; |
| 163 | UCHAR Flags; |
| 164 | UCHAR EaNameLength; |
| 165 | USHORT EaValueLength; |
| 166 | CHAR EaName[1]; |
| 167 | } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION; |
| 168 | |
| 169 | typedef struct _FILE_ID_BOTH_DIR_INFORMATION |
| 170 | { |
| 171 | ULONG NextEntryOffset; |
| 172 | ULONG FileIndex; |
| 173 | LARGE_INTEGER CreationTime; |
| 174 | LARGE_INTEGER LastAccessTime; |
| 175 | LARGE_INTEGER LastWriteTime; |
| 176 | LARGE_INTEGER ChangeTime; |
| 177 | LARGE_INTEGER EndOfFile; |
| 178 | LARGE_INTEGER AllocationSize; |
| 179 | ULONG FileAttributes; |
| 180 | ULONG FileNameLength; |
| 181 | ULONG EaSize; |
| 182 | CCHAR ShortNameLength; |
| 183 | WCHAR ShortName[12]; |
| 184 | LARGE_INTEGER FileId; |
| 185 | WCHAR FileName[1]; |
| 186 | } FILE_ID_BOTH_DIR_INFORMATION, *PFILE_ID_BOTH_DIR_INFORMATION; |
| 187 | |
| 188 | #ifdef __cplusplus |
| 189 | extern "C" { |
| 190 | #endif |
| 191 | |
| 192 | BOOL WINAPI ReadConsoleInputExW( |
| 193 | _In_ HANDLE hConsoleInput, _Out_writes_(nLength) PINPUT_RECORD lpBuffer, _In_ DWORD nLength, _Out_ LPDWORD lpNumberOfEventsRead, _In_ USHORT wFlags); |
| 194 | |
| 195 | NTSTATUS WINAPI NtCancelIoFileEx(__in HANDLE FileHandle, __in_opt PIO_STATUS_BLOCK IoRequestToCancel, __out PIO_STATUS_BLOCK IoStatusBlock); |
| 196 | |
| 197 | NTSTATUS |
| 198 | NtCreateNamedPipeFile( |
| 199 | __out PHANDLE FileHandle, |
| 200 | __in ULONG DesiredAccess, |
| 201 | __in POBJECT_ATTRIBUTES ObjectAttributes, |
| 202 | __out PIO_STATUS_BLOCK IoStatusBlock, |
| 203 | __in ULONG ShareAccess, |
| 204 | __in ULONG CreateDisposition, |
| 205 | __in ULONG CreateOptions, |
| 206 | __in ULONG NamedPipeType, |
| 207 | __in ULONG ReadMode, |
| 208 | __in ULONG CompletionMode, |
| 209 | __in ULONG MaximumInstances, |
| 210 | __in ULONG InboundQuota, |
| 211 | __in ULONG OutboundQuota, |
| 212 | __in_opt PLARGE_INTEGER DefaultTimeout); |
| 213 | |
| 214 | NTSTATUS |
| 215 | NTSYSCALLAPI |
| 216 | NtFsControlFile( |
| 217 | __in HANDLE FileHandle, |
| 218 | __in_opt HANDLE Event, |
| 219 | __in_opt PIO_APC_ROUTINE ApcRoutine, |
| 220 | __in_opt PVOID ApcContext, |
| 221 | __out PIO_STATUS_BLOCK IoStatusBlock, |
| 222 | __in ULONG IoControlCode, |
| 223 | __in_bcount_opt(InputBufferLength) PVOID InputBuffer, |
| 224 | __in ULONG InputBufferLength, |
| 225 | __out_bcount_opt(OutputBufferLength) PVOID OutputBuffer, |
| 226 | __in ULONG OutputBufferLength); |
| 227 | |
| 228 | NTSTATUS |
| 229 | NTSYSCALLAPI |
| 230 | NtQueryInformationByName( |
| 231 | __in POBJECT_ATTRIBUTES ObjectAttributes, |
| 232 | __out PIO_STATUS_BLOCK IoStatusBlock, |
| 233 | __out_bcount(Length) PVOID FileInformation, |
| 234 | __in ULONG Length, |
| 235 | __in FILE_INFORMATION_CLASS FileInformationClass); |
| 236 | |
| 237 | NTSTATUS |
| 238 | NTSYSCALLAPI |
| 239 | NtQueryVolumeInformationFile( |
| 240 | __in HANDLE FileHandle, __out PIO_STATUS_BLOCK IoStatusBlock, __out_bcount(Length) PVOID FsInformation, __in ULONG Length, __in FS_INFORMATION_CLASS FsInformationClass); |
| 241 | |
| 242 | NTSTATUS RtlDosPathNameToNtPathName_U_WithStatus( |
| 243 | __in PCWSTR DosFileName, __out PUNICODE_STRING NtFileName, __deref_opt_out_opt PWSTR* FilePart, __reserved PVOID Reserved); |
| 244 | |
| 245 | NTSTATUS |
| 246 | NTSYSAPI |
| 247 | RtlInitializeSidEx(__out_bcount(SECURITY_SID_SIZE(SubAuthorityCount)) PSID Sid, __in PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, __in UCHAR SubAuthorityCount, ...); |
| 248 | |
| 249 | NTSTATUS |
| 250 | NTSYSAPI |
| 251 | ZwCreateDirectoryObject(__out PHANDLE DirectoryHandle, __in ACCESS_MASK DesiredAccess, __in POBJECT_ATTRIBUTES ObjectAttributes); |
| 252 | |
| 253 | NTSTATUS |
| 254 | WINAPI |
| 255 | NtOpenDirectoryObject(__out PHANDLE DirectoryHandle, __in ACCESS_MASK DesiredAccess, __in POBJECT_ATTRIBUTES ObjectAttributes); |
| 256 | |
| 257 | NTSTATUS |
| 258 | NTSYSCALLAPI |
| 259 | NtQueryInformationFile(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FileInformation, ULONG Length, FILE_INFORMATION_CLASS FileInformationClass); |
| 260 | |
| 261 | NTSTATUS NTSYSCALLAPI NtSetInformationFile(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FileInformation, ULONG Length, FILE_INFORMATION_CLASS FileInformationClass); |
| 262 | |
| 263 | NTSTATUS |
| 264 | ZwQueryEaFile( |
| 265 | __in HANDLE FileHandle, |
| 266 | __out PIO_STATUS_BLOCK IoStatusBlock, |
| 267 | __out_bcount(Length) PVOID Buffer, |
| 268 | __in ULONG Length, |
| 269 | __in BOOLEAN ReturnSingleEntry, |
| 270 | __in_bcount_opt(EaListLength) PVOID EaList, |
| 271 | __in ULONG EaListLength, |
| 272 | __in_opt PULONG EaIndex, |
| 273 | __in BOOLEAN RestartScan); |
| 274 | |
| 275 | NTSTATUS |
| 276 | NTSYSAPI |
| 277 | ZwCreateEvent(__out PHANDLE EventHandle, __in ACCESS_MASK DesiredAccess, __in_opt POBJECT_ATTRIBUTES ObjectAttributes, __in EVENT_TYPE EventType, __in BOOLEAN InitialState); |
| 278 | |
| 279 | NTSTATUS |
| 280 | NtReadFile( |
| 281 | __in HANDLE FileHandle, |
| 282 | __in_opt HANDLE Event, |
| 283 | __in_opt PIO_APC_ROUTINE ApcRoutine, |
| 284 | __in_opt PVOID ApcContext, |
| 285 | __out PIO_STATUS_BLOCK IoStatusBlock, |
| 286 | __out PVOID Buffer, |
| 287 | __in ULONG Length, |
| 288 | __in_opt PLARGE_INTEGER ByteOffset, |
| 289 | __in_opt PULONG Key); |
| 290 | |
| 291 | NTSTATUS |
| 292 | NTSYSCALLAPI |
| 293 | NtWriteFile( |
| 294 | __in HANDLE FileHandle, |
| 295 | __in_opt HANDLE Event, |
| 296 | __in_opt PIO_APC_ROUTINE ApcRoutine, |
| 297 | __in_opt PVOID ApcContext, |
| 298 | __out PIO_STATUS_BLOCK IoStatusBlock, |
| 299 | __in PVOID Buffer, |
| 300 | __in ULONG Length, |
| 301 | __in_opt PLARGE_INTEGER ByteOffset, |
| 302 | __in_opt PULONG Key); |
| 303 | |
| 304 | NTSTATUS |
| 305 | NTSYSCALLAPI |
| 306 | NtQueryDirectoryFile( |
| 307 | HANDLE FileHandle, |
| 308 | HANDLE Event, |
| 309 | PIO_APC_ROUTINE ApcRoutine, |
| 310 | PVOID ApcContext, |
| 311 | PIO_STATUS_BLOCK IoStatusBlock, |
| 312 | PVOID FileInformation, |
| 313 | ULONG Length, |
| 314 | FILE_INFORMATION_CLASS FileInformationClass, |
| 315 | BOOLEAN ReturnSingleEntry, |
| 316 | PUNICODE_STRING FileName, |
| 317 | BOOLEAN RestartScan); |
| 318 | |
| 319 | NTSTATUS ZwSetEaFile(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length); |
| 320 | |
| 321 | // These extended attributes are defined in ntioapi_x.h in the OS repo and are not present in the SDK. |
| 322 | #define LX_FILE_METADATA_UID_EA_NAME "$LXUID" |
| 323 | #define LX_FILE_METADATA_GID_EA_NAME "$LXGID" |
| 324 | #define LX_FILE_METADATA_MODE_EA_NAME "$LXMOD" |
| 325 | #define LX_FILE_METADATA_DEVICE_ID_EA_NAME "$LXDEV" |
| 326 | |
| 327 | #define SYMLINK_FLAG_RELATIVE 0x00000001 // If set then this is a relative symlink. |
| 328 | |
| 329 | #ifdef _AMD64_ |
| 330 | |
| 331 | typedef struct _HV_X64_HYPERVISOR_HARDWARE_FEATURES |
| 332 | { |
| 333 | // |
| 334 | // Eax |
| 335 | // |
| 336 | UINT32 ApicOverlayAssistInUse : 1; |
| 337 | UINT32 MsrBitmapsInUse : 1; |
| 338 | UINT32 ArchitecturalPerformanceCountersInUse : 1; |
| 339 | UINT32 SecondLevelAddressTranslationInUse : 1; |
| 340 | UINT32 DmaRemappingInUse : 1; |
| 341 | UINT32 InterruptRemappingInUse : 1; |
| 342 | UINT32 MemoryPatrolScrubberPresent : 1; |
| 343 | UINT32 DmaProtectionInUse : 1; |
| 344 | UINT32 HpetRequested : 1; |
| 345 | UINT32 SyntheticTimersVolatile : 1; |
| 346 | UINT32 HypervisorLevel : 4; |
| 347 | UINT32 PhysicalDestinationModeRequired : 1; |
| 348 | UINT32 UseVmfuncForAliasMapSwitch : 1; |
| 349 | UINT32 HvRegisterForMemoryZeroingSupported : 1; |
| 350 | UINT32 UnrestrictedGuestSupported : 1; |
| 351 | UINT32 RdtAFeaturesSupported : 1; |
| 352 | UINT32 RdtMFeaturesSupported : 1; |
| 353 | UINT32 ChildPerfmonPmuSupported : 1; |
| 354 | UINT32 ChildPerfmonLbrSupported : 1; |
| 355 | UINT32 ChildPerfmonIptSupported : 1; |
| 356 | UINT32 ApicEmulationSupported : 1; |
| 357 | UINT32 ChildX2ApicRecommended : 1; |
| 358 | UINT32 HardwareWatchdogReserved : 1; |
| 359 | UINT32 DeviceAccessTrackingSupported : 1; |
| 360 | UINT32 Reserved : 5; |
| 361 | |
| 362 | // |
| 363 | // Ebx |
| 364 | // |
| 365 | UINT32 DeviceDomainInputWidth : 8; |
| 366 | UINT32 ReservedEbx : 24; |
| 367 | |
| 368 | // |
| 369 | // Ecx |
| 370 | // |
| 371 | UINT32 ReservedEcx; |
| 372 | |
| 373 | // |
| 374 | // Edx |
| 375 | // |
| 376 | UINT32 ReservedEdx; |
| 377 | |
| 378 | } HV_X64_HYPERVISOR_HARDWARE_FEATURES, *PHV_X64_HYPERVISOR_HARDWARE_FEATURES; |
| 379 | |
| 380 | #define HvCpuIdFunctionMsHvHardwareFeatures 0x40000006 |
| 381 | |
| 382 | #endif |
| 383 | |
| 384 | typedef enum _KEY_INFORMATION_CLASS |
| 385 | { |
| 386 | KeyBasicInformation, |
| 387 | KeyNodeInformation, |
| 388 | KeyFullInformation, |
| 389 | KeyNameInformation, |
| 390 | KeyCachedInformation, |
| 391 | KeyFlagsInformation, |
| 392 | KeyVirtualizationInformation, |
| 393 | KeyHandleTagsInformation, |
| 394 | KeyTrustInformation, |
| 395 | KeyLayerInformation, |
| 396 | MaxKeyInfoClass |
| 397 | } KEY_INFORMATION_CLASS; |
| 398 | |
| 399 | typedef struct _KEY_NAME_INFORMATION |
| 400 | { |
| 401 | ULONG NameLength; |
| 402 | WCHAR Name[1]; |
| 403 | } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION; |
| 404 | |
| 405 | NTSYSAPI NTSTATUS ZwQueryKey(HANDLE KeyHandle, KEY_INFORMATION_CLASS KeyInformationClass, PVOID KeyInformation, ULONG Length, PULONG ResultLength); |
| 406 | |
| 407 | STDAPI |
| 408 | GetVmWorkerProcess(_In_ REFGUID VirtualMachineId, _In_ REFIID ObjectIid, _Outptr_opt_ IUnknown** Object); |
| 409 | |
| 410 | HRESULT |
| 411 | WINAPI |
| 412 | HdvProxyDeviceHost(HCS_SYSTEM ComputeSystem, _In_ PVOID DeviceHost_IUnknown, DWORD TargetProcessId, _Out_ UINT64* IpcSectionHandle); |
| 413 | |
| 414 | #ifdef __cplusplus |
| 415 | } |
| 416 | |
| 417 | // List of methods that shouldn't be used because they aren't available on older builds that WSL supports |
| 418 | |
| 419 | template <typename T> |
| 420 | T BreakBuild() |
| 421 | { |
| 422 | static_assert(false, "Do not use GetTempPath2W(). (Not available on vb)"); |
| 423 | return T{}; |
| 424 | } |
| 425 | |
| 426 | #define GetTempPath2W(...) (BreakBuild<bool>()) |
| 427 | |
| 428 | #endif |