Skip to content

Commit

Permalink
Don't read file when in loader lock.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetopia committed Sep 25, 2024
1 parent 23bcae4 commit c1f5cb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Stonecutter.Game.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ HRESULT ResizeBuffers(IDXGISwapChain *This, UINT BufferCount, UINT Width, UINT H

DWORD ThreadProc(LPVOID lpParameter)
{
WCHAR szFileName[MAX_PATH] = {};
ExpandEnvironmentStringsW(L"%LOCALAPPDATA%\\..\\RoamingState\\Stonecutter.ini", szFileName, MAX_PATH);
fD3D11 = GetPrivateProfileIntW(L"Settings", L"D3D11", FALSE, szFileName) == TRUE;

MH_Initialize();

IDXGIFactory2 *pFactory = NULL;
Expand Down Expand Up @@ -107,10 +111,6 @@ BOOL DllMainCRTStartup(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
return FALSE;
}

WCHAR szFileName[MAX_PATH] = {};
ExpandEnvironmentStringsW(L"%LOCALAPPDATA%\\..\\RoamingState\\Stonecutter.ini", szFileName, MAX_PATH);
fD3D11 = GetPrivateProfileIntW(L"Settings", L"D3D11", FALSE, szFileName) == TRUE;

DisableThreadLibraryCalls(hinstDLL);
CloseHandle(CreateThread(NULL, 0, ThreadProc, NULL, 0, NULL));
}
Expand Down

0 comments on commit c1f5cb8

Please sign in to comment.