mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-04-23 23:03:35 +03:00
lsteamclient: Initialize sockets in load_steamclient().
CW-Bug-Id: #23749
This commit is contained in:
parent
5cfe529c2a
commit
5a996971d7
@ -1,6 +1,6 @@
|
|||||||
MODULE = lsteamclient.dll
|
MODULE = lsteamclient.dll
|
||||||
UNIXLIB = lsteamclient.so
|
UNIXLIB = lsteamclient.so
|
||||||
IMPORTS = user32
|
IMPORTS = user32 ws2_32
|
||||||
|
|
||||||
EXTRADEFS = -DWINE_NO_LONG_TYPES -DSTEAM_API_EXPORTS -Dprivate=public -Dprotected=public
|
EXTRADEFS = -DWINE_NO_LONG_TYPES -DSTEAM_API_EXPORTS -Dprivate=public -Dprotected=public
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "winnls.h"
|
#include "winnls.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "winternl.h"
|
#include "winternl.h"
|
||||||
|
#include "winsock2.h"
|
||||||
|
|
||||||
#include "steamclient_private.h"
|
#include "steamclient_private.h"
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ static char temp_path_buffer[TEMP_PATH_BUFFER_LENGTH];
|
|||||||
|
|
||||||
static CRITICAL_SECTION steamclient_cs = { NULL, -1, 0, 0, 0, 0 };
|
static CRITICAL_SECTION steamclient_cs = { NULL, -1, 0, 0, 0, 0 };
|
||||||
static HANDLE steam_overlay_event;
|
static HANDLE steam_overlay_event;
|
||||||
|
static BOOL wsa_initialized;
|
||||||
|
|
||||||
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
|
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
|
||||||
{
|
{
|
||||||
@ -67,6 +69,11 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
|
|||||||
break;
|
break;
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
CloseHandle(steam_overlay_event);
|
CloseHandle(steam_overlay_event);
|
||||||
|
if (wsa_initialized)
|
||||||
|
{
|
||||||
|
WSACleanup();
|
||||||
|
wsa_initialized = FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,6 +354,14 @@ static int load_steamclient(void)
|
|||||||
params.ignore_child_processes = ignore_child_processes;
|
params.ignore_child_processes = ignore_child_processes;
|
||||||
|
|
||||||
if (STEAMCLIENT_CALL( steamclient_init, ¶ms )) return 0;
|
if (STEAMCLIENT_CALL( steamclient_init, ¶ms )) return 0;
|
||||||
|
if (!wsa_initialized)
|
||||||
|
{
|
||||||
|
/* Some games depend on winsocks being initialized after initializing Steam API. */
|
||||||
|
WSADATA data;
|
||||||
|
|
||||||
|
WSAStartup(0x202, &data);
|
||||||
|
wsa_initialized = TRUE;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user