51 #define CMD_STRING L"cmd /c " 63 SIZE_T NumberOfBytesWritten;
66 if (!StandardHandle)
return;
84 &NumberOfBytesWritten);
127 if (ImageMajorVersion > 3 ||
128 (ImageMajorVersion == 3 && ImageMinorVersion >= 10))
134 DPRINT1(
"Accepting image version %lu.%lu, although ReactOS is an NT %hu.%hu OS!\n",
161 DPRINT1(
"Egad! This is a ReactOS Compute Server and we should prevent you from using certain APIs...but we won't.");
165 DPRINT1(
"Gasp! This is a ReactOS Storage Server and we should prevent you from using certain APIs...but we won't.");
169 DPRINT1(
"Golly! This is a ReactOS Web Blade Server and we should prevent you from using certain APIs...but we won't.");
249 sizeof(
L"EmbdTrst.DLL"));
257 "ImageOkToRunOnEmbeddedNT");
333 NextEntry = NextEntry->
Flink;
388 &SaferiReplaceProcessThreadTokens,
433 if (Handles->Section)
440 if (Handles->ViewBase.QuadPart)
452 DPRINT(
"BaseProcessStartup(..) - setting up exception frame.\n");
499 PWCHAR Remaining, DllPathString, ScanChar;
501 PVOID RemoteAppCompatData;
552 if (StartupInfo->lpDesktop)
560 if (StartupInfo->lpReserved)
568 if (StartupInfo->lpTitle)
582 if (!AppCompatData) AppCompatDataSize = 0;
585 ProcessParameters =
NULL;
589 DPRINT(
"CmdLine : '%wZ'\n", &CommandLine);
593 DPRINT(
"Runtime : '%wZ'\n", &Runtime);
626 ScanChar = lpEnvironment;
630 while (*ScanChar++)
while (*ScanChar++);
664 ProcessParameters->
StartingX = StartupInfo->dwX;
665 ProcessParameters->
StartingY = StartupInfo->dwY;
666 ProcessParameters->
CountX = StartupInfo->dwXSize;
667 ProcessParameters->
CountY = StartupInfo->dwYSize;
668 ProcessParameters->
CountCharsX = StartupInfo->dwXCountChars;
669 ProcessParameters->
CountCharsY = StartupInfo->dwYCountChars;
670 ProcessParameters->
FillAttribute = StartupInfo->dwFillAttribute;
671 ProcessParameters->
WindowFlags = StartupInfo->dwFlags;
675 if (StartupInfo->dwFlags &
702 if (!(StartupInfo->dwFlags &
706 if ((InheritHandles) ||
711 if ((InheritHandles) ||
716 if ((InheritHandles) ||
732 if (ParameterFlags & 1)
738 if (ParameterFlags & 2)
745 RemoteParameters =
NULL;
747 (
PVOID*)&RemoteParameters,
771 ProcessParameters->
Length,
777 &RemotePeb->ProcessParameters,
784 RemoteAppCompatData =
NULL;
788 Size = AppCompatDataSize;
790 &RemoteAppCompatData,
808 &RemotePeb->pShimData,
809 &RemoteAppCompatData,
818 &RemotePeb->ImageSubsystem,
820 sizeof(ImageSubsystem),
834 DPRINT1(
"Failure to create process parameters: %lx\n",
Status);
902 (
PVOID)&dwProcessAffinityMask,
930 sizeof(*ShutdownParametersRequest));
961 sizeof(*ShutdownParametersRequest));
1017 lpMinimumWorkingSetSize,
1018 lpMaximumWorkingSetSize,
1042 if ((dwMinimumWorkingSetSize) && (dwMaximumWorkingSetSize))
1056 sizeof(QuotaLimits));
1089 dwMinimumWorkingSetSize,
1090 dwMaximumWorkingSetSize,
1122 lpCreationTime->dwLowDateTime = Kut.
CreateTime.
u.LowPart;
1123 lpCreationTime->dwHighDateTime = Kut.
CreateTime.
u.HighPart;
1124 lpExitTime->dwLowDateTime = Kut.
ExitTime.
u.LowPart;
1125 lpExitTime->dwHighDateTime = Kut.
ExitTime.
u.HighPart;
1126 lpKernelTime->dwLowDateTime = Kut.
KernelTime.
u.LowPart;
1127 lpKernelTime->dwHighDateTime = Kut.
KernelTime.
u.HighPart;
1128 lpUserTime->dwLowDateTime = Kut.
UserTime.
u.LowPart;
1129 lpUserTime->dwHighDateTime = Kut.
UserTime.
u.HighPart;
1178 sizeof(ProcessBasic),
1209 sizeof(ProcessBasic),
1288 lpStartupInfo->lpReserved =
Params->ShellInfo.Buffer;
1289 lpStartupInfo->lpDesktop =
Params->DesktopInfo.Buffer;
1290 lpStartupInfo->lpTitle =
Params->WindowTitle.Buffer;
1291 lpStartupInfo->dwX =
Params->StartingX;
1292 lpStartupInfo->dwY =
Params->StartingY;
1293 lpStartupInfo->dwXSize =
Params->CountX;
1294 lpStartupInfo->dwYSize =
Params->CountY;
1295 lpStartupInfo->dwXCountChars =
Params->CountCharsX;
1296 lpStartupInfo->dwYCountChars =
Params->CountCharsY;
1297 lpStartupInfo->dwFillAttribute =
Params->FillAttribute;
1298 lpStartupInfo->dwFlags =
Params->WindowFlags;
1299 lpStartupInfo->wShowWindow = (
WORD)
Params->ShowWindowFlags;
1300 lpStartupInfo->cbReserved2 =
Params->RuntimeData.Length;
1301 lpStartupInfo->lpReserved2 = (
LPBYTE)
Params->RuntimeData.Buffer;
1309 lpStartupInfo->hStdInput =
Params->StandardInput;
1310 lpStartupInfo->hStdOutput =
Params->StandardOutput;
1311 lpStartupInfo->hStdError =
Params->StandardError;
1323 ANSI_STRING TitleString, ShellString, DesktopString;
1332 while (!StartupInfo)
1337 sizeof(*StartupInfo));
1346 StartupInfo->
cb =
sizeof(*StartupInfo);
1424 lpStartupInfo->cb = StartupInfo->
cb;
1425 lpStartupInfo->lpReserved = StartupInfo->
lpReserved;
1426 lpStartupInfo->lpDesktop = StartupInfo->
lpDesktop;
1427 lpStartupInfo->lpTitle = StartupInfo->
lpTitle;
1428 lpStartupInfo->dwX = StartupInfo->
dwX;
1429 lpStartupInfo->dwY = StartupInfo->
dwY;
1430 lpStartupInfo->dwXSize = StartupInfo->
dwXSize;
1431 lpStartupInfo->dwYSize = StartupInfo->
dwYSize;
1435 lpStartupInfo->dwFlags = StartupInfo->
dwFlags;
1436 lpStartupInfo->wShowWindow = StartupInfo->
wShowWindow;
1437 lpStartupInfo->cbReserved2 = StartupInfo->
cbReserved2;
1438 lpStartupInfo->lpReserved2 = StartupInfo->
lpReserved2;
1441 if (lpStartupInfo->dwFlags &
1445 lpStartupInfo->hStdInput = StartupInfo->
hStdInput;
1446 lpStartupInfo->hStdOutput = StartupInfo->
hStdOutput;
1447 lpStartupInfo->hStdError = StartupInfo->
hStdError;
1506 ExitProcessRequest->
uExitCode = uExitCode;
1510 sizeof(*ExitProcessRequest));
1634 DbgPrompt(
"A (Abort), B (Break), I (Ignore)? ", ch,
sizeof(ch));
1667 sizeof(PriorityClass),
1701 switch (dwPriorityClass)
1806 sizeof(ProcessBasicInfo),
1834 sizeof(VersionData),
1919 IN BOOL bDisablePriorityBoost)
1961 *pdwHandleCount = phc;
1995 *Wow64Process = (
pbi != 0);
2034 (
PVOID)lpBaseAddress,
2040 if (lpNumberOfBytesRead) *lpNumberOfBytesRead =
nSize;
2071 Base = lpBaseAddress;
2103 if (lpNumberOfBytesWritten) *lpNumberOfBytesWritten =
nSize;
2141 if (lpNumberOfBytesWritten) *lpNumberOfBytesWritten =
nSize;
2206 &SessionInformation,
2207 sizeof(SessionInformation),
2215 *pSessionId = SessionInformation.
SessionId;
2226 #define AddToHandle(x,y) (x) = (HANDLE)((ULONG_PTR)(x) | (y)); 2227 #define RemoveFromHandle(x,y) (x) = (HANDLE)((ULONG_PTR)(x) & ~(y)); 2260 ULONG ParameterFlags, PrivilegeValue, HardErrorMode, ErrorResponse;
2262 BOOLEAN InJob, SaferNeeded, UseLargePages, HavePrivilege;
2263 BOOLEAN QuerySection, SkipSaferAndAppCompat;
2273 NTSTATUS Status, AppCompatStatus, SaferStatus, IFEOStatus, ImageDbgStatus;
2291 SIZE_T EnvironmentLength, CmdLineLength;
2296 BOOLEAN SearchRetry, QuotesNeeded, CmdLineIsAppName, HasQuotes;
2302 #if _SXS_SUPPORT_ENABLED_ 2310 PVOID CapturedStrings[3];
2314 PWCHAR SxsConglomeratedBuffer, StaticBuffer;
2315 ULONG ConglomeratedBufferSizeBytes, StaticBufferSize,
i;
2322 PWCHAR FilePart, PathBuffer, FreeBuffer;
2330 PVOID AppCompatSxsData, AppCompatData;
2331 ULONG AppCompatSxsDataSize, AppCompatDataSize;
2335 ULONG BinarySubType, VdmBinaryType, VdmTask, VdmReserve;
2345 QuerySection =
FALSE;
2347 SkipSaferAndAppCompat =
FALSE;
2354 SectionHandle =
NULL;
2356 ThreadHandle =
NULL;
2360 AppCompatData =
NULL;
2361 AppCompatDataSize = 0;
2362 AppCompatSxsData =
NULL;
2363 AppCompatSxsDataSize = 0;
2364 CaptureBuffer =
NULL;
2365 #if _SXS_SUPPORT_ENABLED_ 2366 SxsConglomeratedBuffer =
NULL;
2371 DebuggerCmdLine =
NULL;
2381 QuotedCmdLine =
NULL;
2391 VdmWaitObject =
NULL;
2392 UseVdmReserve =
FALSE;
2401 #if _SXS_SUPPORT_ENABLED_ 2407 RtlZeroMemory(&LocalProcessAttributes,
sizeof(LocalProcessAttributes));
2408 RtlZeroMemory(&LocalThreadAttributes,
sizeof(LocalThreadAttributes));
2411 RtlZeroMemory(lpProcessInformation,
sizeof(*lpProcessInformation));
2412 if (hNewToken) *hNewToken =
NULL;
2418 #if _SXS_SUPPORT_ENABLED_ 2420 SxsStaticBuffers[0] = &SxsWin32ManifestPath;
2421 SxsStaticBuffers[1] = &SxsWin32PolicyPath;
2422 SxsStaticBuffers[2] = &SxsWin32AssemblyDirectory;
2423 SxsStaticBuffers[3] = &SxsNtManifestPath;
2424 SxsStaticBuffers[4] = &SxsNtPolicyPath;
2425 ExePathPair.
Win32 = &SxsWin32ExePath;
2426 ExePathPair.
Nt = &SxsNtExePath;
2427 ManifestPathPair.
Win32 = &SxsWin32ManifestPath.
String;
2428 ManifestPathPair.
Nt = &SxsNtManifestPath.
String;
2429 PolicyPathPair.
Win32 = &SxsWin32PolicyPath.
String;
2430 PolicyPathPair.
Nt = &SxsNtPolicyPath.
String;
2433 DPRINT(
"CreateProcessInternalW: '%S' '%S' %lx\n", lpApplicationName, lpCommandLine, dwCreationFlags);
2443 DPRINT1(
"Invalid flag combo used\n");
2493 DPRINT1(
"Invalid WOW flags\n");
2518 while ((*pcScan) || (*(pcScan + 1))) ++pcScan;
2521 EnvironmentLength = (pcScan +
sizeof(
ANSI_NULL) - (
PCHAR)lpEnvironment);
2564 lpEnvironment = UnicodeEnv.
Buffer;
2568 StartupInfo = *lpStartupInfo;
2604 QuotesNeeded =
FALSE;
2605 CmdLineIsAppName =
FALSE;
2608 if (!lpApplicationName)
2625 lpApplicationName = NullBuffer = ScanString = lpCommandLine;
2628 if (*lpCommandLine ==
L'\"')
2631 SearchRetry =
FALSE;
2633 lpApplicationName = ScanString;
2637 if (*ScanString ==
L'\"')
2640 NullBuffer = ScanString;
2647 NullBuffer = ScanString;
2654 lpApplicationName = lpCommandLine;
2658 if ((*ScanString ==
L' ') || (*ScanString ==
L'\t'))
2661 NullBuffer = ScanString;
2667 NullBuffer = ScanString;
2672 SaveChar = *NullBuffer;
2718 DPRINT(
"Length: %lu Buffer: %S\n",
Length, NameBuffer);
2724 *NullBuffer = SaveChar;
2725 lpApplicationName = NameBuffer;
2769 *NullBuffer = SaveChar;
2770 lpApplicationName = NameBuffer;
2773 if (!(*ScanString) || !(SearchRetry))
2782 NullBuffer = ScanString;
2785 QuotesNeeded =
TRUE;
2790 else if (!(lpCommandLine) || !(*lpCommandLine))
2793 CmdLineIsAppName =
TRUE;
2794 lpCommandLine = (
LPWSTR)lpApplicationName;
2801 &SxsWin32RelativePath);
2802 if (!TranslationStatus)
2805 DPRINT1(
"Path translation for SxS failed\n");
2813 FreeBuffer = PathName.
Buffer;
2824 RtlInitEmptyUnicodeString(&PathBufferString,
NULL, 0);
2843 SxsWin32ExePath = PathBufferString;
2844 PathBuffer = PathBufferString.
Buffer;
2846 DPRINT(
"SxS Path: %S\n", PathBuffer);
2850 #if _SXS_SUPPORT_ENABLED_ 2851 SxsNtExePath = PathName;
2876 &LocalObjectAttributes,
2886 &LocalObjectAttributes,
2895 DPRINT1(
"Open file failed: %lx (%wZ)\n",
Status, &PathName);
2948 DPRINT1(
"Invalid Blade hashes!\n");
2958 DPRINT1(
"Tampered Blade hashes!\n");
2975 SectionHandle =
NULL;
2991 UseVdmReserve =
TRUE;
2995 SectionHandle =
NULL;
2998 QuerySection =
FALSE;
3003 if (!SkipSaferAndAppCompat)
3015 AppCompatData =
NULL;
3016 AppCompatSxsData =
NULL;
3033 sizeof(ImageInformation),
3041 QuerySection =
TRUE;
3042 ImageMachine = ImageInformation.
Machine;
3054 &AppCompatSxsDataSize,
3059 DPRINT1(
"App compat launch failure: %lx\n", AppCompatStatus);
3076 SectionHandle =
NULL;
3089 if (!(SkipSaferAndAppCompat) &&
3111 SaferNeeded =
FALSE;
3123 (
LPWSTR)lpApplicationName,
3128 if (SaferStatus == 0xFFFFFFFF)
3131 DPRINT1(
"WinSafer blocking process launch\n");
3140 DPRINT1(
"Error checking WinSafer: %lx\n", SaferStatus);
3165 DPRINT1(
"VDM environment for WOW app failed\n");
3173 VdmBinaryType = (dwCreationFlags &
3218 if (UseVdmReserve) VdmReserve = 1;
3228 DPRINT1(
"VDM Configuration failed for WOW\n");
3234 lpCommandLine = VdmString.
Buffer;
3235 lpApplicationName =
NULL;
3256 DPRINT1(
"VDM is not ready for WOW\n");
3269 if (VdmWaitObject)
goto VdmShortCircuit;
3272 bInheritHandles =
FALSE;
3275 if ((lpEnvironment) &&
3282 SkipSaferAndAppCompat =
TRUE;
3310 DPRINT1(
"VDM environment for DOS failed\n");
3346 DPRINT1(
"Detached process but no VDM, not allowed\n");
3359 DPRINT1(
"VDM Configuration failed for DOS\n");
3365 lpCommandLine = VdmString.
Buffer;
3366 lpApplicationName =
NULL;
3379 DPRINT1(
"VDM is not ready for DOS\n");
3392 if (VdmWaitObject)
goto VdmShortCircuit;
3395 bInheritHandles =
FALSE;
3398 if ((lpEnvironment) &&
3405 lpEnvironment = VdmUnicodeEnv.
Buffer;
3417 DPRINT1(
"'%wZ': Invalid EXE, and not a batch or script file\n", &PathName);
3424 CmdQuoteLength = CmdLineIsAppName || HasQuotes;
3425 if (!CmdLineIsAppName)
3427 if (HasQuotes) CmdQuoteLength++;
3435 CmdLineLength =
wcslen(lpCommandLine);
3437 CmdLineLength += CmdQuoteLength +
sizeof(
ANSI_NULL);
3438 CmdLineLength *=
sizeof(
WCHAR);
3444 if (!AnsiCmdCommand)
3453 if ((CmdLineIsAppName) || (HasQuotes))
3455 wcscat(AnsiCmdCommand,
L"\"");
3457 wcscat(AnsiCmdCommand, lpCommandLine);
3458 if ((CmdLineIsAppName) || (HasQuotes))
3460 wcscat(AnsiCmdCommand,
L"\"");
3467 lpCommandLine = DebuggerString.
Buffer;
3468 lpApplicationName =
NULL;
3469 DPRINT1(
"Retrying with: %S\n", lpCommandLine);
3473 SkipSaferAndAppCompat =
TRUE;
3480 DPRINT1(
"64-bit binary, failing\n");
3489 DPRINT1(
"File is offline, failing\n");
3525 sizeof(ImageInformation),
3530 DPRINT1(
"Section query failed\n");
3537 QuerySection =
TRUE;
3544 DPRINT1(
"Trying to launch a DLL, failing\n");
3554 ParameterFlags &= ~2;
3570 if (!DebuggerCmdLine)
3576 if (!DebuggerCmdLine)
3597 (ResultSize <
sizeof(
WCHAR)) ||
3601 RtlFreeHeap(RtlGetProcessHeap(), 0, DebuggerCmdLine);
3602 DebuggerCmdLine =
NULL;
3610 sizeof(UseLargePages),
3612 if ((
NT_SUCCESS(IFEOStatus)) && (UseLargePages))
3630 ErrorParameters[0] = (
ULONG_PTR)&PathName;
3649 DPRINT1(
"Invalid image architecture: %lx\n", ImageInformation.
Machine);
3660 SectionHandle =
NULL;
3661 QuerySection =
FALSE;
3680 DPRINT1(
"Subsystem command line failed\n");
3685 lpCommandLine = DebuggerString.
Buffer;
3686 lpApplicationName =
NULL;
3689 SkipSaferAndAppCompat =
TRUE;
3690 DPRINT1(
"Retrying with: %S\n", lpCommandLine);
3700 DPRINT1(
"Invalid subsystem version: %hu.%hu\n",
3708 if (DebuggerCmdLine)
3715 lpCommandLine = (
LPWSTR)lpApplicationName;
3752 if (!DebuggerString.
Buffer)
3760 RtlInitEmptyUnicodeString(&DebuggerString,
3774 DbgPrint(
"BASE: Calling debugger with '%wZ'\n", &DebuggerString);
3777 lpCommandLine = DebuggerString.
Buffer;
3778 lpApplicationName =
NULL;
3782 SectionHandle =
NULL;
3783 QuerySection =
FALSE;
3790 RtlFreeHeap(RtlGetProcessHeap(), 0, DebuggerCmdLine);
3791 DebuggerCmdLine =
NULL;
3792 DPRINT1(
"Retrying with: %S\n", lpCommandLine);
3798 lpProcessAttributes,
3804 LocalProcessAttributes = *lpProcessAttributes;
3807 &LocalProcessAttributes,
3825 DPRINT1(
"Failed to connect to DbgUI!\n");
3846 HavePrivilege =
FALSE;
3847 PrivilegeState =
NULL;
3856 HavePrivilege =
TRUE;
3897 RealTimePrivilegeState =
NULL;
3948 DPRINT1(
"Failed to update VDM with wait object\n");
3949 VdmWaitObject =
NULL;
3987 sizeof(ImageInformation),
3999 QuerySection =
TRUE;
4006 DPRINT1(
"Image should receive SxS Fusion Isolation\n");
4013 if (lpCurrentDirectory)
4016 DPRINT(
"Current directory: %S\n", lpCurrentDirectory);
4048 DPRINT1(
"Current directory is invalid\n");
4056 if ((QuotesNeeded) || (CmdLineIsAppName))
4071 SaveChar = *NullBuffer;
4076 wcscat(QuotedCmdLine, lpCommandLine);
4082 *NullBuffer = SaveChar;
4083 wcscat(QuotedCmdLine, NullBuffer);
4089 if (QuotesNeeded) QuotesNeeded =
FALSE;
4090 if (CmdLineIsAppName) CmdLineIsAppName =
FALSE;
4095 if (CreateProcessMsg->
Sxs.
Flags & 1) ParameterFlags |= 1;
4098 if ((QuotesNeeded) || (CmdLineIsAppName)) lpCommandLine = QuotedCmdLine;
4109 dwCreationFlags | NoWindow,
4117 DPRINT1(
"BasePushProcessParameters failed\n");
4126 if (!(VdmBinaryType) &&
4127 !(bInheritHandles) &&
4196 LocalThreadAttributes = *lpThreadAttributes;
4199 &LocalThreadAttributes,
4229 DPRINT1(
"TODO: WOW64 is not supported yet\n");
4237 switch (ImageInformation.
Machine)
4252 DbgPrint(
"kernel32: No mapping for ImageInformation.Machine == %04x\n",
4303 CreateProcessMsg->
VdmTask = VdmTask;
4305 else if (VdmReserve)
4315 DPRINT1(
"This is an SxS Message -- should not happen yet\n");
4327 sizeof(*CreateProcessMsg));
4333 CaptureBuffer =
NULL;
4340 DPRINT1(
"Failed to tell csrss about new process\n");
4402 lpProcessInformation->hProcess = VdmWaitObject;
4418 lpProcessInformation->hProcess = VdmWaitObject;
4431 lpProcessInformation->hThread = ThreadHandle;
4437 ThreadHandle =
NULL;
4441 if (DebuggerCmdLine)
RtlFreeHeap(RtlGetProcessHeap(), 0, DebuggerCmdLine);
4447 RtlInitEmptyUnicodeString(&SxsWin32ExePath,
NULL, 0);
4448 SxsWin32ExePath.
Length = 0;
4454 #if _SXS_SUPPORT_ENABLED_ 4463 if (SxsConglomeratedBuffer)
4466 for (
i = 0;
i < 5;
i++)
4469 ThisBuffer = SxsStaticBuffers[
i];
4474 if ((ThisBuffer != (
PVOID)-8) && (ByteBuffer->
Buffer))
4490 RtlInitEmptyUnicodeString(&ThisBuffer->
String,
4511 lpEnvironment =
NULL;
4515 RtlFreeHeap(RtlGetProcessHeap(), 0, QuotedCmdLine);
4522 if (SectionHandle)
NtClose(SectionHandle);
4536 if (JobHandle)
NtClose(JobHandle);
4578 if (VdmWaitObject)
NtClose(VdmWaitObject);
4598 BOOL bInheritHandles,
4599 DWORD dwCreationFlags,
4609 lpProcessAttributes,
4616 lpProcessInformation,
4626 LPCSTR lpApplicationName,
4627 LPSTR lpCommandLine,
4630 BOOL bInheritHandles,
4631 DWORD dwCreationFlags,
4633 LPCSTR lpCurrentDirectory,
4644 DPRINT(
"dwCreationFlags %x, lpEnvironment %p, lpCurrentDirectory %p, " 4645 "lpStartupInfo %p, lpProcessInformation %p\n",
4646 dwCreationFlags, lpEnvironment, lpCurrentDirectory,
4647 lpStartupInfo, lpProcessInformation);
4650 RtlMoveMemory(&StartupInfo, lpStartupInfo,
sizeof(*lpStartupInfo));
4668 if (lpApplicationName)
4673 if (lpCurrentDirectory)
4676 lpCurrentDirectory);
4700 lpProcessAttributes,
4707 lpProcessInformation,
4744 LPSTR lpCommandLine,
4747 BOOL bInheritHandles,
4748 DWORD dwCreationFlags,
4750 LPCSTR lpCurrentDirectory,
4758 lpProcessAttributes,
4765 lpProcessInformation,
4796 &ProcessInformation))
HANDLE NTAPI DbgUiGetThreadDebugObject(VOID)
struct _STARTUPINFOA STARTUPINFOA
BASE_SXS_CREATEPROCESS_MSG Sxs
#define ERROR_INVALID_PARAMETER
VOID WINAPI BasepFreeAppCompatData(IN PVOID AppCompatData, IN PVOID AppCompatSxsData)
#define ERROR_CHILD_NOT_COMPLETE
PVOID WINAPI BasepIsRealtimeAllowed(IN BOOLEAN Keep)
ULONG ImageSubsystemMajorVersion
BOOL WINAPI CreateProcessInternalW(IN HANDLE hUserToken, IN LPCWSTR lpApplicationName, IN LPWSTR lpCommandLine, IN LPSECURITY_ATTRIBUTES lpProcessAttributes, IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN BOOL bInheritHandles, IN DWORD dwCreationFlags, IN LPVOID lpEnvironment, IN LPCWSTR lpCurrentDirectory, IN LPSTARTUPINFOW lpStartupInfo, IN LPPROCESS_INFORMATION lpProcessInformation, OUT PHANDLE hNewToken)
VOID NTAPI CsrFreeCaptureBuffer(IN PCSR_CAPTURE_BUFFER CaptureBuffer)
static int Hash(const char *)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
enum _RTL_PATH_TYPE RTL_PATH_TYPE
#define STATUS_INVALID_IMAGE_WIN_64
#define RemoveFromHandle(x, y)
NTSTATUS WINAPI BaseCreateStack(_In_ HANDLE hProcess, _In_opt_ SIZE_T StackCommit, _In_opt_ SIZE_T StackReserve, _Out_ PINITIAL_TEB InitialTeb)
NTSTATUS NTAPI DbgUiConnectToDbg(VOID)
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
NTSTATUS NTAPI LdrQueryImageFileKeyOption(IN HANDLE KeyHandle, IN PCWSTR ValueName, IN ULONG Type, OUT PVOID Buffer, IN ULONG BufferSize, OUT PULONG ReturnedLength OPTIONAL)
VOID WINAPI BaseInitializeContext(IN PCONTEXT Context, IN PVOID Parameter, IN PVOID StartAddress, IN PVOID StackAddress, IN ULONG ContextType)
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
NTSYSAPI NTSTATUS NTAPI RtlCreateProcessParameters(_Out_ PRTL_USER_PROCESS_PARAMETERS *ProcessParameters, _In_ PUNICODE_STRING ImagePathName, _In_opt_ PUNICODE_STRING DllPath, _In_opt_ PUNICODE_STRING CurrentDirectory, _In_opt_ PUNICODE_STRING CommandLine, _In_opt_ PWSTR Environment, _In_opt_ PUNICODE_STRING WindowTitle, _In_opt_ PUNICODE_STRING DesktopInfo, _In_opt_ PUNICODE_STRING ShellInfo, _In_opt_ PUNICODE_STRING RuntimeInfo)
#define THREAD_ALL_ACCESS
NTSTATUS NTAPI NtUnmapViewOfSection(IN HANDLE ProcessHandle, IN PVOID BaseAddress)
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG FusionFlags
#define REALTIME_PRIORITY_CLASS
#define IMAGE_SUBSYSTEM_POSIX_CUI
NTSTATUS NTAPI BasepSaveAppCertRegistryValue(IN PLIST_ENTRY List, IN PWCHAR ComponentName, IN PWCHAR DllName)
_In_ NDIS_ERROR_CODE ErrorCode
_In_ ULONG _In_ ULONG _In_ ULONG Length
RTL_CRITICAL_SECTION gcsAppCert
BOOL NTAPI IsBadWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
#define PROCESS_PRIORITY_CLASS_INVALID
#define PROCESS_ALL_ACCESS
#define RTL_USER_PROCESS_PARAMETERS_IMAGE_KEY_MISSING
NTSTATUS NTAPI NtCreateSection(OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize OPTIONAL, IN ULONG SectionPageProtection OPTIONAL, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL)
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
NTSTATUS NTAPI LdrShutdownProcess(VOID)
#define SEM_FAILCRITICALERRORS
#define OBJ_CASE_INSENSITIVE
NTSYSAPI NTSTATUS NTAPI NtCreateThread(OUT PHANDLE phThread, IN ACCESS_MASK AccessMask, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE hProcess, OUT PCLIENT_ID pClientId, IN PCONTEXT pContext, OUT PSTACKINFO pStackInfo, IN BOOLEAN bSuspended)
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
#define PROCESS_QUERY_INFORMATION
BOOL WINAPI BaseUpdateVDMEntry(IN ULONG UpdateIndex, IN OUT PHANDLE WaitHandle, IN ULONG IndexInfo, IN ULONG BinaryType)
PBASE_STATIC_SERVER_DATA BaseStaticServerData
#define CREATE_SEPARATE_WOW_VDM
#define CREATE_UNICODE_ENVIRONMENT
#define PROCESSOR_ARCHITECTURE_UNKNOWN
#define HANDLE_DETACHED_PROCESS
#define HANDLE_CREATE_NO_WINDOW
WCHAR CurrentDirectory[1024]
IN BOOLEAN OUT PSTR Buffer
NTSYSAPI ULONG NTAPI DbgPrompt(_In_z_ PCCH Prompt, _Out_writes_bytes_(MaximumResponseLength) PCH Response, _In_ ULONG MaximumResponseLength)
NTSTATUS NTAPI BasepConfigureAppCertDlls(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
#define SE_LOCK_MEMORY_PRIVILEGE
#define STATUS_INVALID_PARAMETER
#define AddToHandle(x, y)
NTSYSAPI VOID NTAPI RtlDestroyEnvironment(_In_ PWSTR Environment)
BOOL NTAPI BaseCreateVDMEnvironment(IN PWCHAR lpEnvironment, OUT PANSI_STRING AnsiEnv, OUT PUNICODE_STRING UnicodeEnv)
VOID WINAPI BasepAnsiStringToHeapUnicodeString(IN LPCSTR AnsiString, OUT LPWSTR *UnicodeString)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
NTSTATUS WINAPI BasepCheckWinSaferRestrictions(IN HANDLE UserToken, IN LPWSTR ApplicationName, IN HANDLE FileHandle, OUT PBOOLEAN InJob, OUT PHANDLE NewToken, OUT PHANDLE JobHandle)
NTSTATUS NTAPI CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL, IN CSR_API_NUMBER ApiNumber, IN ULONG DataLength)
HANDLE ContainingDirectory
struct _STARTUPINFOW STARTUPINFOW
BOOL WINAPI BaseGetVdmConfigInfo(IN LPCWSTR CommandLineReserved, IN ULONG DosSeqId, IN ULONG BinaryType, IN PUNICODE_STRING CmdLineString, OUT PULONG VdmSize)
BASE_CREATE_PROCESS CreateProcessRequest
BOOL NTAPI BaseDestroyVDMEnvironment(IN PANSI_STRING AnsiEnv, IN PUNICODE_STRING UnicodeEnv)
#define ERROR_INVALID_HANDLE
VOID NTAPI RtlReleaseRelativeName(_In_ PRTL_RELATIVE_NAME_U RelativeName)
NTSTATUS NTAPI NtProtectVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *UnsafeBaseAddress, IN OUT SIZE_T *UnsafeNumberOfBytesToProtect, IN ULONG NewAccessProtection, OUT PULONG UnsafeOldAccessProtection)
*nSize LPSTR _Inout_ LPDWORD nSize
BOOLEAN DefaultSeparateVDM
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
NTSTATUS NTAPI NtQueryInformationProcess(IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength OPTIONAL)
SIZE_T LPPROCESS_INFORMATION
#define NtCurrentThread()
_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)
NTSYSAPI NTSTATUS NTAPI RtlDestroyProcessParameters(_In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters)