99 lines
2.2 KiB
C++
99 lines
2.2 KiB
C++
/***
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: StartupParameters.hpp
|
|
Date: 2022-1-29
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
namespace Aurora::Processes
|
|
{
|
|
struct StartupParameters
|
|
{
|
|
AU_DEF(StartupParameters);
|
|
AU_MOVE(StartupParameters);
|
|
|
|
/**
|
|
* @brief Relative or absolute path to the executable binary
|
|
*/
|
|
AuString process;
|
|
|
|
/**
|
|
* @brief Raw arguments (argv[1]...)
|
|
*/
|
|
AuList<AuString> args;
|
|
|
|
/**
|
|
* @brief Child possession type
|
|
*/
|
|
enum ESpawnType type;
|
|
|
|
/**
|
|
* @brief Specifies the stdout handle of the child process
|
|
*/
|
|
EStreamForward fwdOut {};
|
|
|
|
/**
|
|
* @brief Specifies the stderr handle of the child process
|
|
*/
|
|
EStreamForward fwdErr {};
|
|
|
|
/**
|
|
* @brief Specifies the stdin handle of the child process
|
|
*/
|
|
EStreamForward fwdIn {};
|
|
|
|
/**
|
|
* @brief Under Windows Console subsystem applications, this hides the conhost.
|
|
*/
|
|
bool bNoShowConsole {};
|
|
|
|
/**
|
|
* @brief Starts the process in a resumable suspension mode
|
|
*/
|
|
bool bInDebugMode {};
|
|
|
|
AuOptional<AuString> workingDirectory;
|
|
|
|
AuList<AuPair<AuString, AuString>> environmentVariables;
|
|
|
|
bool bInheritEnvironmentVariables { true };
|
|
|
|
IO::IOHandle handleOutStream;
|
|
|
|
IO::IOHandle handleErrorStream;
|
|
|
|
IO::IOHandle handleInputStream;
|
|
|
|
AuOptionalEx<HWInfo::CpuBitId> optAffinity;
|
|
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
|
#if defined(CreateProcess)
|
|
AuSupplierConsumer<BOOL,
|
|
LPCWSTR,
|
|
LPWSTR,
|
|
LPSECURITY_ATTRIBUTES,
|
|
LPSECURITY_ATTRIBUTES,
|
|
BOOL,
|
|
DWORD,
|
|
LPVOID,
|
|
LPCWSTR,
|
|
LPSTARTUPINFOW,
|
|
LPPROCESS_INFORMATION> ntLikeHookCreateProcessW;
|
|
#else
|
|
AuSupplierConsumer<int,
|
|
void *,
|
|
void *,
|
|
void *,
|
|
void *,
|
|
int,
|
|
unsigned long,
|
|
void *,
|
|
void *,
|
|
void *,
|
|
void *> ntLikeHookCreateProcessW;
|
|
#endif
|
|
#endif
|
|
};
|
|
} |