Skip to content

Commit

Permalink
Read from configuration file when callback is a invoked.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetopia committed Jan 27, 2025
1 parent 4b394ab commit d97e573
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/DllMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/DllMain.rc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 5, 3, 2
FILEVERSION 1, 5, 3, 3
BEGIN
BLOCK "StringFileInfo"
BEGIN
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
Expand Down

0 comments on commit d97e573

Please sign in to comment.