diff options
| author | Martin Ridgers <[email protected]> | 2021-11-09 16:49:16 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-11-09 16:49:16 +0100 |
| commit | 457195d3a3d63b81c5675b0beeb079dc9dafa7f5 (patch) | |
| tree | 0b55168bb16a2a37f355d24fe89a662de5fc0b93 /zencore/thread.cpp | |
| parent | Moved "using namespace" statement into the scope it applies to (diff) | |
| download | zen-457195d3a3d63b81c5675b0beeb079dc9dafa7f5.tar.xz zen-457195d3a3d63b81c5675b0beeb079dc9dafa7f5.zip | |
Implemented ProcessHandle::Initialize(Pid) for Linux
Diffstat (limited to 'zencore/thread.cpp')
| -rw-r--r-- | zencore/thread.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/zencore/thread.cpp b/zencore/thread.cpp index 9f1fa2534..5c6658b35 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -320,8 +320,17 @@ void ProcessHandle::Initialize(int Pid) { ZEN_ASSERT(m_ProcessHandle == nullptr); - m_ProcessHandle = OpenProcess(PROCESS_QUERY_INFORMATION | SYNCHRONIZE, FALSE, Pid); +#if ZEN_PLATFORM_WINDOWS + m_ProcessHandle = OpenProcess(PROCESS_QUERY_INFORMATION | SYNCHRONIZE, FALSE, Pid); +#elif ZEN_PLATFORM_LINUX + if (Pid > 0) + { + m_ProcessHandle = (void*)(intptr_t(Pid)); + } +#else +# error Check process control on this platform +#endif if (!m_ProcessHandle) { |