AuroraRuntime/Include/Aurora/Process/Process.hpp

43 lines
1.5 KiB
C++
Raw Normal View History

2021-06-27 21:25:29 +00:00
/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Process.hpp
Date: 2021-6-10
Author: Reece
***/
#pragma once
#include "Paths.hpp"
2021-09-06 10:58:08 +00:00
#include "ProcessMap.hpp"
namespace Aurora::Process
{
AUKN_SYM AU_NORETURN void Exit(AuUInt32 exitcode);
enum class EModulePath
{
eModulePathCWD,
eModulePathSystemDir, /// /lib/, windir/system32
eModulePathUserDir, /// /usr/lib/
eProcessDirectory, ///
eOSSpecified, /// LD_LIBRARY_PATH + /etc/ld.so.conf, AddDllDirectory
eSpecified
};
static AuList<EModulePath> kUserOverloadableSearchPath = {EModulePath::eSpecified, EModulePath::eModulePathCWD, EModulePath::eProcessDirectory, EModulePath::eModulePathUserDir, EModulePath::eModulePathSystemDir};
static AuList<EModulePath> kAdminOverloadableSearchPath = {EModulePath::eSpecified, EModulePath::eModulePathSystemDir, EModulePath::eProcessDirectory, EModulePath::eModulePathCWD, EModulePath::eModulePathUserDir};
struct ModuleLoadRequest
{
AuString mod;
AuOptional<AuString> version;
AuOptional<AuString> extension;
AuList<AuString> const *specifiedSearchPaths {};
AuList<EModulePath> const *searchPath {};
bool verifyOne {}; // always true if the executable is signed
bool verifyAll {};
};
AUKN_SYM bool LoadModule(const ModuleLoadRequest &request);
AUKN_SYM AuMach GetProcAddress(AuString mod, AuString symbol);
}