1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS WinSock 2.2 Library
4 * FILE: dll/win32/ws2_32/inc/ws2_32p.h
5 * PURPOSE: WinSock 2.2 Main Header
6 */
7
8 #pragma once
9
10 #define WINSOCK_ROOT "System\\CurrentControlSet\\Services\\WinSock2\\Parameters"
11 #define MAXALIASES 35
12
13 typedef enum _WSASYNCOPS
14 {
15 WsAsyncGetHostByAddr,
16 WsAsyncGetHostByName,
17 WsAsyncGetProtoByName,
18 WsAsyncGetProtoByNumber,
19 WsAsyncGetServByName,
20 WsAsyncGetServByPort,
21 WsAsyncTerminate,
22 } WSASYNCOPS;
23
24 typedef struct _WSASYNCBLOCK
25 {
26 LIST_ENTRY AsyncQueue;
27 HANDLE TaskHandle;
28 WSASYNCOPS Operation;
29 union
30 {
31 struct
32 {
33 HWND hWnd;
34 UINT wMsg;
35 PCHAR ByWhat;
36 DWORD Length;
37 DWORD Type;
38 PVOID Buffer;
39 DWORD BufferLength;
40 } GetHost;
41 struct
42 {
43 HWND hWnd;
44 UINT wMsg;
45 PCHAR ByWhat;
46 DWORD Length;
47 PVOID Buffer;
48 DWORD BufferLength;
49 } GetProto;
50 struct
51 {
52 HWND hWnd;
53 UINT wMsg;
54 PCHAR ByWhat;
55 DWORD Length;
56 PCHAR Protocol;
57 PVOID Buffer;
58 DWORD BufferLength;
59 } GetServ;
60 };
61 } WSASYNCBLOCK, *PWSASYNCBLOCK;
62
63 typedef struct _WSASYNCCONTEXT
64 {
65 LIST_ENTRY AsyncQueue;
66 HANDLE AsyncEvent;
67 LIST_ENTRY SocketList;
68 } WSASYNCCONTEXT, *PWSASYNCCONTEXT;
69
70 typedef struct _WSPROTO_BUFFER
71 {
72 PROTOENT Protoent;
73 PCHAR Aliases[MAXALIASES];
74 CHAR LineBuffer[512];
75 } WSPROTO_BUFFER, *PWSPROTO_BUFFER;
76
77 typedef struct _TPROVIDER
78 {
79 LONG RefCount;
80 WSPPROC_TABLE Service;
81 HINSTANCE DllHandle;
82 WSPUPCALLTABLE UpcallTable;
83 } TPROVIDER, *PTPROVIDER;
84
85 typedef struct _TCATALOG_ENTRY
86 {
87 LIST_ENTRY CatalogLink;
88 LONG RefCount;
89 PTPROVIDER Provider;
90 CHAR DllPath[MAX_PATH];
91 WSAPROTOCOL_INFOW ProtocolInfo;
92 } TCATALOG_ENTRY, *PTCATALOG_ENTRY;
93
94 typedef struct _TCATALOG
95 {
96 LIST_ENTRY ProtocolList;
97 DWORD ItemCount;
98 DWORD UniqueId;
99 DWORD NextId;
100 HKEY CatalogKey;
101 CRITICAL_SECTION Lock;
102 BOOLEAN Initialized;
103 } TCATALOG, *PTCATALOG;
104
105 typedef struct _NSPROVIDER
106 {
107 LONG RefCount;
108 DWORD NamespaceId;
109 HINSTANCE DllHandle;
110 GUID ProviderId;
111 NSP_ROUTINE Service;
112 } NSPROVIDER, *PNS_PROVIDER;
113
114 typedef struct _NSQUERY_PROVIDER
115 {
116 LIST_ENTRY QueryLink;
117 PNS_PROVIDER Provider;
118 HANDLE LookupHandle;
119 } NSQUERY_PROVIDER, *PNSQUERY_PROVIDER;
120
121 typedef struct _NSCATALOG_ENTRY
122 {
123 LIST_ENTRY CatalogLink;
124 LONG RefCount;
125 PNS_PROVIDER Provider;
126 LONG AddressFamily;
127 DWORD NamespaceId;
128 DWORD Version;
129 LPWSTR ProviderName;
130 BOOLEAN Enabled;
131 BOOLEAN StoresServiceClassInfo;
132 GUID ProviderId;
133 WCHAR DllPath[MAX_PATH];
134 } NSCATALOG_ENTRY, *PNSCATALOG_ENTRY;
135
136 typedef struct _NSCATALOG
137 {
138 LIST_ENTRY CatalogList;
139 DWORD ItemCount;
140 DWORD UniqueId;
141 HKEY CatalogKey;
142 CRITICAL_SECTION Lock;
143 } NSCATALOG, *PNSCATALOG;
144
145 typedef struct _NSQUERY
146 {
147 DWORD Signature;
148 LONG RefCount;
149 BOOLEAN ShuttingDown;
150 LIST_ENTRY ProviderList;
151 PNSQUERY_PROVIDER ActiveProvider;
152 CRITICAL_SECTION Lock;
153 PNSQUERY_PROVIDER CurrentProvider;
154 LPWSAQUERYSETW QuerySet;
155 DWORD ControlFlags;
156 PNSCATALOG Catalog;
157 DWORD TryAgain;
158 } NSQUERY, *PNSQUERY;
159
160 typedef struct _WSPROCESS
161 {
162 LONG RefCount;
163 HANDLE ApcHelper;
164 HANDLE HandleHelper;
165 HANDLE NotificationHelper;
166 PTCATALOG ProtocolCatalog;
167 PNSCATALOG NamespaceCatalog;
168 HANDLE ProtocolCatalogEvent;
169 HANDLE NamespaceCatalogEvent;
170 DWORD Version;
171 BOOLEAN LockReady;
172 CRITICAL_SECTION ThreadLock;
173 } WSPROCESS, *PWSPROCESS;
174
175 typedef struct _WSTHREAD
176 {
177 PWSPROCESS Process;
178 WSATHREADID WahThreadId;
179 HANDLE AsyncHelper;
180 LPWSPCANCELBLOCKINGCALL CancelBlockingCall;
181 LPBLOCKINGCALLBACK BlockingCallback;
182 FARPROC BlockingHook;
183 BOOLEAN Blocking;
184 BOOLEAN Cancelled;
185 CHAR Buffer[32];
186 PCHAR Hostent;
187 PCHAR Servent;
188 DWORD HostentSize;
189 DWORD ServentSize;
190 DWORD OpenType;
191 PVOID ProtocolInfo;
192 } WSTHREAD, *PWSTHREAD;
193
194 typedef struct _WSSOCKET
195 {
196 LONG RefCount;
197 HANDLE Handle;
198 PWSPROCESS Process;
199 PTPROVIDER Provider;
200 PTCATALOG_ENTRY CatalogEntry;
201 BOOLEAN Overlapped;
202 BOOLEAN ApiSocket;
203 BOOLEAN IsProvider;
204 } WSSOCKET, *PWSSOCKET;
205
206 typedef struct _ENUM_CONTEXT
207 {
208 LPWSAQUERYSETW lpqsRestrictions;
209 INT ErrorCode;
210 PNSQUERY NsQuery;
211 PNSCATALOG Catalog;
212 } ENUM_CONTEXT, *PENUM_CONTEXT;
213
214 typedef struct _NSPROVIDER_ENUM_CONTEXT
215 {
216 LPINT Protocols;
217 LPVOID ProtocolBuffer;
218 DWORD BufferLength;
219 DWORD BufferUsed;
220 DWORD Count;
221 BOOLEAN Unicode;
222 INT ErrorCode;
223 } NSPROVIDER_ENUM_CONTEXT, *PNSPROVIDER_ENUM_CONTEXT;
224
225 typedef struct _PROTOCOL_ENUM_CONTEXT
226 {
227 LPINT Protocols;
228 LPWSAPROTOCOL_INFOW ProtocolBuffer;
229 DWORD BufferLength;
230 DWORD BufferUsed;
231 DWORD Count;
232 INT ErrorCode;
233 } PROTOCOL_ENUM_CONTEXT, *PPROTOCOL_ENUM_CONTEXT;
234
235 typedef struct _PROVIDER_ENUM_CONTEXT
236 {
237 GUID ProviderId;
238 LPWSTR ProviderDllPath;
239 INT ProviderDllPathLen;
240 DWORD FoundPathLen;
241 DWORD Found;
242 INT ErrorCode;
243 } PROVIDER_ENUM_CONTEXT, *PPROVIDER_ENUM_CONTEXT;
244
245 typedef struct _WS_BUFFER
246 {
247 ULONG_PTR Position;
248 SIZE_T MaxSize;
249 SIZE_T BytesUsed;
250 } WS_BUFFER, *PWS_BUFFER;
251
252 typedef BOOL
253 (WINAPI *PNSCATALOG_ENUMERATE_PROC)(
254 IN PVOID Context,
255 IN PNSCATALOG_ENTRY Entry
256 );
257
258 typedef BOOL
259 (WINAPI *PTCATALOG_ENUMERATE_PROC)(
260 IN PVOID Context,
261 IN PTCATALOG_ENTRY Entry
262 );
263
264 typedef BOOL
265 (WINAPI *PWS_SOCK_POST_ROUTINE)(
266 IN HWND hWnd,
267 IN UINT wMsg,
268 IN WPARAM wParam,
269 IN LPARAM lParam
270 );
271
272 extern HINSTANCE WsDllHandle;
273 extern HANDLE WsSockHeap;
274 extern PWAH_HANDLE_TABLE WsSockHandleTable;
275 extern PWSPROCESS CurrentWsProcess;
276 extern DWORD GlobalTlsIndex;
277 #define TlsIndex GlobalTlsIndex
278 extern BOOLEAN WsAsyncThreadInitialized;
279 extern PWS_SOCK_POST_ROUTINE WsSockPostRoutine;
280
281 LPSTR
282 WSAAPI
283 AnsiDupFromUnicode(IN LPCWSTR UnicodeString);
284
285 LPWSTR
286 WSAAPI
287 UnicodeDupFromAnsi(IN LPCSTR AnsiString);
288
289 VOID
290 WSAAPI
291 WsRasInitializeAutodial(VOID);
292
293 VOID
294 WSAAPI
295 WsRasUninitializeAutodial(VOID);
296
297 BOOL
298 WSAAPI
299 WSAttemptAutodialName(IN CONST LPWSAQUERYSETW lpqsRestrictions);
300
301 BOOL
302 WSAAPI
303 WSAttemptAutodialAddr(
304 IN CONST SOCKADDR FAR *Name,
305 IN INT NameLength
306 );
307
308 VOID
309 WSAAPI
310 WSNoteSuccessfulHostentLookup(
311 IN CONST CHAR FAR *Name,
312 IN CONST ULONG Address
313 );
314
315 INT
316 WSAAPI
317 MapUnicodeProtocolInfoToAnsi(IN LPWSAPROTOCOL_INFOW UnicodeInfo,
318 OUT LPWSAPROTOCOL_INFOA AnsiInfo);
319
320 INT
321 WSAAPI
322 MapAnsiQuerySetToUnicode(IN LPWSAQUERYSETA AnsiSet,
323 IN OUT PSIZE_T SetSize,
324 OUT LPWSAQUERYSETW UnicodeSet);
325
326 INT
327 WSAAPI
328 MapUnicodeQuerySetToAnsi(IN LPWSAQUERYSETW UnicodeSet,
329 IN OUT PSIZE_T SetSize,
330 OUT LPWSAQUERYSETA AnsiSet);
331
332 INT
333 WSAAPI
334 CopyQuerySetW(IN LPWSAQUERYSETW UnicodeSet,
335 OUT LPWSAQUERYSETW *UnicodeCopy);
336
337 INT
338 WSAAPI
339 WsSlowProlog(VOID);
340
341 INT
342 WSAAPI
343 WsSlowPrologTid(OUT LPWSATHREADID *ThreadId);
344
345 PWSSOCKET
346 WSAAPI
347 WsSockGetSocket(IN SOCKET Handle);
348
349 INT
350 WSAAPI
351 WsApiProlog(OUT PWSPROCESS *Process,
352 OUT PWSTHREAD *Thread);
353
354 HKEY
355 WSAAPI
356 WsOpenRegistryRoot(VOID);
357
358 VOID
359 WSAAPI
360 WsCreateStartupSynchronization(VOID);
361
362 VOID
363 WSAAPI
364 WsDestroyStartupSynchronization(VOID);
365
366 INT
367 WSAAPI
368 WsSetupCatalogProtection(IN HKEY CatalogKey,
369 IN HANDLE CatalogEvent,
370 OUT LPDWORD UniqueId);
371
372 BOOL
373 WSAAPI
374 WsCheckCatalogState(IN HANDLE Event);
375
376 PNSCATALOG
377 WSAAPI
378 WsNcAllocate(VOID);
379
380 VOID
381 WSAAPI
382 WsNcDelete(IN PNSCATALOG Catalog);
383
384 INT
385 WSAAPI
386 WsNcInitializeFromRegistry(IN PNSCATALOG Catalog,
387 IN HKEY ParentKey,
388 IN HANDLE CatalogEvent);
389
390 INT
391 WSAAPI
392 WsNcRefreshFromRegistry(IN PNSCATALOG Catalog,
393 IN HANDLE CatalogEvent);
394
395 VOID
396 WSAAPI
397 WsNcUpdateNamespaceList(IN PNSCATALOG Catalog,
398 IN PLIST_ENTRY List);
399
400 BOOL
401 WSAAPI
402 WsNcMatchProtocols(IN DWORD NameSpace,
403 IN LONG AddressFamily,
404 IN LPWSAQUERYSETW QuerySet);
405
406 INT
407 WSAAPI
408 WsNcLoadProvider(IN PNSCATALOG Catalog,
409 IN PNSCATALOG_ENTRY CatalogEntry);
410
411 INT
412 WSAAPI
413 WsNcGetCatalogFromProviderId(IN PNSCATALOG Catalog,
414 IN LPGUID ProviderId,
415 OUT PNSCATALOG_ENTRY *CatalogEntry);
416
417 VOID
418 WSAAPI
419 WsNcEnumerateCatalogItems(IN PNSCATALOG Catalog,
420 IN PNSCATALOG_ENUMERATE_PROC Callback,
421 IN PVOID Context);
422
423 INT
424 WSAAPI
425 WsNcGetServiceClassInfo(IN PNSCATALOG Catalog,
426 IN OUT LPDWORD BugSize,
427 IN OUT LPWSASERVICECLASSINFOW lpServiceClassInfo);
428
429 PNSCATALOG_ENTRY
430 WSAAPI
431 WsNcEntryAllocate(VOID);
432
433 INT
434 WSAAPI
435 WsNcEntryInitializeFromRegistry(IN PNSCATALOG_ENTRY CatalogEntry,
436 IN HKEY ParentKey,
437 IN ULONG UniqueId);
438
439 VOID
440 WSAAPI
441 WsNcEntryDereference(IN PNSCATALOG_ENTRY CatalogEntry);
442
443 VOID
444 WSAAPI
445 WsNcEntrySetProvider(IN PNSCATALOG_ENTRY Entry,
446 IN PNS_PROVIDER Provider);
447
448 BOOL
449 WSAAPI
450 WsNqAddProvider(
451 IN PNSQUERY NsQuery,
452 IN PNS_PROVIDER Provider
453 );
454
455 PNSQUERY
456 WSAAPI
457 WsNqAllocate(VOID);
458
459 BOOL
460 WSAAPI
461 WsNqBeginEnumerationProc(
462 PVOID Context,
463 PNSCATALOG_ENTRY CatalogEntry
464 );
465
466 VOID
467 WSAAPI
468 WsNqDelete(IN PNSQUERY NsQuery);
469
470 DWORD
471 WSAAPI
472 WsNqInitialize(IN PNSQUERY NsQuery);
473
474 DWORD
475 WSAAPI
476 WsNqLookupServiceBegin(
477 IN PNSQUERY NsQuery,
478 IN LPWSAQUERYSETW QuerySet,
479 IN DWORD ControlFlags,
480 IN PNSCATALOG Catalog
481 );
482
483 DWORD
484 WSAAPI
485 WsNqLookupServiceEnd(IN PNSQUERY NsQuery);
486
487 DWORD
488 WSAAPI
489 WsNqLookupServiceNext(
490 PNSQUERY NsQuery,
491 DWORD,
492 PDWORD,
493 OUT LPWSAQUERYSETW QuerySet
494 );
495
496 PNSQUERY_PROVIDER
497 WSAAPI
498 WsNqNextProvider(
499 PNSQUERY NsQuery,
500 IN PNSQUERY_PROVIDER Provider
501 );
502
503 PNSQUERY_PROVIDER
504 WSAAPI
505 WsNqPreviousProvider(
506 IN PNSQUERY Query,
507 IN PNSQUERY_PROVIDER Provider
508 );
509
510 VOID
511 WSAAPI
512 WsNqDereference(IN PNSQUERY Query);
513
514 BOOL
515 WSAAPI
516 WsNqValidateAndReference(IN PNSQUERY Query);
517
518 DWORD
519 WSAAPI
520 WsNqProvLookupServiceNext(
521 IN PNSQUERY_PROVIDER QueryProvider,
522 DWORD,
523 PDWORD ,
524 LPWSAQUERYSETW QuerySet
525 );
526
527 DWORD
528 WSAAPI
529 WsNqProvLookupServiceEnd(IN PNSQUERY_PROVIDER QueryProvider);
530
531 DWORD
532 WSAAPI
533 WsNqProvInitialize(
534 IN PNSQUERY_PROVIDER QueryProvider,
535 IN PNS_PROVIDER Provider
536 );
537
538 PNSQUERY_PROVIDER
539 WSAAPI
540 WsNqProvAllocate(VOID);
541
542 VOID
543 WSAAPI
544 WsNqProvDelete(IN PNSQUERY_PROVIDER QueryProvider);
545
546 DWORD
547 WSAAPI
548 WsNqProvLookupServiceBegin(
549 IN PNSQUERY_PROVIDER QueryProvider,
550 IN LPWSAQUERYSETW QuerySet,
551 IN LPWSASERVICECLASSINFOW ServiceClassInfo,
552 IN DWORD
553 );
554
555 VOID
556 WSAAPI
557 WsNpDelete(IN PNS_PROVIDER Provider);
558
559 DWORD
560 WSAAPI
561 WsNpLookupServiceBegin (
562 IN PNS_PROVIDER Provider,
563 IN LPWSAQUERYSETW Restrictions,
564 struct _WSAServiceClassInfoW *,
565 IN DWORD ControlFlags,
566 OUT PHANDLE LookupHandle
567 );
568
569 DWORD
570 WSAAPI
571 WsNpNSPCleanup(IN PNS_PROVIDER Provider);
572
573 DWORD
574 WSAAPI
575 WsNpLookupServiceEnd(
576 IN PNS_PROVIDER Provider,
577 IN HANDLE LookupHandle
578 );
579
580 DWORD
581 WSAAPI
582 WsNpInitialize(
583 IN PNS_PROVIDER Provider,
584 IN LPWSTR DllPath,
585 IN LPGUID ProviderGuid
586 );
587
588 PNS_PROVIDER
589 WSAAPI
590 WsNpAllocate(VOID);
591
592 VOID
593 WSAAPI
594 WsNpDereference(IN PNS_PROVIDER Provider);
595
596 DWORD
597 WSAAPI
598 WsNpLookupServiceNext(
599 IN PNS_PROVIDER Provider,
600 IN HANDLE LookupHandle,
601 IN DWORD ControlFlags,
602 OUT PDWORD BufferLength,
603 OUT LPWSAQUERYSETW Results
604 );
605
606 VOID
607 WSAAPI
608 WsTpDelete(IN PTPROVIDER Provider);
609
610 DWORD
611 WSAAPI
612 WsTpWSPCleanup(
613 IN PTPROVIDER Provider,
614 int *
615 );
616
617 PTPROVIDER
618 WSAAPI
619 WsTpAllocate(VOID);
620
621 DWORD
622 WSAAPI
623 WsTpInitialize(
624 IN PTPROVIDER Provider,
625 IN LPSTR DllName,
626 LPWSAPROTOCOL_INFOW ProtocolInfo
627 );
628
629 VOID
630 WSAAPI
631 WsTpDereference(IN PTPROVIDER Provider);
632
633 VOID
634 WSAAPI
635 WsThreadDelete(IN PWSTHREAD Thread);
636
637 VOID
638 WSAAPI
639 WsThreadDestroyCurrentThread(VOID);
640
641 DWORD
642 WSAAPI
643 WsThreadCreate(
644 IN PWSPROCESS Process,
645 IN PWSTHREAD *Thread
646 );
647
648 DWORD
649 WSAAPI
650 WsThreadGetCurrentThread(
651 IN PWSPROCESS Process,
652 IN PWSTHREAD *Thread
653 );
654
655 LPWSATHREADID
656 WSAAPI
657 WsThreadGetThreadId(IN PWSPROCESS Process);
658
659 DWORD
660 WSAAPI
661 WsThreadStartup(VOID);
662
663 VOID
664 WSAAPI
665 WsThreadCleanup(VOID);
666
667 DWORD
668 WSAAPI
669 WsThreadCancelBlockingCall(IN PWSTHREAD Thread);
670
671 DWORD
672 WSAAPI
673 WsThreadUnhookBlockingHook(IN PWSTHREAD Thread);
674
675 FARPROC
676 WSAAPI
677 WsThreadSetBlockingHook(IN PWSTHREAD Thread,
678 IN FARPROC BlockingHook);
679
680
681 PHOSTENT
682 WSAAPI
683 WsThreadBlobToHostent(IN PWSTHREAD Thread,
684 IN LPBLOB Blob);
685
686 PSERVENT
687 WSAAPI
688 WsThreadBlobToServent(IN PWSTHREAD Thread,
689 IN LPBLOB Blob);
690
691 PWSPROTO_BUFFER
692 WSAAPI
693 WsThreadGetProtoBuffer(IN PWSTHREAD Thread);
694
695 PWSTHREAD
696 WSAAPI
697 WsThreadAllocate(VOID);
698
699 DWORD
700 WSAAPI
701 WsThreadDefaultBlockingHook(VOID);
702
703 DWORD
704 WSAAPI
705 WsThreadInitialize(
706 IN PWSTHREAD Thread,
707 IN PWSPROCESS Process
708 );
709
710 DWORD
711 WSAAPI
712 WsTcFindIfsProviderForSocket(IN PTCATALOG TCatalog, SOCKET Socket);
713
714 DWORD
715 WSAAPI
716 WsTcEntryInitializeFromRegistry(IN PTCATALOG_ENTRY CatalogEntry, IN HKEY, unsigned long);
717
718 DWORD
719 WSAAPI
720 WsTcGetEntryFromAf(IN PTCATALOG TCatalog, IN INT AddressFamily, IN PTCATALOG_ENTRY *CatalogEntry);
721
722 PTCATALOG_ENTRY
723 WSAAPI
724 WsTcEntryAllocate(VOID);
725
726 VOID
727 WSAAPI
728 WsTcEntrySetProvider(IN PTCATALOG_ENTRY CatalogEntry, IN PTPROVIDER Provider);
729
730 DWORD
731 WSAAPI
732 WsTcRefreshFromRegistry(IN PTCATALOG TCatalog, PVOID);
733
734 BOOL
735 WSAAPI
736 WsTcOpen(IN PTCATALOG TCatalog, IN HKEY);
737
738 PTPROVIDER
739 WSAAPI
740 WsTcFindProvider(IN PTCATALOG TCatalog, IN LPGUID ProviderId);
741
742 VOID
743 WSAAPI
744 WsTcEnumerateCatalogItems(IN PTCATALOG Catalog,
745 IN PTCATALOG_ENUMERATE_PROC Callback,
746 IN PVOID Context);
747
748 VOID
749 WSAAPI
750 WsTcEntryDereference(IN PTCATALOG_ENTRY CatalogEntry);
751
752 PTCATALOG
753 WSAAPI
754 WsTcAllocate(VOID);
755
756 VOID
757 WSAAPI
758 WsTcDelete(IN PTCATALOG Catalog);
759
760 DWORD
761 WSAAPI
762 WsTcGetEntryFromTriplet(IN PTCATALOG TCatalog, IN INT AddressFamily, IN INT SocketType, IN INT Protocol, IN DWORD StartId, IN PTCATALOG_ENTRY *CatalogEntry);
763
764 VOID
765 WSAAPI
766 WsTcUpdateProtocolList(IN PTCATALOG TCatalog, PLIST_ENTRY ProtocolList);
767
768 VOID
769 WSAAPI
770 WsTcEntryDelete(IN PTCATALOG_ENTRY CatalogEntry);
771
772 DWORD
773 WSAAPI
774 WsTcGetEntryFromCatalogEntryId(IN PTCATALOG TCatalog, IN DWORD CatalogEntryId, IN PTCATALOG_ENTRY *CatalogEntry);
775
776 DWORD
777 WSAAPI
778 WsTcLoadProvider(IN PTCATALOG TCatalog, IN PTCATALOG_ENTRY CatalogEntry);
779
780 DWORD
781 WSAAPI
782 WsTcInitializeFromRegistry(IN PTCATALOG TCatalog, HKEY, PVOID);
783
784 INT
785 WSAAPI
786 WsSockStartup(VOID);
787
788 VOID
789 WSAAPI
790 WsSockCleanup(VOID);
791
792 BOOL
793 WSAAPI
794 WsSockDeleteSockets(IN LPVOID Context,
795 IN PWAH_HANDLE Handle);
796
797 VOID
798 WSAAPI
799 WsSockDereference(IN PWSSOCKET Socket);
800
801 PWSSOCKET
802 WSAAPI
803 WsSockAllocate(VOID);
804
805 INT
806 WSAAPI
807 WsSockInitialize(IN PWSSOCKET Socket,
808 IN PTCATALOG_ENTRY CatalogEntry);
809
810 INT
811 WSAAPI
812 WsSockAssociateHandle(IN PWSSOCKET Socket,
813 IN SOCKET Handle,
814 IN BOOLEAN IsProvider);
815
816 INT
817 WSAAPI
818 WsSockDisassociateHandle(IN PWSSOCKET Socket);
819
820 INT
821 WSAAPI
822 WsSockAddApiReference(IN SOCKET Handle);
823
824 PTCATALOG
825 WSAAPI
826 WsProcGetTCatalog(IN PWSPROCESS Process);
827
828 BOOL
829 WSAAPI
830 WsProcDetachSocket(IN PWSPROCESS Process,
831 IN PWAH_HANDLE Handle);
832
833 INT
834 WSAAPI
835 WsProcGetAsyncHelper(IN PWSPROCESS Process,
836 OUT PHANDLE Handle);
837
838 VOID
839 WSAAPI
840 WsProcDelete(IN PWSPROCESS Process);
841
842 INT
843 WSAAPI
844 WsProcStartup(VOID);
845
846 PNSCATALOG
847 WSAAPI
848 WsProcGetNsCatalog(IN PWSPROCESS Process);
849
850 VOID
851 WSAAPI
852 WsProcSetVersion(IN PWSPROCESS Process,
853 IN WORD VersionRequested);
854
855 VOID
856 WSAAPI
857 WsAsyncQueueRequest(IN PWSASYNCBLOCK AsyncBlock);
858
859 BOOL
860 WSAAPI
861 WsAsyncCheckAndInitThread(VOID);
862
863 INT
864 WSAAPI
865 WsAsyncCancelRequest(IN HANDLE TaskHandle);
866
867 PWSASYNCBLOCK
868 WSAAPI
869 WsAsyncAllocateBlock(IN SIZE_T ExtraLength);
870
871 VOID
872 WSAAPI
873 WsAsyncTerminateThread(VOID);
874
875 VOID
876 WSAAPI
877 WsAsyncGlobalTerminate(VOID);
878
879 VOID
880 WSAAPI
881 WsAsyncGlobalInitialize(VOID);
882
883 FORCEINLINE
884 PWSPROCESS
WsGetProcess(VOID)885 WsGetProcess(VOID)
886 {
887 return CurrentWsProcess;
888 }
889
890 FORCEINLINE
891 DWORD
WsQuickProlog(VOID)892 WsQuickProlog(VOID)
893 {
894 /* Try to see if we're initialized. If not, do the full prolog */
895 return WsGetProcess() ? ERROR_SUCCESS : WsSlowProlog();
896 }
897
898 FORCEINLINE
899 DWORD
WsQuickPrologTid(LPWSATHREADID * Tid)900 WsQuickPrologTid(LPWSATHREADID *Tid)
901 {
902 /* Try to see if we're initialized. If not, do the full prolog */
903 if ((WsGetProcess()) && (*Tid = WsThreadGetThreadId(WsGetProcess())))
904 {
905 return ERROR_SUCCESS;
906 }
907 else
908 {
909 return WsSlowPrologTid(Tid);
910 }
911 }
912