From 775b089e80d184268abc9614ae6bcafc7d777329 Mon Sep 17 00:00:00 2001 From: otavepto Date: Tue, 9 Apr 2024 10:38:56 +0200 Subject: [PATCH] imitate win resources of gameoverlayrenderer + add resources to networkingsocketslib --- CHANGELOG.md | 3 +- build_win.bat | 20 ++++- resources/README.md | 1 + .../win/game_overlay_renderer/32/resources.rc | 77 +++++++++++++++++++ .../win/game_overlay_renderer/64/resources.rc | 77 +++++++++++++++++++ .../SOURCE_CONTROL_ID.txt | 1 + .../WEVT_TEMPLATE1_1.bin | 1 + 7 files changed, 175 insertions(+), 5 deletions(-) create mode 100644 resources/win/game_overlay_renderer/32/resources.rc create mode 100644 resources/win/game_overlay_renderer/64/resources.rc create mode 100644 resources/win/game_overlay_renderer/SOURCE_CONTROL_ID.txt create mode 100644 resources/win/game_overlay_renderer/WEVT_TEMPLATE1_1.bin diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d353b46..295a2323 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ * properly implement `Steam_Apps::GetAvailableGameLanguages()` * ensure current emu language is inside `supported_languages` list -* run the background thread for callbacks earlier inside `Steam_Client::ConnectToGlobalUser()` +* run the callbacks background thread earlier inside `Steam_Client::ConnectToGlobalUser()` since some games don't call `SteamAPI_RunCallbacks()` or `SteamAPI_ManualDispatch_RunFrame()` or `Steam_BGetCallback()` hence all run_callbacks() will never run, also networking callbacks won't run * decrease the periodicity of the background thread to `~100ms`, also prevent it from running if the callbacks are already running * output function name in debug log +* imitate Windows resources of gameoverlayrenderer + add resources to networkingsocketslib --- diff --git a/build_win.bat b/build_win.bat index 1e1d9275..95203890 100644 --- a/build_win.bat +++ b/build_win.bat @@ -331,6 +331,12 @@ call :build_rsrc "%win_resources_src_dir%\launcher\32\resources.rc" "%win_resour set /a last_code=1 goto :end_script ) +call :build_rsrc "%win_resources_src_dir%\game_overlay_renderer\32\resources.rc" "%win_resources_out_dir%\rsrc-gameoverlay-32.res" || ( + endlocal + call :err_msg "Resource compiler failed - 32" + set /a last_code=1 + goto :end_script +) echo: & echo: if %BUILD_LIB32% equ 1 ( @@ -456,6 +462,12 @@ call :build_rsrc "%win_resources_src_dir%\launcher\64\resources.rc" "%win_resour set /a last_code=1 goto :end_script ) +call :build_rsrc "%win_resources_src_dir%\game_overlay_renderer\64\resources.rc" "%win_resources_out_dir%\rsrc-gameoverlay-64.res" || ( + endlocal + call :err_msg "Resource compiler failed - 64" + set /a last_code=1 + goto :end_script +) echo: & echo: if %BUILD_LIB64% equ 1 ( @@ -666,7 +678,7 @@ endlocal & exit /b %_exit% :compile_networking_sockets_lib_32 setlocal echo // building library steamnetworkingsockets.dll - 32 - set src_files="networking_sockets_lib\steamnetworkingsockets.cpp" + set src_files="%win_resources_out_dir%\rsrc-client-32.res" "networking_sockets_lib\steamnetworkingsockets.cpp" call :build_for 1 0 "%build_root_dir%\networking_sockets_lib\steamnetworkingsockets.dll" src_files set /a _exit=%errorlevel% if %_exit% equ 0 ( @@ -678,7 +690,7 @@ endlocal & exit /b %_exit% :compile_gameoverlay_lib_32 setlocal echo // building experimental library GameOverlayRenderer.dll - 32 - set src_files="game_overlay_renderer_lib\game_overlay_renderer_lib.cpp" + set src_files="%win_resources_out_dir%\rsrc-gameoverlay-32.res" "game_overlay_renderer_lib\game_overlay_renderer_lib.cpp" set extra_inc_dirs=/I"game_overlay_renderer_lib" call :build_for 1 0 "%steamclient_dir%\GameOverlayRenderer.dll" src_files extra_inc_dirs set /a _exit=%errorlevel% @@ -773,7 +785,7 @@ endlocal & exit /b %_exit% :compile_networking_sockets_lib_64 setlocal echo // building library steamnetworkingsockets64.dll - 64 - set src_files="networking_sockets_lib\steamnetworkingsockets.cpp" + set src_files="%win_resources_out_dir%\rsrc-client-64.res" "networking_sockets_lib\steamnetworkingsockets.cpp" call :build_for 0 0 "%build_root_dir%\networking_sockets_lib\steamnetworkingsockets64.dll" src_files set /a _exit=%errorlevel% if %_exit% equ 0 ( @@ -785,7 +797,7 @@ endlocal & exit /b %_exit% :compile_gameoverlay_lib_64 setlocal echo // building experimental library GameOverlayRenderer64.dll - 64 - set src_files="game_overlay_renderer_lib\game_overlay_renderer_lib.cpp" + set src_files="%win_resources_out_dir%\rsrc-gameoverlay-64.res" "game_overlay_renderer_lib\game_overlay_renderer_lib.cpp" set extra_inc_dirs=/I"game_overlay_renderer_lib" call :build_for 0 0 "%steamclient_dir%\GameOverlayRenderer64.dll" src_files extra_inc_dirs set /a _exit=%errorlevel% diff --git a/resources/README.md b/resources/README.md index 394cefe3..37cb613e 100644 --- a/resources/README.md +++ b/resources/README.md @@ -13,5 +13,6 @@ This directory contains additional resources used during build. * [api](./win/api/): contains an immitation of the resources found in `steam_api(64).dll` * [client](./win/client/): contains an immitation of the resources found in `steamclient(64).dll` * [launcher](./win/launcher/): contains an immitation of the resources found in `steam.exe` + * [game_overlay_renderer](./win/game_overlay_renderer/): contains an immitation of the resources found in `GameOverlayRenderer(64).dll` * [file_dos_stub](./win/file_dos_stub/): contains an immitation of how the DOS stub is manipulated after build diff --git a/resources/win/game_overlay_renderer/32/resources.rc b/resources/win/game_overlay_renderer/32/resources.rc new file mode 100644 index 00000000..7e87d2cf --- /dev/null +++ b/resources/win/game_overlay_renderer/32/resources.rc @@ -0,0 +1,77 @@ +// ===================================================================================== 0 +LANGUAGE 0, 0 + +SOURCE_CONTROL_ID SCID "../SOURCE_CONTROL_ID.txt" + +1 VERSIONINFO +FILEVERSION 8,74,80,95 +PRODUCTVERSION 1,0,0,1 +FILEFLAGSMASK 0x17 +FILEFLAGS 0x0 +FILEOS 0x00000004L // VOS__WINDOWS32 +FILETYPE 0x2L // VFT_DLL +FILESUBTYPE 0x0L // VFT2_UNKNOWN +{ + BLOCK "StringFileInfo" + { + BLOCK "040904b0" // language code = U.S. English, character-set identifier = Unicode + { + VALUE "LegalCopyright", "Copyright (C) 2007" + VALUE "InternalName", "GameOverlayRenderer (win32)" + VALUE "FileVersion", "08.74.80.95" + VALUE "CompanyName", "GSE" + VALUE "ProductVersion", "01.00.00.01" + VALUE "FileDescription", "GSE Overlay Renderer" + VALUE "Source Control ID", "8748095" + VALUE "OriginalFilename", "GameOverlayRenderer.dll" + VALUE "ProductName", "GSE Overlay Renderer" + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409 0x04B0 // English language (0x409) in the Windows ANSI codepage (1252) + } +} + + + +// ===================================================================================== 1033 +LANGUAGE 0x09, 0x01 + +1 VERSIONINFO +FILEVERSION 1,0,0,1 +PRODUCTVERSION 1,0,0,1 +FILEFLAGSMASK 0x17 +FILEFLAGS 0x0 +FILEOS 0x00000004L // VOS__WINDOWS32 +FILETYPE 0x2L // VFT_DLL +FILESUBTYPE 0x0L // VFT2_UNKNOWN +{ + BLOCK "StringFileInfo" + { + BLOCK "040904b0" // language code = U.S. English, character-set identifier = Unicode + { + VALUE "CompanyName", "GSE" + VALUE "FileDescription", "GSE Overlay Renderer" + VALUE "FileVersion", "1, 0, 0, 1" + VALUE "InternalName", "GameOverlayRenderer" + VALUE "LegalCopyright", "Copyright (C) 2007" + VALUE "OriginalFilename", "GameOverlayRenderer.dll" + VALUE "ProductName", "GSE Overlay Renderer" + VALUE "ProductVersion", "1, 0, 0, 1" + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409 0x04B0 // English language (0x409) in the Windows ANSI codepage (1252) + } +} + + + +// ===================================================================================== 4147 +LANGUAGE 0x33, 0x04 + +1 WEVT_TEMPLATE "../WEVT_TEMPLATE1_1.bin" diff --git a/resources/win/game_overlay_renderer/64/resources.rc b/resources/win/game_overlay_renderer/64/resources.rc new file mode 100644 index 00000000..cbdd71f8 --- /dev/null +++ b/resources/win/game_overlay_renderer/64/resources.rc @@ -0,0 +1,77 @@ +// ===================================================================================== 0 +LANGUAGE 0, 0 + +SOURCE_CONTROL_ID SCID "../SOURCE_CONTROL_ID.txt" + +1 VERSIONINFO +FILEVERSION 8,74,80,95 +PRODUCTVERSION 1,0,0,1 +FILEFLAGSMASK 0x17 +FILEFLAGS 0x0 +FILEOS 0x00000004L // VOS__WINDOWS32 +FILETYPE 0x2L // VFT_DLL +FILESUBTYPE 0x0L // VFT2_UNKNOWN +{ + BLOCK "StringFileInfo" + { + BLOCK "040904b0" // language code = U.S. English, character-set identifier = Unicode + { + VALUE "LegalCopyright", "Copyright (C) 2007" + VALUE "InternalName", "GameOverlayRenderer (win64)" + VALUE "FileVersion", "08.74.80.95" + VALUE "CompanyName", "GSE" + VALUE "ProductVersion", "01.00.00.01" + VALUE "FileDescription", "GSE Overlay Renderer" + VALUE "Source Control ID", "8748095" + VALUE "OriginalFilename", "GameOverlayRenderer.dll" + VALUE "ProductName", "GSE Overlay Renderer" + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409 0x04B0 // English language (0x409) in the Windows ANSI codepage (1252) + } +} + + + +// ===================================================================================== 1033 +LANGUAGE 0x09, 0x01 + +1 VERSIONINFO +FILEVERSION 1,0,0,1 +PRODUCTVERSION 1,0,0,1 +FILEFLAGSMASK 0x17 +FILEFLAGS 0x0 +FILEOS 0x00000004L // VOS__WINDOWS32 +FILETYPE 0x2L // VFT_DLL +FILESUBTYPE 0x0L // VFT2_UNKNOWN +{ + BLOCK "StringFileInfo" + { + BLOCK "040904b0" // language code = U.S. English, character-set identifier = Unicode + { + VALUE "CompanyName", "GSE" + VALUE "FileDescription", "GSE Overlay Renderer" + VALUE "FileVersion", "1, 0, 0, 1" + VALUE "InternalName", "GameOverlayRenderer" + VALUE "LegalCopyright", "Copyright (C) 2007" + VALUE "OriginalFilename", "GameOverlayRenderer.dll" + VALUE "ProductName", "GSE Overlay Renderer" + VALUE "ProductVersion", "1, 0, 0, 1" + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409 0x04B0 // English language (0x409) in the Windows ANSI codepage (1252) + } +} + + + +// ===================================================================================== 4147 +LANGUAGE 0x33, 0x04 + +1 WEVT_TEMPLATE "../WEVT_TEMPLATE1_1.bin" diff --git a/resources/win/game_overlay_renderer/SOURCE_CONTROL_ID.txt b/resources/win/game_overlay_renderer/SOURCE_CONTROL_ID.txt new file mode 100644 index 00000000..983a68ab --- /dev/null +++ b/resources/win/game_overlay_renderer/SOURCE_CONTROL_ID.txt @@ -0,0 +1 @@ +8748095 \ No newline at end of file diff --git a/resources/win/game_overlay_renderer/WEVT_TEMPLATE1_1.bin b/resources/win/game_overlay_renderer/WEVT_TEMPLATE1_1.bin new file mode 100644 index 00000000..d8cff1b2 --- /dev/null +++ b/resources/win/game_overlay_renderer/WEVT_TEMPLATE1_1.bin @@ -0,0 +1 @@ +GSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGSEGS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