mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Initialize Winsock
This commit is contained in:
parent
3a852b63d2
commit
174db2fd95
@ -68,6 +68,14 @@
|
||||
|
||||
void Systems_Init()
|
||||
{
|
||||
// Initialize winsock system
|
||||
WSAData wsaData{};
|
||||
int nError = ::WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
if (nError != 0)
|
||||
{
|
||||
assert(nError != 0 && "Failed to start Winsock via WSAStartup.");
|
||||
}
|
||||
|
||||
// Begin the detour transaction to hook the the process
|
||||
DetourTransactionBegin();
|
||||
DetourUpdateThread(GetCurrentThread());
|
||||
@ -137,6 +145,13 @@ void Systems_Init()
|
||||
|
||||
void Systems_Shutdown()
|
||||
{
|
||||
// Shutdown winsock system
|
||||
int nError = ::WSACleanup();
|
||||
if (nError != 0)
|
||||
{
|
||||
assert(nError != 0 && "Failed to stop winsock via WSACleanup.\n");
|
||||
}
|
||||
|
||||
// Begin the detour transaction to unhook the the process
|
||||
DetourTransactionBegin();
|
||||
DetourUpdateThread(GetCurrentThread());
|
||||
|
Loading…
x
Reference in New Issue
Block a user