From db8db7b0ccd7d5d80178f454b10483c67db81497 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Wed, 13 Sep 2023 15:14:22 +0100 Subject: [PATCH] [+] Secret visible symbol: Aurora::Win32Open/AuWin32Open --- Include/Aurora/IO/NT/Win32Open.hpp | 35 ++++++++++++++++++++++++++++++ Include/Aurora/IO/UNIX/UNIX.hpp | 6 +++++ Source/AuProcAddresses.NT.hpp | 1 + Source/RuntimeInternal.hpp | 4 ++-- 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 Include/Aurora/IO/NT/Win32Open.hpp diff --git a/Include/Aurora/IO/NT/Win32Open.hpp b/Include/Aurora/IO/NT/Win32Open.hpp new file mode 100644 index 00000000..32f086cd --- /dev/null +++ b/Include/Aurora/IO/NT/Win32Open.hpp @@ -0,0 +1,35 @@ +/*** + Copyright (C) 2023 J Reece Wilson (a/k/a "Reece"). All rights reserved. + + File: Win32Open.hpp + Date: 2023-9-13 + Author: Reece + + Note: These file is excluded from the default include tree. + You must explicitly include this via: +#if defined(AURORA_IS_MODERNNT_DERIVED) + #include +#endif +***/ +#pragma once + +#if !defined(AUKN_SYM) + // So long as it [DLL + Static] doesn't conflict with an impl, MSVC [link and cl] doesn't care. + #define AUKN_SYM +#endif + +namespace Aurora +{ + // Now you should hopefully need not worry about the 3 Bill-ion Shaftsoft CreateFile[2][FromApp][W/A] variants... + // ...and the varying degress of dwFlags/dwAttrs support. + AUKN_SYM HANDLE Win32Open(LPCWSTR lpFileName, + DWORD dwDesiredAccess = GENERIC_READ | GENERIC_WRITE, + DWORD dwShareMode = FILE_SHARE_READ, + bool bInherit = false, + DWORD dwCreationDisposition = 0, + DWORD dwFlags = 0, + DWORD dwAttributes = 0 + ); +} + +#define AuWin32Open Aurora::Win32Open \ No newline at end of file diff --git a/Include/Aurora/IO/UNIX/UNIX.hpp b/Include/Aurora/IO/UNIX/UNIX.hpp index 7aa389e4..d3d80198 100755 --- a/Include/Aurora/IO/UNIX/UNIX.hpp +++ b/Include/Aurora/IO/UNIX/UNIX.hpp @@ -4,6 +4,12 @@ File: UNIX.hpp Date: 2022-4-14 Author: Reece + + Note: These file is excluded from the default include tree. + You must explicitly include this via: +#if defined(AURORA_IS_POSIX_DERIVED) + #include +#endif ***/ #pragma once diff --git a/Source/AuProcAddresses.NT.hpp b/Source/AuProcAddresses.NT.hpp index b45947bc..8f6be85d 100644 --- a/Source/AuProcAddresses.NT.hpp +++ b/Source/AuProcAddresses.NT.hpp @@ -530,6 +530,7 @@ namespace Aurora void Win32Terminate(); + AUKN_SYM /* I'm going to be kind */ HANDLE Win32Open(LPCWSTR lpFileName, DWORD dwDesiredAccess = GENERIC_READ | GENERIC_WRITE, DWORD dwShareMode = FILE_SHARE_READ, diff --git a/Source/RuntimeInternal.hpp b/Source/RuntimeInternal.hpp index 4ccf8d32..12f6d889 100644 --- a/Source/RuntimeInternal.hpp +++ b/Source/RuntimeInternal.hpp @@ -67,12 +67,12 @@ #endif -#include "AuProcAddresses.hpp" - #define GIMME_IOWAITABLEITEM #include +#include "AuProcAddresses.hpp" + inline Aurora::RuntimeStartInfo gRuntimeConfig; inline int gRuntimeRunLevel {0};