Core/Process: Add GetCurrentPid
This commit is contained in:
committed by
Jérôme Leclercq
parent
9c102638c0
commit
b0648918a7
@@ -85,6 +85,11 @@ namespace Nz::PlatformImpl
|
||||
return commandLine;
|
||||
}
|
||||
|
||||
Pid GetCurrentProcessId()
|
||||
{
|
||||
return ::GetCurrentProcessId();
|
||||
}
|
||||
|
||||
Result<Pid, std::string> SpawnDetachedProcess(const std::filesystem::path& program, std::span<const std::string> arguments, const std::filesystem::path& workingDirectory)
|
||||
{
|
||||
DWORD creationFlags = CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_PROCESS_GROUP | DETACHED_PROCESS;
|
||||
@@ -100,7 +105,7 @@ namespace Nz::PlatformImpl
|
||||
};
|
||||
|
||||
PROCESS_INFORMATION processInfo;
|
||||
BOOL success = CreateProcessW(
|
||||
BOOL success = ::CreateProcessW(
|
||||
nullptr, // Application name
|
||||
commandLine.data(), // Command line
|
||||
nullptr, // Process attributes
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
|
||||
namespace Nz::PlatformImpl
|
||||
{
|
||||
NAZARA_CORE_API Result<Pid, std::string> SpawnDetachedProcess(const std::filesystem::path& program, std::span<const std::string> arguments = {}, const std::filesystem::path& workingDirectory = {});
|
||||
Pid GetCurrentProcessId();
|
||||
Result<Pid, std::string> SpawnDetachedProcess(const std::filesystem::path& program, std::span<const std::string> arguments = {}, const std::filesystem::path& workingDirectory = {});
|
||||
}
|
||||
|
||||
#endif // NAZARA_CORE_WIN32_PROCESSIMPL_HPP
|
||||
|
||||
Reference in New Issue
Block a user