18#define BINARY_UNKNOWN (0)
19#define BINARY_PE_EXE32 (1)
20#define BINARY_PE_DLL32 (2)
21#define BINARY_PE_EXE64 (3)
22#define BINARY_PE_DLL64 (4)
23#define BINARY_WIN16 (5)
24#define BINARY_OS216 (6)
26#define BINARY_UNIX_EXE (8)
27#define BINARY_UNIX_LIB (9)
46#define ENV_NAME_ENTRY(type, name) \
47 {(type), _ARRAYSIZE(name) - 1, (name)}
73 String.Buffer = &PathName->Buffer[(PathName->Length -
String.Length) /
sizeof(
WCHAR)];
78 String.Buffer = &PathName->Buffer[(PathName->Length -
String.Length) /
sizeof(
WCHAR)];
83 String.Buffer = &PathName->Buffer[(PathName->Length -
String.Length) /
sizeof(
WCHAR)];
174 while (*CommandLine ==
L' ' || *CommandLine ==
L'\t')
204 while (*CommandLine && !(*CommandLine ==
L' ' || *CommandLine ==
L'\t'))
206 if (*CommandLine ==
L'\"')
210 while (*CommandLine && *CommandLine++ !=
L'\"') ;
225 while (*CommandLine ==
L' ' || *CommandLine ==
L'\t')
236 if (CurrentDir ==
NULL)
254 if (!ShortCurrentDir)
304 CheckVdm->
EnvLen = AnsiEnvironment->Length;
305 CheckVdm->
DesktopLen = (StartupInfo->lpDesktop !=
NULL) ? (
wcslen(StartupInfo->lpDesktop) + 1) : 0;
306 CheckVdm->
TitleLen = (StartupInfo->lpTitle !=
NULL) ? (
wcslen(StartupInfo->lpTitle) + 1) : 0;
307 CheckVdm->
ReservedLen = (StartupInfo->lpReserved !=
NULL) ? (
wcslen(StartupInfo->lpReserved) + 1) : 0;
312 CheckVdm->
StdIn = StartupInfo->hStdInput;
313 CheckVdm->
StdOut = StartupInfo->hStdOutput;
314 CheckVdm->
StdErr = StartupInfo->hStdError;
322 if (StartupInfo->lpDesktop)
326 if (StartupInfo->lpTitle)
330 if (StartupInfo->lpReserved)
338 || (StartupInfo->lpDesktop && !AnsiDesktop)
339 || (StartupInfo->lpTitle && !AnsiTitle)
340 || (StartupInfo->lpReserved && !AnsiReserved))
357 AnsiCmdLine[CheckVdm->
CmdLen++] =
'\r';
358 AnsiCmdLine[CheckVdm->
CmdLen++] =
'\n';
359 AnsiCmdLine[CheckVdm->
CmdLen++] = 0;
381 if (StartupInfo->lpDesktop)
386 StartupInfo->lpDesktop,
395 if (StartupInfo->lpTitle)
400 StartupInfo->lpTitle,
409 if (StartupInfo->lpReserved)
414 StartupInfo->lpReserved,
424 RtlCopyMemory(&AnsiStartupInfo, StartupInfo,
sizeof(AnsiStartupInfo));
427 AnsiStartupInfo.
lpTitle = AnsiTitle;
440 if (CaptureBuffer ==
NULL)
468 AnsiEnvironment->Buffer,
478 if (StartupInfo->lpDesktop)
488 if (StartupInfo->lpTitle)
498 if (StartupInfo->lpReserved)
515 *iTask = CheckVdm->
iTask;
520 if (AnsiCmdLine)
RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiCmdLine);
521 if (AnsiAppName)
RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiAppName);
522 if (AnsiCurDirectory)
RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiCurDirectory);
523 if (AnsiDesktop)
RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiDesktop);
524 if (AnsiTitle)
RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiTitle);
525 if (AnsiReserved)
RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiReserved);
531 if (ShortCurrentDir)
RtlFreeHeap(RtlGetProcessHeap(), 0, ShortCurrentDir);
532 if (CurrentDir)
RtlFreeHeap(RtlGetProcessHeap(), 0, CurrentDir);
535 if (ShortAppName)
RtlFreeHeap(RtlGetProcessHeap(), 0, ShortAppName);
567 UpdateVdmEntry->
iTask = IndexInfo;
578 else if (UpdateVdmEntry->
iTask)
597 sizeof(*UpdateVdmEntry));
630 sizeof(EventBasicInfo),
642 sizeof(*GetVdmExitCode));
646 *ExitCode = GetVdmExitCode->
ExitCode;
663 CmdLineString->Buffer = 0;
666 *VdmSize = 0x1000000;
687 L"\"%s\\ntvdm.exe\" -i%lx %s%c",
701 L"\"%s\\ntvdm.exe\" %s%c",
749 ( ((x) >= L'A' && (x) <= L'Z') || ((x) >= L'a' && (x) <= L'z') )
753#define IS_PATH_SEPARATOR(x) ((x) == L'\\' || (x) == L'/')
757 ULONG EnvironmentSize = 0;
761 ULONG NameLength, NumChars, Remaining;
762 PWCHAR SourcePtr, DestPtr, StartPtr;
765 if (!AnsiEnv || !UnicodeEnv)
800 EnvironmentSize += 2;
814 (
PVOID*)&NewEnvironment,
823 NewEnvironment =
NULL;
830 DestPtr = NewEnvironment;
840 if (*SourcePtr !=
L'=')
842 StartPtr = SourcePtr;
847 *DestPtr++ = *SourcePtr;
848 if (*SourcePtr++ ==
L'=')
break;
861 if (
IS_ALPHA(SourcePtr[1]) && SourcePtr[2] ==
L':' && SourcePtr[3] ==
L'=')
869 !(
IS_ALPHA(SourcePtr[4]) && SourcePtr[5] ==
L':' &&
875 *DestPtr++ = SourcePtr[0];
876 *DestPtr++ = SourcePtr[1];
877 *DestPtr++ = SourcePtr[2];
878 *DestPtr++ = SourcePtr[3];
905 *DestPtr++ = *SourcePtr;
911 NameLength =
wcslen(SourcePtr);
913 if (NumChars == 0 || NumChars > NameLength + Remaining)
917 NumChars = NameLength;
920 if (NumChars > NameLength)
921 Remaining -= (NumChars - NameLength);
923 SourcePtr += NameLength;
926 *DestPtr++ = *SourcePtr++;
936 while (*SourcePtr ==
L';')
938 *DestPtr++ = *SourcePtr++;
941 StartPtr = SourcePtr;
948 Delimiter = *SourcePtr;
950 NameLength = SourcePtr - StartPtr;
960 if ( NumChars == 0 ||
961 (Delimiter ==
L';' ? NumChars > NameLength + Remaining
962 : NumChars > NameLength ) )
966 NumChars = NameLength;
969 if (NumChars > NameLength)
970 Remaining -= (NumChars - NameLength);
975 *SourcePtr = Delimiter;
976 *DestPtr++ = *SourcePtr++;
982 *DestPtr++ = *SourcePtr++;
990 RtlInitEmptyUnicodeString(UnicodeEnv, NewEnvironment,
991 (DestPtr - NewEnvironment) *
sizeof(
WCHAR));
992 UnicodeEnv->Length = UnicodeEnv->MaximumLength;
1005 NewEnvironment =
NULL;
1016 RtlInitEmptyUnicodeString(UnicodeEnv,
NULL, 0);
1017 RtlInitEmptyAnsiString(AnsiEnv,
NULL, 0);
1022 (
PVOID*)&NewEnvironment,
1043 if (UnicodeEnv->Buffer)
1047 (
PVOID*)&UnicodeEnv->Buffer,
1106 DPRINT1(
"InternalIsOS2OrOldWin(): Binary file seems to be broken\n");
1122 unsigned char magic[4];
1124 unsigned short type;
1128 unsigned long magic;
1129 unsigned long cputype;
1130 unsigned long cpusubtype;
1159 if(
Header.macho.magic == 0xFEEDFACE ||
1160 Header.macho.magic == 0xCEFAEDFE)
1162 switch(
Header.macho.filetype)
1251 if(!lpApplicationName || !lpBinaryType)
1276 if(!(dot =
wcsrchr(lpApplicationName,
L'.')))
1326 DPRINT1(
"Invalid binary type %lu returned!\n", BinType);
1347 StringAllocated =
TRUE;
1361 if (StringAllocated)
1399 ExitVdm->
iWowTask = IsWow ? iWowTask : 0;
1434 if (CommandData ==
NULL)
1440 sizeof(*IsFirstVdm));
1467 sizeof(*SetReenterCount));
1489 RtlZeroMemory(GetNextVdmCommand,
sizeof(*GetNextVdmCommand));
1516 GetNextVdmCommand->
CmdLen
1517 + GetNextVdmCommand->
AppLen
1518 + GetNextVdmCommand->
PifLen
1520 + GetNextVdmCommand->
EnvLen
1525 if (CaptureBuffer ==
NULL)
1599 sizeof(*GetNextVdmCommand));
1656 CommandData->
StdIn = GetNextVdmCommand->
StdIn;
1670 GetNextVdmCommand->
CmdLen);
1681 GetNextVdmCommand->
AppLen);
1692 GetNextVdmCommand->
PifLen);
1713 GetNextVdmCommand->
Env,
1714 GetNextVdmCommand->
EnvLen);
1735 GetNextVdmCommand->
Title,
1784 if (CaptureBuffer ==
NULL)
1791 VDMCurrentDirsRequest->
cchCurDirs = cchCurDirs;
1800 sizeof(*VDMCurrentDirsRequest));
1833 IN DWORD dwUnusedBufferLength,
1846 if (dwRegisterFlags != 0)
1859 if (CaptureBuffer ==
NULL)
1861 DPRINT1(
"CsrAllocateCaptureBuffer failed!\n");
1868 (
PVOID)lpUnusedBuffer,
1869 dwUnusedBufferLength,
1882 sizeof(*RegisterVDMRequest));
1893 if (dwRegisterFlags != 0)
1898 *lpVideoState = RegisterVDMRequest->
VideoState;
1899 *lpVDMBuffer = RegisterVDMRequest->
VDMBuffer;
1960 if (CaptureBuffer ==
NULL)
1967 VDMCurrentDirsRequest->
cchCurDirs = cchCurDirs;
1977 sizeof(*VDMCurrentDirsRequest));
2010 DPRINT1(
"VDMOperationStarted(%d)\n", Unknown0);
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 NameType
WCHAR CurrentDirectory[1024]
#define BASESRV_SERVERDLL_INDEX
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define CONSRV_SERVERDLL_INDEX
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
#define ERROR_NOT_ENOUGH_MEMORY
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define INVALID_SET_FILE_POINTER
#define GetCurrentDirectoryW(x, y)
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define ERROR_INVALID_NAME
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetShortPathNameW(IN LPCWSTR lpszLongPath, OUT LPWSTR lpszShortPath, IN DWORD cchBuffer)
BOOL WINAPI GetBinaryTypeA(IN LPCSTR lpApplicationName, OUT LPDWORD lpBinaryType)
#define ENV_NAME_ENTRY(type, name)
static ENV_INFO BasepEnvNameType[]
struct _ENV_INFO ENV_INFO
VOID WINAPI ExitVDM(BOOL IsWow, ULONG iWowTask)
BOOL WINAPI RegisterWowBaseHandlers(DWORD Unknown0)
ULONG WINAPI BaseIsDosApplication(IN PUNICODE_STRING PathName, IN NTSTATUS Status)
BOOL NTAPI BaseDestroyVDMEnvironment(IN PANSI_STRING AnsiEnv, IN PUNICODE_STRING UnicodeEnv)
enum _ENV_NAME_TYPE ENV_NAME_TYPE
BOOL WINAPI GetBinaryTypeW(LPCWSTR lpApplicationName, LPDWORD lpBinaryType)
static UNICODE_STRING BaseDotComSuffixName
ENV_NAME_TYPE WINAPI BaseGetEnvNameType_U(IN PWCHAR Name, IN ULONG NameLength)
BOOL WINAPI CmdBatNotification(DWORD Unknown)
static UNICODE_STRING BaseDotExeSuffixName
BOOL WINAPI BaseGetVdmConfigInfo(IN LPCWSTR CommandLineReserved, IN ULONG DosSeqId, IN ULONG BinaryType, IN PUNICODE_STRING CmdLineString, OUT PULONG VdmSize)
BOOL WINAPI BaseCheckForVDM(IN HANDLE ProcessHandle, OUT LPDWORD ExitCode)
DWORD WINAPI VDMConsoleOperation(DWORD Unknown0, DWORD Unknown1)
BOOL WINAPI RegisterWowExec(DWORD Unknown0)
BOOL WINAPI BaseUpdateVDMEntry(IN ULONG UpdateIndex, IN OUT PHANDLE WaitHandle, IN ULONG IndexInfo, IN ULONG BinaryType)
BOOL WINAPI SetVDMCurrentDirectories(DWORD cchCurDirs, PCHAR lpszzCurDirs)
#define IS_PATH_SEPARATOR(x)
BOOL WINAPI RegisterConsoleVDM(IN DWORD dwRegisterFlags, IN HANDLE hStartHardwareEvent, IN HANDLE hEndHardwareEvent, IN HANDLE hErrorHardwareEvent, IN DWORD dwUnusedVar, OUT LPDWORD lpVideoStateLength, OUT PVOID *lpVideoState, IN PVOID lpUnusedBuffer, IN DWORD dwUnusedBufferLength, IN COORD dwVDMBufferSize, OUT PVOID *lpVDMBuffer)
BOOL WINAPI GetNextVDMCommand(PVDM_COMMAND_INFO CommandData)
BOOL NTAPI BaseCreateVDMEnvironment(IN PWCHAR lpEnvironment, OUT PANSI_STRING AnsiEnv, OUT PUNICODE_STRING UnicodeEnv)
static DWORD WINAPI InternalIsOS2OrOldWin(HANDLE hFile, IMAGE_DOS_HEADER *mz, IMAGE_OS2_HEADER *ne)
BOOL WINAPI VDMOperationStarted(IN ULONG Unknown0)
static UNICODE_STRING BaseDotPifSuffixName
static DWORD WINAPI InternalGetBinaryType(HANDLE hFile)
struct _ENV_INFO * PENV_INFO
NTSTATUS WINAPI BaseCheckVDM(IN ULONG BinaryType, IN PCWCH ApplicationName, IN PCWCH CommandLine, IN PCWCH CurrentDirectory, IN PANSI_STRING AnsiEnvironment, IN PBASE_API_MESSAGE ApiMessage, IN OUT PULONG iTask, IN DWORD CreationFlags, IN LPSTARTUPINFOW StartupInfo, IN HANDLE hUserToken OPTIONAL)
DWORD WINAPI GetVDMCurrentDirectories(DWORD cchCurDirs, PCHAR lpszzCurDirs)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
static const WCHAR Cleanup[]
GLuint GLuint GLsizei GLenum type
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define EXCEPTION_EXECUTE_HANDLER
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
PVOID PVOID PWCHAR PVOID Environment
PVOID PVOID PWCHAR ApplicationName
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT NumStrings
_In_ HANDLE ProcessHandle
__kernel_entry _Inout_ _Inout_ PSIZE_T RegionSize
NTSYSAPI NTSTATUS NTAPI RtlCreateEnvironment(_In_ BOOLEAN Inherit, _Out_ PWSTR *Environment)
NTSYSAPI VOID NTAPI RtlDestroyEnvironment(_In_ PWSTR Environment)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#define NtCurrentProcess()
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define UNICODE_STRING_MAX_CHARS
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSTATUS NTAPI NtQueryEvent(IN HANDLE EventHandle, IN EVENT_INFORMATION_CLASS EventInformationClass, OUT PVOID EventInformation, IN ULONG EventInformationLength, OUT PULONG ReturnLength OPTIONAL)
NTSTATUS NTAPI NtFreeVirtualMemory(IN HANDLE ProcessHandle, IN PVOID *UBaseAddress, IN PSIZE_T URegionSize, IN ULONG FreeType)
NTSTATUS NTAPI NtAllocateVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *UBaseAddress, IN ULONG_PTR ZeroBits, IN OUT PSIZE_T URegionSize, IN ULONG AllocationType, IN ULONG Protect)
#define STATUS_OBJECT_PATH_INVALID
#define IMAGE_DOS_SIGNATURE
#define _SEH2_EXCEPT(...)
DWORD BaseSetLastNTError(IN NTSTATUS Status)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
PCSR_CAPTURE_BUFFER NTAPI CsrAllocateCaptureBuffer(_In_ ULONG ArgumentCount, _In_ ULONG BufferSize)
ULONG NTAPI CsrAllocateMessagePointer(_Inout_ PCSR_CAPTURE_BUFFER CaptureBuffer, _In_ ULONG MessageLength, _Out_ PVOID *CapturedData)
VOID NTAPI CsrFreeCaptureBuffer(_In_ _Frees_ptr_ PCSR_CAPTURE_BUFFER CaptureBuffer)
VOID NTAPI CsrCaptureMessageBuffer(_Inout_ PCSR_CAPTURE_BUFFER CaptureBuffer, _In_opt_ PVOID MessageBuffer, _In_ ULONG MessageLength, _Out_ PVOID *CapturedData)
NTSTATUS NTAPI CsrClientCallServer(_Inout_ PCSR_API_MESSAGE ApiMessage, _Inout_opt_ PCSR_CAPTURE_BUFFER CaptureBuffer, _In_ CSR_API_NUMBER ApiNumber, _In_ ULONG DataLength)
#define VDM_INC_REENTER_COUNT
#define BINARY_TYPE_SEPARATE_WOW
@ VdmEntryUpdateControlCHandler
#define VDM_DEC_REENTER_COUNT
#define STATUS_BUFFER_TOO_SMALL
PULONG MinorVersion OPTIONAL
BASE_GETSET_VDM_CURDIRS VDMCurrentDirsRequest
BASE_UPDATE_VDM_ENTRY UpdateVDMEntryRequest
BASE_SET_REENTER_COUNT SetReenterCountRequest
BASE_IS_FIRST_VDM IsFirstVDMRequest
BASE_EXIT_VDM ExitVDMRequest
BASE_GET_NEXT_VDM_COMMAND GetNextVDMCommandRequest
BASE_GET_VDM_EXIT_CODE GetVDMExitCodeRequest
union _BASE_API_MESSAGE::@3534 Data
LPSTARTUPINFOA StartupInfo
LPSTARTUPINFOA StartupInfo
HANDLE WaitObjectForParent
CONSOLE_REGISTERVDM RegisterVDMRequest
union _CONSOLE_API_MESSAGE::@3536 Data
HANDLE ErrorHardwareEvent
HANDLE StartHardwareEvent
#define RTL_CONSTANT_STRING(s)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
DWORD WINAPI GetLastError(void)
#define STARTF_USESTDHANDLES
#define ERROR_BAD_ENVIRONMENT
#define ERROR_INVALID_ACCESS
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO