Skip to content

Commit

Permalink
Disable GPU Accel Webviews using command line arg.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetopia committed Mar 31, 2024
1 parent 59a8dec commit 2559cdf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
5 changes: 1 addition & 4 deletions DllMain.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include <windows.h>

LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
VOID CALLBACK WinEventProc(HWINEVENTHOOK hWinEventHook, DWORD event, HWND hwnd, LONG idObject, LONG idChild,
DWORD dwEventThread, DWORD dwmsEventTime);
DWORD ThreadProc(LPVOID lpParameter);
DWORD ThreadProc(LPVOID);

LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
Expand Down
20 changes: 7 additions & 13 deletions WinMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@ int wWinMainCRTStartup()
}

PROCESS_INFORMATION ProcessInformation = {};
if (CreateProcessW(NULL,
lstrcatW(lstrcpyW(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
106 + (sizeof(WCHAR) * lstrlenW(GetCommandLineW()))),
L"steam.exe -cef-single-process -cef-disable-breakpad "),
GetCommandLineW()),
NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &((STARTUPINFOW){}), &ProcessInformation))
{
HKEY hKey = NULL;
RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Valve\\Steam", 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_CREATE_SUB_KEY | KEY_SET_VALUE, NULL, &hKey, NULL);
RegSetValueExW(hKey, L"GPUAccelWebViewsV3", 0, REG_DWORD, (BYTE *)&((DWORD){}), sizeof(DWORD));
RegCloseKey(hKey);
}
CreateProcessW(
NULL,
lstrcatW(
lstrcpyW(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 164 + (sizeof(WCHAR) * lstrlenW(GetCommandLineW()))),
L"steam.exe -cef-single-process -cef-disable-breakpad -cef-disable-gpu-compositing "),
GetCommandLineW()),
NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &((STARTUPINFOW){}), &ProcessInformation);

LPVOID lpBaseAddress = VirtualAllocEx(ProcessInformation.hProcess, NULL, dwSize = 42, MEM_COMMIT, PAGE_READWRITE);
WriteProcessMemory(ProcessInformation.hProcess, lpBaseAddress, L"NoSteamWebHelper.dll", dwSize, NULL);
Expand Down

0 comments on commit 2559cdf

Please sign in to comment.