-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathws2_32.cpp
More file actions
41 lines (34 loc) · 763 Bytes
/
ws2_32.cpp
File metadata and controls
41 lines (34 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "environment.h"
#include "wintypes.h"
using namespace wintypes;
#include "kernel32.h"
#include <cstring>
namespace ws2_32 {
;
struct WSAData {
WORD wVersion;
WORD wHighVersion;
char szDescription[257];
char szSystemStatus[129];
unsigned short iMaxSockets;
unsigned short iMaxUdpDg;
void* lpVendorInfo;
};
int WINAPI WSAStartup(WORD version, WSAData* data) {
data->wVersion = 0x0202;
data->wHighVersion = 0x0202;
memcpy(data->szDescription, "WinSock 2.0", 12);
memcpy(data->szSystemStatus, "Running", 8);
data->iMaxSockets = 0;
data->iMaxUdpDg = 0;
data->lpVendorInfo = nullptr;
return 0;
}
int WINAPI WSACleanup() {
return 0;
}
register_funcs funcs("ws2_32", {
{ "ordinal 115", WSAStartup },
{ "ordinal 116", WSACleanup },
});
}