From d97e573df42a8f86cf0e1cda1cfa87fdcea42301 Mon Sep 17 00:00:00 2001 From: Aetopia <41850963+Aetopia@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:48:01 +0530 Subject: [PATCH] Read from configuration file when callback is a invoked. --- src/DllMain.c | 8 ++++---- src/Resources/DllMain.rc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/DllMain.c b/src/DllMain.c index 1fbfe39..34d1f25 100644 --- a/src/DllMain.c +++ b/src/DllMain.c @@ -77,6 +77,10 @@ HRESULT _CreateSwapChainForCoreWindow_(IDXGIFactory2 *This, LPUNKNOWN pDevice, HWND _CreateWindowExW_(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, INT X, INT Y, INT nWidth, INT nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam) { + WCHAR szPath[MAX_PATH] = {}; + ExpandEnvironmentStringsW(L"%LOCALAPPDATA%\\..\\RoamingState\\Stonecutter.ini", szPath, MAX_PATH); + fForce = GetPrivateProfileIntW(&((WCHAR){}), &((WCHAR){}), FALSE, szPath) == TRUE; + MH_QueueDisableHook(CreateWindowExW); HWND hWnd = __CreateWindowExW__(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); @@ -125,10 +129,6 @@ BOOL DllMainCRTStartup(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) CSTR_EQUAL) return FALSE; - WCHAR szFileName[MAX_PATH] = {}; - ExpandEnvironmentStringsW(L"%LOCALAPPDATA%\\..\\RoamingState\\Stonecutter.ini", szFileName, MAX_PATH); - fForce = GetPrivateProfileIntW(L"", L"", FALSE, szFileName) == TRUE; - MH_Initialize(); MH_CreateHook(CreateWindowExW, &_CreateWindowExW_, (LPVOID)&__CreateWindowExW__); MH_EnableHook(CreateWindowExW); diff --git a/src/Resources/DllMain.rc b/src/Resources/DllMain.rc index 428157f..bc21f65 100644 --- a/src/Resources/DllMain.rc +++ b/src/Resources/DllMain.rc @@ -1,6 +1,6 @@ #include VS_VERSION_INFO VERSIONINFO -FILEVERSION 1, 5, 3, 2 +FILEVERSION 1, 5, 3, 3 BEGIN BLOCK "StringFileInfo" BEGIN @@ -8,7 +8,7 @@ BLOCK "040904b0" BEGIN VALUE "FileDescription", "Stonecutter" VALUE "ProductName", "Stonecutter" -VALUE "ProductVersion", "1.5.3.2" +VALUE "ProductVersion", "1.5.3.3" VALUE "LegalCopyright", "Copyright (C) 2024 - 25" END END