aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/rasterizer/jitter
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2018-01-19 18:03:16 -0600
committerGeorge Kyriazis <[email protected]>2018-01-25 13:26:49 -0600
commit0b46c7b3b00d93132bab028017cdfdec1693ed7d (patch)
tree18be27361acbd36e6aedc35568bde9463a23b656 /src/gallium/drivers/swr/rasterizer/jitter
parent2d16b61bffc684847a3ab107a2aa4906251445ca (diff)
swr/rast: Better ExecCmd (i.e. system()) implmentation
Hides console window creation during JIT linker execution in apps that don't have a console. Remove hooking of CreateProcessInternalA - the MSFT implementation just turns around and calls CreateProcessInternalW which, we do hook. Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/jitter')
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
index 5a71ab6a4f8..675438be72f 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -599,44 +599,12 @@ JitCache::JitCache()
}
}
-#if defined(_WIN32)
-int ExecUnhookedProcess(const char* pCmdLine)
+int ExecUnhookedProcess(const std::string& CmdLine, std::string* pStdOut, std::string* pStdErr)
{
static const char *g_pEnv = "RASTY_DISABLE_HOOK=1\0";
- STARTUPINFOA StartupInfo{};
- StartupInfo.cb = sizeof(STARTUPINFOA);
- PROCESS_INFORMATION procInfo{};
-
- BOOL ProcessValue = CreateProcessA(
- NULL,
- (LPSTR)pCmdLine,
- NULL,
- NULL,
- TRUE,
- 0,
- (LPVOID)g_pEnv,
- NULL,
- &StartupInfo,
- &procInfo);
-
- if (ProcessValue && procInfo.hProcess)
- {
- WaitForSingleObject(procInfo.hProcess, INFINITE);
- DWORD exitVal = 0;
- if (!GetExitCodeProcess(procInfo.hProcess, &exitVal))
- {
- exitVal = 1;
- }
-
- CloseHandle(procInfo.hProcess);
-
- return exitVal;
- }
-
- return -1;
+ return ExecCmd(CmdLine, g_pEnv, pStdOut, pStdErr);
}
-#endif
#if defined(_WIN64) && defined(ENABLE_JIT_DEBUG) && defined(JIT_BASE_DIR)
EXTERN_C IMAGE_DOS_HEADER __ImageBase;