//
// sub_18010A300 from 0x18010a300 to 0x18010a3e8 (232 bytes)
//
// 4 xrefs:
// > sub_180109DF0 @ 0x180109e4f
// > sub_180109EC0 @ 0x180109fb2
// > sub_18010A160 @ 0x18010a1a9
// > ??> @ 0x1802017b4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_18010A300(SOCKET s, unsigned __int8 a2)
{
u_long argp; // [rsp+50h] [rbp-38h] BYREF
char optval[4]; // [rsp+54h] [rbp-34h] BYREF
DWORD cbBytesReturned; // [rsp+58h] [rbp-30h] BYREF
_DWORD vInBuffer[4]; // [rsp+60h] [rbp-28h] BYREF
argp = a2;
if ( ioctlsocket(s, -2147195266, &argp) == -1 )
return 43;
*(_DWORD *)optval = 1;
if ( setsockopt(s, 0xFFFF, 8, optval, 4) == -1 )
return 43;
vInBuffer[0] = 1;
vInBuffer[2] = dword_1801AEA7C / 10;
vInBuffer[1] = dword_1801AEA7C / 10;
if ( WSAIoctl(s, 0x98000004, vInBuffer, 0xCu, nullptr, 0, &cbBytesReturned, nullptr, nullptr) == -1 )
return 43;
else
return 0;
}