1 /* 2 * COPYRIGHT: See COPYING in the top level directory 3 * PROJECT: ReactOS WinSock DLL 4 * FILE: stubs.c 5 * PURPOSE: Stub functions 6 * PROGRAMMERS: Ge van Geldorp (ge@gse.nl) 7 * REVISIONS: 8 */ 9 10 #include "precomp.h" 11 12 #include <windef.h> 13 #include <ws2spi.h> 14 #include <nspapi.h> 15 #include <svc.h> 16 17 typedef DWORD (* LPFN_NSPAPI)(VOID); 18 typedef struct _NS_ROUTINE { 19 DWORD dwFunctionCount; 20 LPFN_NSPAPI *alpfnFunctions; 21 DWORD dwNameSpace; 22 DWORD dwPriority; 23 } NS_ROUTINE, *PNS_ROUTINE, * FAR LPNS_ROUTINE; 24 25 26 /* 27 * @unimplemented 28 */ 29 INT 30 WINAPI 31 EnumProtocolsA(LPINT ProtocolCount, 32 LPVOID ProtocolBuffer, 33 LPDWORD BufferLength) 34 { 35 OutputDebugStringW(L"w32sock EnumProtocolsA stub called\n"); 36 37 return SOCKET_ERROR; 38 } 39 40 41 /* 42 * @unimplemented 43 */ 44 INT 45 WINAPI 46 EnumProtocolsW(LPINT ProtocolCount, 47 LPVOID ProtocolBuffer, 48 LPDWORD BufferLength) 49 { 50 OutputDebugStringW(L"w32sock EnumProtocolsW stub called\n"); 51 52 return SOCKET_ERROR; 53 } 54 55 56 /* 57 * @unimplemented 58 */ 59 INT 60 WINAPI 61 GetAddressByNameA(DWORD NameSpace, 62 LPGUID ServiceType, 63 LPSTR ServiceName, 64 LPINT Protocols, 65 DWORD Resolution, 66 LPSERVICE_ASYNC_INFO ServiceAsyncInfo, 67 LPVOID CsaddrBuffer, 68 LPDWORD BufferLength, 69 LPSTR AliasBuffer, 70 LPDWORD AliasBufferLength) 71 { 72 OutputDebugStringW(L"w32sock GetAddressByNameA stub called\n"); 73 74 return SOCKET_ERROR; 75 } 76 77 78 /* 79 * @unimplemented 80 */ 81 INT 82 WINAPI 83 GetAddressByNameW(DWORD NameSpace, 84 LPGUID ServiceType, 85 LPWSTR ServiceName, 86 LPINT Protocols, 87 DWORD Resolution, 88 LPSERVICE_ASYNC_INFO ServiceAsyncInfo, 89 LPVOID CsaddrBuffer, 90 LPDWORD BufferLength, 91 LPWSTR AliasBuffer, 92 LPDWORD AliasBufferLength) 93 { 94 OutputDebugStringW(L"w32sock GetAddressByNameW stub called\n"); 95 96 return SOCKET_ERROR; 97 } 98 99 100 /* 101 * @unimplemented 102 */ 103 INT 104 WINAPI 105 GetServiceA(DWORD NameSpace, 106 LPGUID Guid, 107 LPSTR ServiceName, 108 DWORD Properties, 109 LPVOID Buffer, 110 LPDWORD BufferSize, 111 LPSERVICE_ASYNC_INFO ServiceAsyncInfo) 112 { 113 OutputDebugStringW(L"w32sock GetServiceA stub called\n"); 114 115 return SOCKET_ERROR; 116 } 117 118 119 /* 120 * @unimplemented 121 */ 122 INT 123 WINAPI 124 GetServiceW(DWORD NameSpace, 125 LPGUID Guid, 126 LPWSTR ServiceName, 127 DWORD Properties, 128 LPVOID Buffer, 129 LPDWORD BufferSize, 130 LPSERVICE_ASYNC_INFO ServiceAsyncInfo) 131 { 132 OutputDebugStringW(L"w32sock GetServiceW stub called\n"); 133 134 return SOCKET_ERROR; 135 } 136 137 138 /* 139 * @unimplemented 140 */ 141 INT 142 WINAPI 143 GetTypeByNameA(LPSTR ServiceName, 144 LPGUID ServiceType) 145 { 146 OutputDebugStringW(L"w32sock GetTypeByNameA stub called\n"); 147 148 return SOCKET_ERROR; 149 } 150 151 152 /* 153 * @unimplemented 154 */ 155 INT 156 WINAPI 157 GetTypeByNameW(LPWSTR ServiceName, 158 LPGUID ServiceType) 159 { 160 OutputDebugStringW(L"w32sock GetTypeByNameW stub called\n"); 161 162 return SOCKET_ERROR; 163 } 164 165 166 /* 167 * @unimplemented 168 */ 169 INT 170 WINAPI 171 MigrateWinsockConfiguration(DWORD Unknown1, 172 DWORD Unknown2, 173 DWORD Unknown3) 174 { 175 OutputDebugStringW(L"w32sock MigrateWinsockConfiguration stub called\n"); 176 177 return SOCKET_ERROR; 178 } 179 180 181 /* 182 * @unimplemented 183 */ 184 INT 185 WINAPI 186 SetServiceA(DWORD NameSpace, 187 DWORD Operation, 188 DWORD Flags, 189 LPSERVICE_INFOA ServiceInfo, 190 LPSERVICE_ASYNC_INFO ServiceAsyncInfo, 191 LPDWORD dwStatusFlags) 192 { 193 OutputDebugStringW(L"w32sock SetServiceA stub called\n"); 194 195 return SOCKET_ERROR; 196 } 197 198 199 /* 200 * @unimplemented 201 */ 202 INT 203 WINAPI 204 SetServiceW(DWORD NameSpace, 205 DWORD Operation, 206 DWORD Flags, 207 LPSERVICE_INFOW ServiceInfo, 208 LPSERVICE_ASYNC_INFO ServiceAsyncInfo, 209 LPDWORD dwStatusFlags) 210 { 211 OutputDebugStringW(L"w32sock SetServiceW stub called\n"); 212 213 return SOCKET_ERROR; 214 } 215 216 217 /* 218 * @unimplemented 219 */ 220 int 221 WINAPI 222 WSARecvEx(SOCKET Sock, 223 char *Buf, 224 int Len, 225 int *Flags) 226 { 227 OutputDebugStringW(L"w32sock WSARecvEx stub called\n"); 228 229 return SOCKET_ERROR; 230 } 231 232 233 /* 234 * @unimplemented 235 */ 236 int 237 WINAPI 238 dn_expand(unsigned char *MessagePtr, 239 unsigned char *EndofMesOrig, 240 unsigned char *CompDomNam, 241 unsigned char *ExpandDomNam, 242 int Length) 243 { 244 OutputDebugStringW(L"w32sock dn_expand stub called\n"); 245 246 return SOCKET_ERROR; 247 } 248 249 250 /* 251 * @unimplemented 252 */ 253 struct netent * 254 WINAPI 255 getnetbyname(const char *name) 256 { 257 OutputDebugStringW(L"w32sock getnetbyname stub called\n"); 258 259 return NULL; 260 } 261 262 263 /* 264 * @unimplemented 265 */ 266 UINT 267 WINAPI 268 inet_network(const char *cp) 269 { 270 OutputDebugStringW(L"w32sock inet_network stub called\n"); 271 272 return INADDR_NONE; 273 } 274 275 276 /* 277 * @unimplemented 278 */ 279 SOCKET 280 WINAPI 281 rcmd(char **AHost, 282 USHORT InPort, 283 char *LocUser, 284 char *RemUser, 285 char *Cmd, 286 int *Fd2p) 287 { 288 OutputDebugStringW(L"w32sock rcmd stub called\n"); 289 290 return INVALID_SOCKET; 291 } 292 293 294 /* 295 * @unimplemented 296 */ 297 SOCKET 298 WINAPI 299 rexec(char **AHost, 300 int InPort, 301 char *User, 302 char *Passwd, 303 char *Cmd, 304 int *Fd2p) 305 { 306 OutputDebugStringW(L"w32sock rexec stub called\n"); 307 308 return INVALID_SOCKET; 309 } 310 311 312 /* 313 * @unimplemented 314 */ 315 SOCKET 316 WINAPI 317 rresvport(int *port) 318 { 319 OutputDebugStringW(L"w32sock rresvport stub called\n"); 320 321 return INVALID_SOCKET; 322 } 323 324 325 /* 326 * @unimplemented 327 */ 328 void 329 WINAPI 330 s_perror(const char *str) 331 { 332 OutputDebugStringW(L"w32sock s_perror stub called\n"); 333 } 334 335 336 /* 337 * @unimplemented 338 */ 339 int 340 WINAPI 341 sethostname(char *Name, int NameLen) 342 { 343 OutputDebugStringW(L"w32sock sethostname stub called\n"); 344 345 return SOCKET_ERROR; 346 } 347 348 349 /* 350 * @unimplemented 351 */ 352 BOOL 353 WINAPI 354 DllMain(HINSTANCE InstDLL, 355 DWORD Reason, 356 LPVOID Reserved) 357 { 358 return TRUE; 359 } 360 361 362 /* 363 * @unimplemented 364 */ 365 INT 366 WINAPI 367 GetNameByTypeA(LPGUID lpServiceType,LPSTR lpServiceName,DWORD dwNameLength) 368 { 369 OutputDebugStringW(L"w32sock GetNameByTypeA stub called\n"); 370 return TRUE; 371 } 372 373 374 /* 375 * @unimplemented 376 */ 377 INT 378 WINAPI 379 GetNameByTypeW(LPGUID lpServiceType,LPWSTR lpServiceName,DWORD dwNameLength) 380 { 381 OutputDebugStringW(L"w32sock GetNameByTypeW stub called\n"); 382 return TRUE; 383 } 384 385 /* 386 * @unimplemented 387 */ 388 int 389 WINAPI 390 WSPStartup( 391 IN WORD wVersionRequested, 392 OUT LPWSPDATA lpWSPData, 393 IN LPWSAPROTOCOL_INFOW lpProtocolInfo, 394 IN WSPUPCALLTABLE UpcallTable, 395 OUT LPWSPPROC_TABLE lpProcTable 396 ) 397 { 398 return TRUE; 399 } 400 401 402 /* 403 * @unimplemented 404 */ 405 INT 406 WINAPI 407 NPLoadNameSpaces( 408 IN OUT LPDWORD lpdwVersion, 409 IN OUT LPNS_ROUTINE nsrBuffer, 410 IN OUT LPDWORD lpdwBufferLength 411 ) 412 { 413 OutputDebugStringW(L"mswsock NPLoadNameSpaces stub called\n"); 414 415 *lpdwVersion = 1; 416 417 return TRUE; 418 } 419 420 421 /* 422 * @unimplemented 423 */ 424 VOID 425 WINAPI 426 StartWsdpService() 427 { 428 OutputDebugStringW(L"mswsock StartWsdpService stub called\n"); 429 } 430 431 432 /* 433 * @unimplemented 434 */ 435 VOID 436 WINAPI 437 StopWsdpService() 438 { 439 OutputDebugStringW(L"mswsock StopWsdpService stub called\n"); 440 } 441 442 443 /* 444 * @unimplemented 445 * 446 * See https://www.geoffchappell.com/studies/windows/win32/services/svchost/dll/svchostpushserviceglobals.htm 447 */ 448 VOID 449 WINAPI 450 SvchostPushServiceGlobals(SVCHOST_GLOBALS *lpGlobals) 451 { 452 OutputDebugStringW(L"mswsock SvchostPushServiceGlobals stub called\n"); 453 } 454 455 456 /* 457 * @unimplemented 458 */ 459 VOID 460 WINAPI 461 ServiceMain(DWORD Unknown1, DWORD Unknown2) 462 { 463 OutputDebugStringW(L"mswsock ServiceMain stub called\n"); 464 } 465