From ab453aaf11c703c03efb3f4519e40c0ebae5c8a3 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Wed, 19 Jun 2019 13:36:50 -0500 Subject: [PATCH] steam_helper: Fix building against Wine 4.11 --- build/makefile_base.mak | 3 ++- steam_helper/steam.cpp | 23 ++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/build/makefile_base.mak b/build/makefile_base.mak index 635c6cc2..88cc5601 100644 --- a/build/makefile_base.mak +++ b/build/makefile_base.mak @@ -729,10 +729,11 @@ STEAMEXE_CONFIGURE_FILES := $(STEAMEXE_OBJ)/Makefile $(STEAMEXE_CONFIGURE_FILES): SHELL = $(CONTAINER_SHELL32) $(STEAMEXE_CONFIGURE_FILES): $(STEAMEXE_SYN) $(MAKEFILE_DEP) | $(STEAMEXE_OBJ) $(WINEMAKER) cd $(dir $@) && \ - $(WINEMAKER) --nosource-fix --nolower-include --nodlls --nomsvcrt --wine32 \ + $(WINEMAKER) --nosource-fix --nolower-include --nodlls --wine32 \ -I"../$(TOOLS_DIR32)"/include/ \ -I"../$(TOOLS_DIR32)"/include/wine/ \ -I"../$(TOOLS_DIR32)"/include/wine/windows/ \ + -I"../$(TOOLS_DIR32)"/include/wine/msvcrt/ \ -I"../$(SRCDIR)"/lsteamclient/steamworks_sdk_142/ \ -L"../$(TOOLS_DIR32)"/lib/ \ -L"../$(TOOLS_DIR32)"/lib/wine/ \ diff --git a/steam_helper/steam.cpp b/steam_helper/steam.cpp index 2ff2b44d..9af06fa9 100644 --- a/steam_helper/steam.cpp +++ b/steam_helper/steam.cpp @@ -33,6 +33,8 @@ * Windows version of Steam running. */ #include +#include +#include #pragma push_macro("_WIN32") #pragma push_macro("__cdecl") @@ -42,7 +44,6 @@ #pragma pop_macro("_WIN32") #pragma pop_macro("__cdecl") -#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(steam); @@ -118,7 +119,7 @@ static void setup_steam_registry(void) static WCHAR *find_quote(WCHAR *str) { - WCHAR *end = strchrW(str, '"'), *ch; + WCHAR *end = wcschr(str, '"'), *ch; int odd; while (end) { @@ -131,7 +132,7 @@ static WCHAR *find_quote(WCHAR *str) } if (!odd) return end; - end = strchrW(end + 1, '"'); + end = wcschr(end + 1, '"'); } return NULL; } @@ -150,7 +151,7 @@ static HANDLE run_process(void) } else { - cmdline = strchrW(cmdline, ' '); + cmdline = wcschr(cmdline, ' '); } if (!cmdline) { @@ -187,9 +188,9 @@ static HANDLE run_process(void) else { start = cmdline; - end = strchrW(start, ' '); + end = wcschr(start, ' '); if (!end) - end = strchrW(start, '\0'); + end = wcschr(start, '\0'); remainder = end; } @@ -220,11 +221,11 @@ static HANDLE run_process(void) dos = wine_get_dos_file_name(scratchA); new_cmdline = (WCHAR *)HeapAlloc(GetProcessHeap(), 0, - (strlenW(dos) + 3 + strlenW(remainder) + 1) * sizeof(WCHAR)); - strcpyW(new_cmdline, dquoteW); - strcatW(new_cmdline, dos); - strcatW(new_cmdline, dquoteW); - strcatW(new_cmdline, remainder); + (lstrlenW(dos) + 3 + lstrlenW(remainder) + 1) * sizeof(WCHAR)); + lstrcpyW(new_cmdline, dquoteW); + lstrcatW(new_cmdline, dos); + lstrcatW(new_cmdline, dquoteW); + lstrcatW(new_cmdline, remainder); cmdline = new_cmdline; }