#include <winsock.h>
#include <stdio.h>
Go to the source code of this file.
◆ DBG
Value: printf(
"%s:%i - %s", __FILE__, __LINE__,
x); \
DbgPrint(
"%s:%i - %s", __FILE__, __LINE__,
x);
GLint GLint GLint GLint GLint x
Definition at line 12 of file moztest.c.
◆ DbgPrint()
◆ main()
Definition at line 232 of file moztest.c.
233{
235 {
237 printf(
"Valid test names:\n");
240 return 0;
241 }
242
247
249
250 return 0;
251}
◆ SocketTest()
Definition at line 16 of file moztest.c.
17{
18
19
20
21
22
23
24
25
26
27
31 int addrLen;
32 WORD wVersionRequested;
35
36
37
38
39
40 wVersionRequested =
MAKEWORD( 2, 2 );
41
42 DBG(
"Calling WSAStartup\n");
45
46
47 DBG(
"WSAStartup failed\n");
48 return 1;
49 }
50
51
52
53
54
55
56
59
60
61 DBG(
"WSAStartup version unacceptable\n");
63 return 1;
64 }
65
66
67
68 DBG(
"Calling socket\n");
72 DBG(
"socket failed\n");
73 goto failed;
74 }
75
77 selfAddr.sin_port = 0;
79 addrLen = sizeof(selfAddr);
80 DBG(
"Calling bind\n");
84 goto failed;
85 }
86
87 DBG(
"Calling getsockname\n");
90 DBG(
"getsockname failed\n");
91 goto failed;
92 }
93
94 DBG(
"Calling listen\n");
96 DBG(
"listen failed\n");
97 goto failed;
98 }
99
100 DBG(
"Calling socket\n");
103 DBG(
"socket failed\n");
104 goto failed;
105 }
107
108
109
110
111
112
113
114
115
116
117 DBG(
"Calling connect\n");
120 DBG(
"connect failed\n");
121 goto failed;
122 }
123
124
125
126
127
128
129 DBG(
"Calling getsockname\n");
132 DBG(
"getsockname failed\n");
133 goto failed;
134 }
135
136 DBG(
"Calling accept\n");
137 osfd[1] =
accept(listenSock, (
struct sockaddr *) &peerAddr, &addrLen);
139 DBG(
"accept failed\n");
140 goto failed;
141 }
142 if (peerAddr.sin_port != selfAddr.sin_port) {
143
144 DBG(
"peerAddr.sin_port != selfAddr.sin_port\n");
145 goto failed;
146 }
147
149
151
154
156
157 return 0;
158
159failed:
162 }
165 }
168 }
169
171
172 return 1;
173}
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
INT WSAAPI listen(IN SOCKET s, IN INT backlog)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
int PASCAL FAR WSACleanup(void)
Referenced by main().
◆ VirtualTest()
Definition at line 175 of file moztest.c.
176{
183
184 DBG(
"Calling CreateFileMappingA\n");
187 if (!hMap)
188 {
189 DBG(
"CreateFileMappingA failed\n");
190 return 1;
191 }
192
194 DBG(
"Calling MapViewOfFile\n");
196 if (!pBufferStart)
197 {
198 DBG(
"MapViewOfFile failed\n");
199 return 1;
200 }
201
203
205 {
206 DBG(
"MapViewOfFile returned ERROR_ALREADY_EXISTS\n");
207 DBG(
"This really shouldn't happen, but it's not fatal.\n");
210 return 1;
211 }
212 else
213 {
214 DBG(
"Calling VirtualAlloc\n");
216 {
217 DBG(
"VirtualAlloc failed\n");
220 return 1;
221 }
222 }
223
225
228
229 return 0;
230}
ACPI_SIZE strlen(const char *String)
#define INVALID_HANDLE_VALUE
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
#define ERROR_ALREADY_EXISTS
WORD WORD PSZ PSZ pszFileName
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
DWORD WINAPI GetLastError(void)
#define FILE_MAP_ALL_ACCESS
Referenced by main().