ReactOS  0.4.14-dev-614-gbfd8a84
ws2_32p.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _WSASYNCBLOCK
 
struct  _WSASYNCCONTEXT
 
struct  _WSPROTO_BUFFER
 
struct  _TPROVIDER
 
struct  _TCATALOG_ENTRY
 
struct  _TCATALOG
 
struct  _NSPROVIDER
 
struct  _NSQUERY_PROVIDER
 
struct  _NSCATALOG_ENTRY
 
struct  _NSCATALOG
 
struct  _NSQUERY
 
struct  _WSPROCESS
 
struct  _WSTHREAD
 
struct  _WSSOCKET
 
struct  _ENUM_CONTEXT
 
struct  _NSPROVIDER_ENUM_CONTEXT
 
struct  _PROTOCOL_ENUM_CONTEXT
 
struct  _PROVIDER_ENUM_CONTEXT
 
struct  _WS_BUFFER
 

Macros

#define WINSOCK_ROOT   "System\\CurrentControlSet\\Services\\WinSock2\\Parameters"
 
#define MAXALIASES   35
 
#define TlsIndex   GlobalTlsIndex
 

Typedefs

typedef enum _WSASYNCOPS WSASYNCOPS
 
typedef struct _WSASYNCBLOCK WSASYNCBLOCK
 
typedef struct _WSASYNCBLOCKPWSASYNCBLOCK
 
typedef struct _WSASYNCCONTEXT WSASYNCCONTEXT
 
typedef struct _WSASYNCCONTEXTPWSASYNCCONTEXT
 
typedef struct _WSPROTO_BUFFER WSPROTO_BUFFER
 
typedef struct _WSPROTO_BUFFERPWSPROTO_BUFFER
 
typedef struct _TPROVIDER TPROVIDER
 
typedef struct _TPROVIDERPTPROVIDER
 
typedef struct _TCATALOG_ENTRY TCATALOG_ENTRY
 
typedef struct _TCATALOG_ENTRYPTCATALOG_ENTRY
 
typedef struct _TCATALOG TCATALOG
 
typedef struct _TCATALOGPTCATALOG
 
typedef struct _NSPROVIDER NSPROVIDER
 
typedef struct _NSPROVIDERPNS_PROVIDER
 
typedef struct _NSQUERY_PROVIDER NSQUERY_PROVIDER
 
typedef struct _NSQUERY_PROVIDERPNSQUERY_PROVIDER
 
typedef struct _NSCATALOG_ENTRY NSCATALOG_ENTRY
 
typedef struct _NSCATALOG_ENTRYPNSCATALOG_ENTRY
 
typedef struct _NSCATALOG NSCATALOG
 
typedef struct _NSCATALOGPNSCATALOG
 
typedef struct _NSQUERY NSQUERY
 
typedef struct _NSQUERYPNSQUERY
 
typedef struct _WSPROCESS WSPROCESS
 
typedef struct _WSPROCESSPWSPROCESS
 
typedef struct _WSTHREAD WSTHREAD
 
typedef struct _WSTHREADPWSTHREAD
 
typedef struct _WSSOCKET WSSOCKET
 
typedef struct _WSSOCKETPWSSOCKET
 
typedef struct _ENUM_CONTEXT ENUM_CONTEXT
 
typedef struct _ENUM_CONTEXTPENUM_CONTEXT
 
typedef struct _NSPROVIDER_ENUM_CONTEXT NSPROVIDER_ENUM_CONTEXT
 
typedef struct _NSPROVIDER_ENUM_CONTEXTPNSPROVIDER_ENUM_CONTEXT
 
typedef struct _PROTOCOL_ENUM_CONTEXT PROTOCOL_ENUM_CONTEXT
 
typedef struct _PROTOCOL_ENUM_CONTEXTPPROTOCOL_ENUM_CONTEXT
 
typedef struct _PROVIDER_ENUM_CONTEXT PROVIDER_ENUM_CONTEXT
 
typedef struct _PROVIDER_ENUM_CONTEXTPPROVIDER_ENUM_CONTEXT
 
typedef struct _WS_BUFFER WS_BUFFER
 
typedef struct _WS_BUFFERPWS_BUFFER
 
typedef BOOL(WINAPIPNSCATALOG_ENUMERATE_PROC) (IN PVOID Context, IN PNSCATALOG_ENTRY Entry)
 
typedef BOOL(WINAPIPTCATALOG_ENUMERATE_PROC) (IN PVOID Context, IN PTCATALOG_ENTRY Entry)
 
typedef BOOL(WINAPIPWS_SOCK_POST_ROUTINE) (IN HWND hWnd, IN UINT wMsg, IN WPARAM wParam, IN LPARAM lParam)
 

Enumerations

enum  _WSASYNCOPS {
  WsAsyncGetHostByAddr, WsAsyncGetHostByName, WsAsyncGetProtoByName, WsAsyncGetProtoByNumber,
  WsAsyncGetServByName, WsAsyncGetServByPort, WsAsyncTerminate
}
 

Functions

LPSTR WSAAPI AnsiDupFromUnicode (IN LPCWSTR UnicodeString)
 
LPWSTR WSAAPI UnicodeDupFromAnsi (IN LPCSTR AnsiString)
 
VOID WSAAPI WsRasInitializeAutodial (VOID)
 
VOID WSAAPI WsRasUninitializeAutodial (VOID)
 
BOOL WSAAPI WSAttemptAutodialName (IN CONST LPWSAQUERYSETW lpqsRestrictions)
 
BOOL WSAAPI WSAttemptAutodialAddr (IN CONST SOCKADDR FAR *Name, IN INT NameLength)
 
VOID WSAAPI WSNoteSuccessfulHostentLookup (IN CONST CHAR FAR *Name, IN CONST ULONG Address)
 
INT WSAAPI MapUnicodeProtocolInfoToAnsi (IN LPWSAPROTOCOL_INFOW UnicodeInfo, OUT LPWSAPROTOCOL_INFOA AnsiInfo)
 
INT WSAAPI MapAnsiQuerySetToUnicode (IN LPWSAQUERYSETA AnsiSet, IN OUT PSIZE_T SetSize, OUT LPWSAQUERYSETW UnicodeSet)
 
INT WSAAPI MapUnicodeQuerySetToAnsi (IN LPWSAQUERYSETW UnicodeSet, IN OUT PSIZE_T SetSize, OUT LPWSAQUERYSETA AnsiSet)
 
INT WSAAPI CopyQuerySetW (IN LPWSAQUERYSETW UnicodeSet, OUT LPWSAQUERYSETW *UnicodeCopy)
 
INT WSAAPI WsSlowProlog (VOID)
 
INT WSAAPI WsSlowPrologTid (OUT LPWSATHREADID *ThreadId)
 
PWSSOCKET WSAAPI WsSockGetSocket (IN SOCKET Handle)
 
INT WSAAPI WsApiProlog (OUT PWSPROCESS *Process, OUT PWSTHREAD *Thread)
 
HKEY WSAAPI WsOpenRegistryRoot (VOID)
 
VOID WSAAPI WsCreateStartupSynchronization (VOID)
 
VOID WSAAPI WsDestroyStartupSynchronization (VOID)
 
INT WSAAPI WsSetupCatalogProtection (IN HKEY CatalogKey, IN HANDLE CatalogEvent, OUT LPDWORD UniqueId)
 
BOOL WSAAPI WsCheckCatalogState (IN HANDLE Event)
 
PNSCATALOG WSAAPI WsNcAllocate (VOID)
 
VOID WSAAPI WsNcDelete (IN PNSCATALOG Catalog)
 
INT WSAAPI WsNcInitializeFromRegistry (IN PNSCATALOG Catalog, IN HKEY ParentKey, IN HANDLE CatalogEvent)
 
INT WSAAPI WsNcRefreshFromRegistry (IN PNSCATALOG Catalog, IN HANDLE CatalogEvent)
 
VOID WSAAPI WsNcUpdateNamespaceList (IN PNSCATALOG Catalog, IN PLIST_ENTRY List)
 
BOOL WSAAPI WsNcMatchProtocols (IN DWORD NameSpace, IN LONG AddressFamily, IN LPWSAQUERYSETW QuerySet)
 
INT WSAAPI WsNcLoadProvider (IN PNSCATALOG Catalog, IN PNSCATALOG_ENTRY CatalogEntry)
 
INT WSAAPI WsNcGetCatalogFromProviderId (IN PNSCATALOG Catalog, IN LPGUID ProviderId, OUT PNSCATALOG_ENTRY *CatalogEntry)
 
VOID WSAAPI WsNcEnumerateCatalogItems (IN PNSCATALOG Catalog, IN PNSCATALOG_ENUMERATE_PROC Callback, IN PVOID Context)
 
INT WSAAPI WsNcGetServiceClassInfo (IN PNSCATALOG Catalog, IN OUT LPDWORD BugSize, IN OUT LPWSASERVICECLASSINFOW lpServiceClassInfo)
 
PNSCATALOG_ENTRY WSAAPI WsNcEntryAllocate (VOID)
 
INT WSAAPI WsNcEntryInitializeFromRegistry (IN PNSCATALOG_ENTRY CatalogEntry, IN HKEY ParentKey, IN ULONG UniqueId)
 
VOID WSAAPI WsNcEntryDereference (IN PNSCATALOG_ENTRY CatalogEntry)
 
VOID WSAAPI WsNcEntrySetProvider (IN PNSCATALOG_ENTRY Entry, IN PNS_PROVIDER Provider)
 
BOOL WSAAPI WsNqAddProvider (IN PNSQUERY NsQuery, IN PNS_PROVIDER Provider)
 
PNSQUERY WSAAPI WsNqAllocate (VOID)
 
BOOL WSAAPI WsNqBeginEnumerationProc (PVOID Context, PNSCATALOG_ENTRY CatalogEntry)
 
VOID WSAAPI WsNqDelete (IN PNSQUERY NsQuery)
 
DWORD WSAAPI WsNqInitialize (IN PNSQUERY NsQuery)
 
DWORD WSAAPI WsNqLookupServiceBegin (IN PNSQUERY NsQuery, IN LPWSAQUERYSETW QuerySet, IN DWORD ControlFlags, IN PNSCATALOG Catalog)
 
DWORD WSAAPI WsNqLookupServiceEnd (IN PNSQUERY NsQuery)
 
DWORD WSAAPI WsNqLookupServiceNext (PNSQUERY NsQuery, DWORD, PDWORD, OUT LPWSAQUERYSETW QuerySet)
 
PNSQUERY_PROVIDER WSAAPI WsNqNextProvider (PNSQUERY NsQuery, IN PNSQUERY_PROVIDER Provider)
 
PNSQUERY_PROVIDER WSAAPI WsNqPreviousProvider (IN PNSQUERY Query, IN PNSQUERY_PROVIDER Provider)
 
VOID WSAAPI WsNqDereference (IN PNSQUERY Query)
 
BOOL WSAAPI WsNqValidateAndReference (IN PNSQUERY Query)
 
DWORD WSAAPI WsNqProvLookupServiceNext (IN PNSQUERY_PROVIDER QueryProvider, DWORD, PDWORD, LPWSAQUERYSETW QuerySet)
 
DWORD WSAAPI WsNqProvLookupServiceEnd (IN PNSQUERY_PROVIDER QueryProvider)
 
DWORD WSAAPI WsNqProvInitialize (IN PNSQUERY_PROVIDER QueryProvider, IN PNS_PROVIDER Provider)
 
PNSQUERY_PROVIDER WSAAPI WsNqProvAllocate (VOID)
 
VOID WSAAPI WsNqProvDelete (IN PNSQUERY_PROVIDER QueryProvider)
 
DWORD WSAAPI WsNqProvLookupServiceBegin (IN PNSQUERY_PROVIDER QueryProvider, IN LPWSAQUERYSETW QuerySet, IN LPWSASERVICECLASSINFOW ServiceClassInfo, IN DWORD)
 
VOID WSAAPI WsNpDelete (IN PNS_PROVIDER Provider)
 
DWORD WSAAPI WsNpLookupServiceBegin (IN PNS_PROVIDER Provider, IN LPWSAQUERYSETW Restrictions, struct _WSAServiceClassInfoW *, IN DWORD ControlFlags, OUT PHANDLE LookupHandle)
 
DWORD WSAAPI WsNpNSPCleanup (IN PNS_PROVIDER Provider)
 
DWORD WSAAPI WsNpLookupServiceEnd (IN PNS_PROVIDER Provider, IN HANDLE LookupHandle)
 
DWORD WSAAPI WsNpInitialize (IN PNS_PROVIDER Provider, IN LPWSTR DllPath, IN LPGUID ProviderGuid)
 
PNS_PROVIDER WSAAPI WsNpAllocate (VOID)
 
VOID WSAAPI WsNpDereference (IN PNS_PROVIDER Provider)
 
DWORD WSAAPI WsNpLookupServiceNext (IN PNS_PROVIDER Provider, IN HANDLE LookupHandle, IN DWORD ControlFlags, OUT PDWORD BufferLength, OUT LPWSAQUERYSETW Results)
 
VOID WSAAPI WsTpDelete (IN PTPROVIDER Provider)
 
DWORD WSAAPI WsTpWSPCleanup (IN PTPROVIDER Provider, int *)
 
PTPROVIDER WSAAPI WsTpAllocate (VOID)
 
DWORD WSAAPI WsTpInitialize (IN PTPROVIDER Provider, IN LPSTR DllName, LPWSAPROTOCOL_INFOW ProtocolInfo)
 
VOID WSAAPI WsTpDereference (IN PTPROVIDER Provider)
 
VOID WSAAPI WsThreadDelete (IN PWSTHREAD Thread)
 
VOID WSAAPI WsThreadDestroyCurrentThread (VOID)
 
DWORD WSAAPI WsThreadCreate (IN PWSPROCESS Process, IN PWSTHREAD *Thread)
 
DWORD WSAAPI WsThreadGetCurrentThread (IN PWSPROCESS Process, IN PWSTHREAD *Thread)
 
LPWSATHREADID WSAAPI WsThreadGetThreadId (IN PWSPROCESS Process)
 
DWORD WSAAPI WsThreadStartup (VOID)
 
VOID WSAAPI WsThreadCleanup (VOID)
 
DWORD WSAAPI WsThreadCancelBlockingCall (IN PWSTHREAD Thread)
 
DWORD WSAAPI WsThreadUnhookBlockingHook (IN PWSTHREAD Thread)
 
FARPROC WSAAPI WsThreadSetBlockingHook (IN PWSTHREAD Thread, IN FARPROC BlockingHook)
 
PHOSTENT WSAAPI WsThreadBlobToHostent (IN PWSTHREAD Thread, IN LPBLOB Blob)
 
PSERVENT WSAAPI WsThreadBlobToServent (IN PWSTHREAD Thread, IN LPBLOB Blob)
 
PWSPROTO_BUFFER WSAAPI WsThreadGetProtoBuffer (IN PWSTHREAD Thread)
 
PWSTHREAD WSAAPI WsThreadAllocate (VOID)
 
DWORD WSAAPI WsThreadDefaultBlockingHook (VOID)
 
DWORD WSAAPI WsThreadInitialize (IN PWSTHREAD Thread, IN PWSPROCESS Process)
 
DWORD WSAAPI WsTcFindIfsProviderForSocket (IN PTCATALOG TCatalog, SOCKET Socket)
 
DWORD WSAAPI WsTcEntryInitializeFromRegistry (IN PTCATALOG_ENTRY CatalogEntry, IN HKEY, unsigned long)
 
DWORD WSAAPI WsTcGetEntryFromAf (IN PTCATALOG TCatalog, IN INT AddressFamily, IN PTCATALOG_ENTRY *CatalogEntry)
 
PTCATALOG_ENTRY WSAAPI WsTcEntryAllocate (VOID)
 
VOID WSAAPI WsTcEntrySetProvider (IN PTCATALOG_ENTRY CatalogEntry, IN PTPROVIDER Provider)
 
DWORD WSAAPI WsTcRefreshFromRegistry (IN PTCATALOG TCatalog, PVOID)
 
BOOL WSAAPI WsTcOpen (IN PTCATALOG TCatalog, IN HKEY)
 
PTPROVIDER WSAAPI WsTcFindProvider (IN PTCATALOG TCatalog, IN LPGUID ProviderId)
 
VOID WSAAPI WsTcEnumerateCatalogItems (IN PTCATALOG Catalog, IN PTCATALOG_ENUMERATE_PROC Callback, IN PVOID Context)
 
VOID WSAAPI WsTcEntryDereference (IN PTCATALOG_ENTRY CatalogEntry)
 
PTCATALOG WSAAPI WsTcAllocate (VOID)
 
VOID WSAAPI WsTcDelete (IN PTCATALOG Catalog)
 
DWORD WSAAPI WsTcGetEntryFromTriplet (IN PTCATALOG TCatalog, IN INT AddressFamily, IN INT SocketType, IN INT Protocol, IN DWORD StartId, IN PTCATALOG_ENTRY *CatalogEntry)
 
VOID WSAAPI WsTcUpdateProtocolList (IN PTCATALOG TCatalog, PLIST_ENTRY ProtocolList)
 
VOID WSAAPI WsTcEntryDelete (IN PTCATALOG_ENTRY CatalogEntry)
 
DWORD WSAAPI WsTcGetEntryFromCatalogEntryId (IN PTCATALOG TCatalog, IN DWORD CatalogEntryId, IN PTCATALOG_ENTRY *CatalogEntry)
 
DWORD WSAAPI WsTcLoadProvider (IN PTCATALOG TCatalog, IN PTCATALOG_ENTRY CatalogEntry)
 
DWORD WSAAPI WsTcInitializeFromRegistry (IN PTCATALOG TCatalog, HKEY, PVOID)
 
INT WSAAPI WsSockStartup (VOID)
 
VOID WSAAPI WsSockCleanup (VOID)
 
BOOL WSAAPI WsSockDeleteSockets (IN LPVOID Context, IN PWAH_HANDLE Handle)
 
VOID WSAAPI WsSockDereference (IN PWSSOCKET Socket)
 
PWSSOCKET WSAAPI WsSockAllocate (VOID)
 
INT WSAAPI WsSockInitialize (IN PWSSOCKET Socket, IN PTCATALOG_ENTRY CatalogEntry)
 
INT WSAAPI WsSockAssociateHandle (IN PWSSOCKET Socket, IN SOCKET Handle, IN BOOLEAN IsProvider)
 
INT WSAAPI WsSockDisassociateHandle (IN PWSSOCKET Socket)
 
INT WSAAPI WsSockAddApiReference (IN SOCKET Handle)
 
PTCATALOG WSAAPI WsProcGetTCatalog (IN PWSPROCESS Process)
 
BOOL WSAAPI WsProcDetachSocket (IN PWSPROCESS Process, IN PWAH_HANDLE Handle)
 
INT WSAAPI WsProcGetAsyncHelper (IN PWSPROCESS Process, OUT PHANDLE Handle)
 
VOID WSAAPI WsProcDelete (IN PWSPROCESS Process)
 
INT WSAAPI WsProcStartup (VOID)
 
PNSCATALOG WSAAPI WsProcGetNsCatalog (IN PWSPROCESS Process)
 
VOID WSAAPI WsProcSetVersion (IN PWSPROCESS Process, IN WORD VersionRequested)
 
VOID WSAAPI WsAsyncQueueRequest (IN PWSASYNCBLOCK AsyncBlock)
 
BOOL WSAAPI WsAsyncCheckAndInitThread (VOID)
 
INT WSAAPI WsAsyncCancelRequest (IN HANDLE TaskHandle)
 
PWSASYNCBLOCK WSAAPI WsAsyncAllocateBlock (IN SIZE_T ExtraLength)
 
VOID WSAAPI WsAsyncTerminateThread (VOID)
 
VOID WSAAPI WsAsyncGlobalTerminate (VOID)
 
VOID WSAAPI WsAsyncGlobalInitialize (VOID)
 
FORCEINLINE PWSPROCESS WsGetProcess (VOID)
 
FORCEINLINE DWORD WsQuickProlog (VOID)
 
FORCEINLINE DWORD WsQuickPrologTid (LPWSATHREADID *Tid)
 

Variables

HINSTANCE WsDllHandle
 
HANDLE WsSockHeap
 
PWAH_HANDLE_TABLE WsSockHandleTable
 
PWSPROCESS CurrentWsProcess
 
DWORD GlobalTlsIndex
 
BOOLEAN WsAsyncThreadInitialized
 
PWS_SOCK_POST_ROUTINE WsSockPostRoutine
 

Macro Definition Documentation

◆ MAXALIASES

#define MAXALIASES   35

Definition at line 11 of file ws2_32p.h.

◆ TlsIndex

#define TlsIndex   GlobalTlsIndex

Definition at line 277 of file ws2_32p.h.

◆ WINSOCK_ROOT

#define WINSOCK_ROOT   "System\\CurrentControlSet\\Services\\WinSock2\\Parameters"

Definition at line 10 of file ws2_32p.h.

Typedef Documentation

◆ ENUM_CONTEXT

◆ NSCATALOG

◆ NSCATALOG_ENTRY

◆ NSPROVIDER

◆ NSPROVIDER_ENUM_CONTEXT

◆ NSQUERY

◆ NSQUERY_PROVIDER

◆ PENUM_CONTEXT

◆ PNS_PROVIDER

◆ PNSCATALOG

◆ PNSCATALOG_ENTRY

◆ PNSCATALOG_ENUMERATE_PROC

typedef BOOL(WINAPI * PNSCATALOG_ENUMERATE_PROC) (IN PVOID Context, IN PNSCATALOG_ENTRY Entry)

Definition at line 253 of file ws2_32p.h.

◆ PNSPROVIDER_ENUM_CONTEXT

◆ PNSQUERY

◆ PNSQUERY_PROVIDER

◆ PPROTOCOL_ENUM_CONTEXT

◆ PPROVIDER_ENUM_CONTEXT

◆ PROTOCOL_ENUM_CONTEXT

◆ PROVIDER_ENUM_CONTEXT

◆ PTCATALOG

◆ PTCATALOG_ENTRY

◆ PTCATALOG_ENUMERATE_PROC

typedef BOOL(WINAPI * PTCATALOG_ENUMERATE_PROC) (IN PVOID Context, IN PTCATALOG_ENTRY Entry)

Definition at line 259 of file ws2_32p.h.

◆ PTPROVIDER

◆ PWS_BUFFER

◆ PWS_SOCK_POST_ROUTINE

typedef BOOL(WINAPI * PWS_SOCK_POST_ROUTINE) (IN HWND hWnd, IN UINT wMsg, IN WPARAM wParam, IN LPARAM lParam)

Definition at line 265 of file ws2_32p.h.

◆ PWSASYNCBLOCK

◆ PWSASYNCCONTEXT

◆ PWSPROCESS

◆ PWSPROTO_BUFFER

◆ PWSSOCKET

◆ PWSTHREAD

◆ TCATALOG

◆ TCATALOG_ENTRY

◆ TPROVIDER

◆ WS_BUFFER

◆ WSASYNCBLOCK

◆ WSASYNCCONTEXT

◆ WSASYNCOPS

◆ WSPROCESS

◆ WSPROTO_BUFFER

◆ WSSOCKET

◆ WSTHREAD

Enumeration Type Documentation

◆ _WSASYNCOPS

Enumerator
WsAsyncGetHostByAddr 
WsAsyncGetHostByName 
WsAsyncGetProtoByName 
WsAsyncGetProtoByNumber 
WsAsyncGetServByName 
WsAsyncGetServByPort 
WsAsyncTerminate 

Definition at line 13 of file ws2_32p.h.

Function Documentation

◆ AnsiDupFromUnicode()

LPSTR WSAAPI AnsiDupFromUnicode ( IN LPCWSTR  UnicodeString)

Definition at line 20 of file qshelpr.c.

21 {
22  INT Length = 0;
23  BOOL GoOn = TRUE;
24  LPSTR DuplicatedString = NULL;
26 
27  /* Start a loop (which should only run twice) */
28  while (GoOn)
29  {
30  /* Call the conversion function */
32  0,
34  -1,
35  DuplicatedString,
36  Length,
37  NULL,
38  NULL);
39  if (ReturnValue > Length)
40  {
41  /* This is the first loop, and we have the real size now */
43 
44  /* Allocate buffer for it */
45  DuplicatedString = HeapAlloc(WsSockHeap, 0, Length);
46  if (!DuplicatedString) GoOn = FALSE;
47  }
48  else if (ReturnValue > 0)
49  {
50  /* The second loop was successful and we have the string */
51  GoOn = FALSE;
52  }
53  else
54  {
55  /* Some weird error happened */
56  if (DuplicatedString) HeapFree(WsSockHeap, 0, DuplicatedString);
57  DuplicatedString = NULL;
58  GoOn = FALSE;
59  }
60  }
61 
62  /* Return the duplicate */
63  return DuplicatedString;
64 }
#define TRUE
Definition: types.h:120
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
UINT32 void void ** ReturnValue
Definition: acevents.h:214
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
HANDLE WsSockHeap
Definition: dllmain.c:21
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by ConvertAddrinfoFromUnicodeToAnsi(), and MapUnicodeQuerySetToAnsi().

◆ CopyQuerySetW()

INT WSAAPI CopyQuerySetW ( IN LPWSAQUERYSETW  UnicodeSet,
OUT LPWSAQUERYSETW UnicodeCopy 
)

Definition at line 1050 of file qshelpr.c.

1052 {
1053  SIZE_T SetSize;
1054 
1055  /* Get the size */
1056  SetSize = WSAComputeQuerySetSizeW(UnicodeSet);
1057 
1058  /* Allocate memory for copy */
1059  *UnicodeCopy = HeapAlloc(WsSockHeap, 0, SetSize);
1060  if (!(*UnicodeCopy)) return WSA_NOT_ENOUGH_MEMORY;
1061 
1062  /* Build a copy and return */
1063  return WSABuildQuerySetBufferW(UnicodeSet, SetSize, *UnicodeCopy);
1064 }
SIZE_T WSAAPI WSAComputeQuerySetSizeW(IN LPWSAQUERYSETW UnicodeSet)
Definition: qshelpr.c:248
INT WSAAPI WSABuildQuerySetBufferW(IN LPWSAQUERYSETW UnicodeSet, IN SIZE_T BufferSize, OUT LPWSAQUERYSETW RelativeSet)
Definition: qshelpr.c:771
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WSA_NOT_ENOUGH_MEMORY
Definition: winsock2.h:593
ULONG_PTR SIZE_T
Definition: typedefs.h:78
HANDLE WsSockHeap
Definition: dllmain.c:21

Referenced by WsNqLookupServiceBegin().

◆ MapAnsiQuerySetToUnicode()

INT WSAAPI MapAnsiQuerySetToUnicode ( IN LPWSAQUERYSETA  AnsiSet,
IN OUT PSIZE_T  SetSize,
OUT LPWSAQUERYSETW  UnicodeSet 
)

Definition at line 808 of file qshelpr.c.

811 {
813  SIZE_T AnsiSize, UnicodeSize;
814  LPWSAQUERYSETA AnsiCopy = NULL;
815  LPWSAQUERYSETW UnicodeCopy;
816  LPWSTR ServiceCopy = NULL, CommentCopy = NULL;
817  LPWSTR ContextCopy = NULL, QueryCopy = NULL;
818 
819  /* Calculate the size of the Ansi version and allocate space for a copy */
820  AnsiSize = WSAComputeQuerySetSizeA(AnsiSet);
821  AnsiCopy = HeapAlloc(WsSockHeap, 0, AnsiSize);
822  if (!AnsiCopy)
823  {
824  /* Fail, couldn't allocate memory */
826  goto Exit;
827  }
828 
829  /* Build the relative buffer version */
830  ErrorCode = WSABuildQuerySetBufferA(AnsiSet, AnsiSize, AnsiCopy);
831  if (ErrorCode != ERROR_SUCCESS) goto Exit;
832 
833  /* Re-use the ANSI version since the fields match */
834  UnicodeCopy = (LPWSAQUERYSETW)AnsiCopy;
835 
836  /* Check if we have a service instance name */
837  if (AnsiCopy->lpszServiceInstanceName)
838  {
839  /* Duplicate it into unicode form */
840  ServiceCopy = UnicodeDupFromAnsi(AnsiCopy->lpszServiceInstanceName);
841  if (!ServiceCopy)
842  {
843  /* Fail */
845  goto Exit;
846  }
847 
848  /* Set the new string pointer */
849  UnicodeCopy->lpszServiceInstanceName = ServiceCopy;
850  }
851 
852  /* Check if we have a service instance name */
853  if (AnsiCopy->lpszContext)
854  {
855  /* Duplicate it into unicode form */
856  ContextCopy = UnicodeDupFromAnsi(AnsiCopy->lpszContext);
857  if (!ContextCopy)
858  {
859  /* Fail */
861  goto Exit;
862  }
863 
864  /* Set the new string pointer */
865  UnicodeCopy->lpszContext = ContextCopy;
866  }
867 
868  /* Check if we have a service instance name */
869  if (AnsiCopy->lpszComment)
870  {
871  /* Duplicate it into unicode form */
872  CommentCopy = UnicodeDupFromAnsi(AnsiCopy->lpszComment);
873  if (!CommentCopy)
874  {
875  /* Fail */
877  goto Exit;
878  }
879 
880  /* Set the new string pointer */
881  UnicodeCopy->lpszComment = CommentCopy;
882  }
883 
884  /* Check if we have a query name */
885  if (AnsiCopy->lpszQueryString)
886  {
887  /* Duplicate it into unicode form */
888  QueryCopy = UnicodeDupFromAnsi(AnsiCopy->lpszQueryString);
889  if (!QueryCopy)
890  {
891  /* Fail */
893  goto Exit;
894  }
895 
896  /* Set the new string pointer */
897  UnicodeCopy->lpszQueryString = QueryCopy;
898  }
899 
900  /* Now that we have the absolute unicode buffer, calculate its size */
901  UnicodeSize = WSAComputeQuerySetSizeW(UnicodeCopy);
902  if (UnicodeSize > *SetSize)
903  {
904  /* The buffer wasn't large enough; return how much we need */
905  *SetSize = UnicodeSize;
907  goto Exit;
908  }
909 
910  /* Build the relative unicode buffer */
911  ErrorCode = WSABuildQuerySetBufferW(UnicodeCopy, *SetSize, UnicodeSet);
912 
913 Exit:
914  /* Free the Ansi copy if we had one */
915  if (AnsiCopy) HeapFree(WsSockHeap, 0, AnsiCopy);
916 
917  /* Free all the strings */
918  if (ServiceCopy) HeapFree(WsSockHeap, 0, ServiceCopy);
919  if (CommentCopy) HeapFree(WsSockHeap, 0, CommentCopy);
920  if (ContextCopy) HeapFree(WsSockHeap, 0, ContextCopy);
921  if (QueryCopy) HeapFree(WsSockHeap, 0, QueryCopy);
922 
923  /* Return error code */
924  return ErrorCode;
925 }
SIZE_T WSAAPI WSAComputeQuerySetSizeW(IN LPWSAQUERYSETW UnicodeSet)
Definition: qshelpr.c:248
#define WSAEFAULT
Definition: winerror.h:1945
LPWSTR WSAAPI UnicodeDupFromAnsi(IN LPCSTR AnsiString)
Definition: qshelpr.c:68
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
SIZE_T WSAAPI WSAComputeQuerySetSizeA(IN LPWSAQUERYSETA AnsiSet)
Definition: qshelpr.c:240
static LPWSAQUERYSETW
Definition: sock.c:91
int32_t INT
Definition: typedefs.h:56
INT WSAAPI WSABuildQuerySetBufferW(IN LPWSAQUERYSETW UnicodeSet, IN SIZE_T BufferSize, OUT LPWSAQUERYSETW RelativeSet)
Definition: qshelpr.c:771
INT WSAAPI WSABuildQuerySetBufferA(IN LPWSAQUERYSETA AnsiSet, IN SIZE_T BufferSize, OUT LPWSAQUERYSETA RelativeSet)
Definition: qshelpr.c:734
smooth NULL
Definition: ftsmooth.c:416
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static void Exit(void)
Definition: sock.c:1331
#define WSA_NOT_ENOUGH_MEMORY
Definition: winsock2.h:593
ULONG_PTR SIZE_T
Definition: typedefs.h:78
LPSTR lpszQueryString
Definition: winsock2.h:812
LPSTR lpszComment
Definition: winsock2.h:806
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HANDLE WsSockHeap
Definition: dllmain.c:21
LPSTR lpszServiceInstanceName
Definition: winsock2.h:803
#define HeapFree(x, y, z)
Definition: compat.h:402
LPSTR lpszContext
Definition: winsock2.h:809

Referenced by WSALookupServiceBeginA().

◆ MapUnicodeProtocolInfoToAnsi()

INT WSAAPI MapUnicodeProtocolInfoToAnsi ( IN LPWSAPROTOCOL_INFOW  UnicodeInfo,
OUT LPWSAPROTOCOL_INFOA  AnsiInfo 
)

Definition at line 224 of file wsautil.c.

226 {
228 
229  /* Copy all the data that doesn't need converting */
230  RtlCopyMemory(AnsiInfo,
231  UnicodeInfo,
232  FIELD_OFFSET(WSAPROTOCOL_INFOA, szProtocol));
233 
234  /* Now convert the protocol string */
236  0,
237  UnicodeInfo->szProtocol,
238  -1,
239  AnsiInfo->szProtocol,
240  sizeof(AnsiInfo->szProtocol),
241  NULL,
242  NULL);
243  if (!ReturnValue) return WSASYSCALLFAILURE;
244 
245  /* Return success */
246  return ERROR_SUCCESS;
247 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
int32_t INT
Definition: typedefs.h:56
UINT32 void void ** ReturnValue
Definition: acevents.h:214
smooth NULL
Definition: ftsmooth.c:416
#define WSASYSCALLFAILURE
Definition: winerror.h:1994
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Referenced by getsockopt(), and WSADuplicateSocketA().

◆ MapUnicodeQuerySetToAnsi()

INT WSAAPI MapUnicodeQuerySetToAnsi ( IN LPWSAQUERYSETW  UnicodeSet,
IN OUT PSIZE_T  SetSize,
OUT LPWSAQUERYSETA  AnsiSet 
)

Definition at line 929 of file qshelpr.c.

932 {
934  SIZE_T UnicodeSize, AnsiSize;
935  LPWSAQUERYSETW UnicodeCopy = NULL;
936  LPWSAQUERYSETA AnsiCopy;
937  LPSTR ServiceCopy = NULL, CommentCopy = NULL;
938  LPSTR ContextCopy = NULL, QueryCopy = NULL;
939 
940  /* Calculate the size of the Ansi version and allocate space for a copy */
941  UnicodeSize = WSAComputeQuerySetSizeW(UnicodeSet);
942  UnicodeCopy = HeapAlloc(WsSockHeap, 0, UnicodeSize);
943  if (!UnicodeCopy)
944  {
945  /* Fail, couldn't allocate memory */
947  goto Exit;
948  }
949 
950  /* Build the relative buffer version */
951  ErrorCode = WSABuildQuerySetBufferW(UnicodeSet, UnicodeSize, UnicodeCopy);
952  if (ErrorCode != ERROR_SUCCESS) goto Exit;
953 
954  /* Re-use the Unicode version since the fields match */
955  AnsiCopy = (LPWSAQUERYSETA)UnicodeCopy;
956 
957  /* Check if we have a service instance name */
958  if (UnicodeCopy->lpszServiceInstanceName)
959  {
960  /* Duplicate it into unicode form */
961  ServiceCopy = AnsiDupFromUnicode(UnicodeCopy->lpszServiceInstanceName);
962  if (!ServiceCopy)
963  {
964  /* Fail */
966  goto Exit;
967  }
968 
969  /* Set the new string pointer */
970  AnsiCopy->lpszServiceInstanceName = ServiceCopy;
971  }
972 
973  /* Check if we have a service instance name */
974  if (UnicodeCopy->lpszContext)
975  {
976  /* Duplicate it into unicode form */
977  ContextCopy = AnsiDupFromUnicode(UnicodeCopy->lpszContext);
978  if (!ContextCopy)
979  {
980  /* Fail */
982  goto Exit;
983  }
984 
985  /* Set the new string pointer */
986  AnsiCopy->lpszContext = ContextCopy;
987  }
988 
989  /* Check if we have a service instance name */
990  if (UnicodeCopy->lpszComment)
991  {
992  /* Duplicate it into unicode form */
993  CommentCopy = AnsiDupFromUnicode(UnicodeCopy->lpszComment);
994  if (!CommentCopy)
995  {
996  /* Fail */
998  goto Exit;
999  }
1000 
1001  /* Set the new string pointer */
1002  AnsiCopy->lpszComment = CommentCopy;
1003  }
1004 
1005  /* Check if we have a query name */
1006  if (UnicodeCopy->lpszQueryString)
1007  {
1008  /* Duplicate it into unicode form */
1009  QueryCopy = AnsiDupFromUnicode(UnicodeCopy->lpszQueryString);
1010  if (!QueryCopy)
1011  {
1012  /* Fail */
1014  goto Exit;
1015  }
1016 
1017  /* Set the new string pointer */
1018  AnsiCopy->lpszQueryString = QueryCopy;
1019  }
1020 
1021  /* Now that we have the absolute unicode buffer, calculate its size */
1022  AnsiSize = WSAComputeQuerySetSizeA(AnsiCopy);
1023  if (AnsiSize > *SetSize)
1024  {
1025  /* The buffer wasn't large enough; return how much we need */
1026  *SetSize = AnsiSize;
1027  ErrorCode = WSAEFAULT;
1028  goto Exit;
1029  }
1030 
1031  /* Build the relative unicode buffer */
1032  ErrorCode = WSABuildQuerySetBufferA(AnsiCopy, *SetSize, AnsiSet);
1033 
1034 Exit:
1035  /* Free the Ansi copy if we had one */
1036  if (UnicodeCopy) HeapFree(WsSockHeap, 0, UnicodeCopy);
1037 
1038  /* Free all the strings */
1039  if (ServiceCopy) HeapFree(WsSockHeap, 0, ServiceCopy);
1040  if (CommentCopy) HeapFree(WsSockHeap, 0, CommentCopy);
1041  if (ContextCopy) HeapFree(WsSockHeap, 0, ContextCopy);
1042  if (QueryCopy) HeapFree(WsSockHeap, 0, QueryCopy);
1043 
1044  /* Return error code */
1045  return ErrorCode;
1046 }
SIZE_T WSAAPI WSAComputeQuerySetSizeW(IN LPWSAQUERYSETW UnicodeSet)
Definition: qshelpr.c:248
#define WSAEFAULT
Definition: winerror.h:1945
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
SIZE_T WSAAPI WSAComputeQuerySetSizeA(IN LPWSAQUERYSETA AnsiSet)
Definition: qshelpr.c:240
static LPWSAQUERYSETW
Definition: sock.c:91
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
INT WSAAPI WSABuildQuerySetBufferW(IN LPWSAQUERYSETW UnicodeSet, IN SIZE_T BufferSize, OUT LPWSAQUERYSETW RelativeSet)
Definition: qshelpr.c:771
INT WSAAPI WSABuildQuerySetBufferA(IN LPWSAQUERYSETA AnsiSet, IN SIZE_T BufferSize, OUT LPWSAQUERYSETA RelativeSet)
Definition: qshelpr.c:734
smooth NULL
Definition: ftsmooth.c:416
struct _WSAQuerySetA * LPWSAQUERYSETA
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static void Exit(void)
Definition: sock.c:1331
#define WSA_NOT_ENOUGH_MEMORY
Definition: winsock2.h:593
ULONG_PTR SIZE_T
Definition: typedefs.h:78
LPSTR lpszQueryString
Definition: winsock2.h:812
LPSTR lpszComment
Definition: winsock2.h:806
HANDLE WsSockHeap
Definition: dllmain.c:21
LPSTR lpszServiceInstanceName
Definition: winsock2.h:803
#define HeapFree(x, y, z)
Definition: compat.h:402
LPSTR WSAAPI AnsiDupFromUnicode(IN LPCWSTR UnicodeString)
Definition: qshelpr.c:20
LPSTR lpszContext
Definition: winsock2.h:809

Referenced by WSALookupServiceNextA().

◆ UnicodeDupFromAnsi()

LPWSTR WSAAPI UnicodeDupFromAnsi ( IN LPCSTR  AnsiString)

Definition at line 68 of file qshelpr.c.

69 {
70  INT Length = 0;
71  BOOL GoOn = TRUE;
72  LPWSTR DuplicatedString = NULL;
74 
75  /* Start a loop (which should only run twice) */
76  while (GoOn)
77  {
78  /* Call the conversion function */
80  0,
81  AnsiString,
82  -1,
83  DuplicatedString,
84  Length);
85  if (ReturnValue > Length)
86  {
87  /* This is the first loop, and we have the real size now */
89 
90  /* Allocate buffer for it */
91  DuplicatedString = HeapAlloc(WsSockHeap, 0, Length * sizeof(WCHAR));
92  if (!DuplicatedString) GoOn = FALSE;
93  }
94  else if (ReturnValue > 0)
95  {
96  /* The second loop was successful and we have the string */
97  GoOn = FALSE;
98  }
99  else
100  {
101  /* Some weird error happened */
102  if (DuplicatedString) HeapFree(WsSockHeap, 0, DuplicatedString);
103  DuplicatedString = NULL;
104  GoOn = FALSE;
105  }
106  }
107 
108  /* Return the duplicate */
109  return DuplicatedString;
110 }
#define TRUE
Definition: types.h:120
#define CP_ACP
Definition: compat.h:99
int32_t INT
Definition: typedefs.h:56
UINT32 void void ** ReturnValue
Definition: acevents.h:214
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HANDLE WsSockHeap
Definition: dllmain.c:21
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by getaddrinfo(), and MapAnsiQuerySetToUnicode().

◆ WsApiProlog()

INT WSAAPI WsApiProlog ( OUT PWSPROCESS Process,
OUT PWSTHREAD Thread 
)

Definition at line 91 of file wsautil.c.

93 {
95 
96  /* Try to get the current process */
97  if ((*Process = WsGetProcess()))
98  {
99  /* And the current thread */
101  }
102 
103  /* Return init status */
104  return ErrorCode;
105 }
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
int32_t INT
Definition: typedefs.h:56
FORCEINLINE PWSPROCESS WsGetProcess(VOID)
Definition: ws2_32p.h:885
#define WSANOTINITIALISED
Definition: winerror.h:1987
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
DWORD WSAAPI WsThreadGetCurrentThread(IN PWSPROCESS Process, IN PWSTHREAD *Thread)
Definition: dthread.c:279
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219

Referenced by connect(), gethostbyaddr(), gethostbyname(), getprotobyname(), getprotobynumber(), getservbyname(), getservbyport(), getsockopt(), inet_ntoa(), setsockopt(), socket(), WPUQueryBlockingCallback(), WSAAccept(), WSAAddressToStringA(), WSAAddressToStringW(), WSAAsyncGetHostByAddr(), WSAAsyncGetHostByName(), WSAAsyncGetProtoByName(), WSAAsyncGetProtoByNumber(), WSAAsyncGetServByName(), WSAAsyncGetServByPort(), WSACancelAsyncRequest(), WSACancelBlockingCall(), WSACleanup(), WSAIsBlocking(), WSAJoinLeaf(), WSALookupServiceBeginW(), WSALookupServiceEnd(), WSALookupServiceNextW(), WSARecvDisconnect(), WSASendDisconnect(), WSASetBlockingHook(), WSASocketW(), WSAStringToAddressA(), WSAStringToAddressW(), WSAUnhookBlockingHook(), WSCGetProviderPath(), WsSlowProlog(), and WsSlowPrologTid().

◆ WsAsyncAllocateBlock()

PWSASYNCBLOCK WSAAPI WsAsyncAllocateBlock ( IN SIZE_T  ExtraLength)

Definition at line 439 of file async.c.

440 {
441  PWSASYNCBLOCK AsyncBlock;
442 
443  /* Add the size of the block */
444  ExtraLength += sizeof(WSASYNCBLOCK);
445 
446  /* Allocate it */
447  AsyncBlock = HeapAlloc(WsSockHeap, 0, ExtraLength);
448 
449  /* Get a handle to it */
451 
452  /* Return it */
453  return AsyncBlock;
454 }
HANDLE TaskHandle
Definition: ws2_32p.h:27
#define UlongToPtr(u)
Definition: config.h:106
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WsAsyncTaskHandle
Definition: async.c:16
#define InterlockedIncrement
Definition: armddk.h:53
struct _WSASYNCBLOCK WSASYNCBLOCK
HANDLE WsSockHeap
Definition: dllmain.c:21

Referenced by WSAAsyncGetHostByAddr(), WSAAsyncGetHostByName(), WSAAsyncGetProtoByName(), WSAAsyncGetProtoByNumber(), WSAAsyncGetServByName(), WSAAsyncGetServByPort(), and WsAsyncTerminateThread().

◆ WsAsyncCancelRequest()

INT WSAAPI WsAsyncCancelRequest ( IN HANDLE  TaskHandle)

Definition at line 936 of file async.c.

937 {
939  PWSASYNCBLOCK AsyncBlock;
940 
941  /* Make sure we're initialized */
942  if (!WsAsyncThreadInitialized) return WSAEINVAL;
943 
944  /* Acquire the lock */
945  WsAsyncLock();
946 
947  /* Check if we're cancelling the current task */
948  if (TaskHandle == WsAsyncCurrentTaskHandle)
949  {
950  /* Mark us as cancelled, the async thread will see this later */
951  WsAsyncCancelledTaskHandle = TaskHandle;
952 
953  /* Release lock and return */
954  WsAsyncUnlock();
955  return NO_ERROR;
956  }
957 
958  /* Loop the queue */
960  while (Entry != WsAsyncQueue)
961  {
962  /* Get the Async Block */
963  AsyncBlock = CONTAINING_RECORD(Entry, WSASYNCBLOCK, AsyncQueue);
964 
965  /* Check if this is the one */
966  if (TaskHandle == AsyncBlock->TaskHandle)
967  {
968  /* It is, remove it */
970 
971  /* Release the lock, free the block, and return */
972  WsAsyncUnlock();
973  WsAsyncFreeBlock(AsyncBlock);
974  return NO_ERROR;
975  }
976 
977  /* Move to the next entry */
978  Entry = Entry->Flink;
979  }
980 
981  /* Nothing found, fail */
982  WsAsyncUnlock();
983  return WSAEINVAL;
984 }
HANDLE TaskHandle
Definition: ws2_32p.h:27
struct _Entry Entry
Definition: kefuncs.h:640
#define WSAEINVAL
Definition: winerror.h:1946
#define WsAsyncUnlock()
Definition: async.c:25
#define NO_ERROR
Definition: dderror.h:5
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
BOOLEAN WsAsyncThreadInitialized
Definition: async.c:15
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
Definition: typedefs.h:117
VOID WSAAPI WsAsyncFreeBlock(IN PWSASYNCBLOCK AsyncBlock)
Definition: async.c:473
HANDLE WsAsyncCancelledTaskHandle
Definition: async.c:21
PLIST_ENTRY WsAsyncQueue
Definition: async.c:17
HANDLE WsAsyncCurrentTaskHandle
Definition: async.c:20
#define WsAsyncLock()
Definition: async.c:24
base of all file and directory entries
Definition: entries.h:82

Referenced by WSACancelAsyncRequest().

◆ WsAsyncCheckAndInitThread()

BOOL WSAAPI WsAsyncCheckAndInitThread ( VOID  )

Definition at line 832 of file async.c.

833 {
834  HANDLE ThreadHandle;
835  DWORD Tid;
837  WSADATA WsaData;
838 
839  /* Make sure we're not initialized */
840  if (WsAsyncThreadInitialized) return TRUE;
841 
842  /* Acquire the lock */
843  WsAsyncLock();
844 
845  /* Make sure we're not initialized */
847  {
848  /* Initialize Thread Context */
849  Context = HeapAlloc(WsSockHeap, 0, sizeof(*Context));
850  if (!Context)
851  goto Exit;
852 
853  /* Initialize the Queue and event */
854  WsAsyncQueue = &Context->AsyncQueue;
856  Context->AsyncEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
857  WsAsyncEvent = Context->AsyncEvent;
858 
859  /* Prevent us from ever being killed while running */
860  if (WSAStartup(MAKEWORD(2,2), &WsaData) != ERROR_SUCCESS)
861  goto Fail;
862 
863  /* Create the thread */
864  ThreadHandle = CreateThread(NULL,
865  0,
867  Context,
868  0,
869  &Tid);
870  if (ThreadHandle == NULL)
871  {
872  /* Cleanup and fail */
873  WSACleanup();
874  goto Fail;
875  }
876 
877  /* Close the handle and set init */
878  CloseHandle(ThreadHandle);
880  }
881 
882 Exit:
883  /* Release the lock */
884  WsAsyncUnlock();
886 
887 Fail:
888  /* Close the event, free the Context */
889  if (Context->AsyncEvent)
890  CloseHandle(Context->AsyncEvent);
892 
893  /* Bail out */
894  goto Exit;
895 }
#define CreateEvent
Definition: winbase.h:3582
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MAKEWORD(a, b)
Definition: typedefs.h:247
INT WSAAPI WSACleanup(VOID)
Definition: startup.c:60
#define WsAsyncUnlock()
Definition: async.c:25
HANDLE WsAsyncEvent
Definition: async.c:19
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
Definition: startup.c:113
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI WsAsyncThread(IN PVOID ThreadContext)
Definition: async.c:703
BOOLEAN WsAsyncThreadInitialized
Definition: async.c:15
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static void Exit(void)
Definition: sock.c:1331
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: hiveinit.c:368
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
PLIST_ENTRY WsAsyncQueue
Definition: async.c:17
HANDLE WsSockHeap
Definition: dllmain.c:21
#define HeapFree(x, y, z)
Definition: compat.h:402
#define WsAsyncLock()
Definition: async.c:24

Referenced by WSAAsyncGetHostByAddr(), WSAAsyncGetHostByName(), WSAAsyncGetProtoByName(), WSAAsyncGetProtoByNumber(), WSAAsyncGetServByName(), and WSAAsyncGetServByPort().

◆ WsAsyncGlobalInitialize()

VOID WSAAPI WsAsyncGlobalInitialize ( VOID  )

Definition at line 31 of file async.c.

32 {
33  /* Initialize the async lock */
35 }
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
CRITICAL_SECTION WsAsyncCritSect
Definition: async.c:18

Referenced by DllMain().

◆ WsAsyncGlobalTerminate()

VOID WSAAPI WsAsyncGlobalTerminate ( VOID  )

Definition at line 39 of file async.c.

40 {
41  /* Destroy the async lock */
43 }
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
CRITICAL_SECTION WsAsyncCritSect
Definition: async.c:18

Referenced by DllMain().

◆ WsAsyncQueueRequest()

VOID WSAAPI WsAsyncQueueRequest ( IN PWSASYNCBLOCK  AsyncBlock)

Definition at line 919 of file async.c.

920 {
921  /* Get the lock */
922  WsAsyncLock();
923 
924  /* Insert it into the queue */
925  InsertTailList(WsAsyncQueue, &AsyncBlock->AsyncQueue);
926 
927  /* Wake up the thread */
929 
930  /* Release lock and return */
931  WsAsyncUnlock();
932 }
#define WsAsyncUnlock()
Definition: async.c:25
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define InsertTailList(ListHead, Entry)
HANDLE WsAsyncEvent
Definition: async.c:19
PLIST_ENTRY WsAsyncQueue
Definition: async.c:17
#define WsAsyncLock()
Definition: async.c:24

Referenced by WSAAsyncGetHostByAddr(), WSAAsyncGetHostByName(), WSAAsyncGetProtoByName(), WSAAsyncGetProtoByNumber(), WSAAsyncGetServByName(), WSAAsyncGetServByPort(), and WsAsyncTerminateThread().

◆ WsAsyncTerminateThread()

VOID WSAAPI WsAsyncTerminateThread ( VOID  )

Definition at line 899 of file async.c.

900 {
901  PWSASYNCBLOCK AsyncBlock;
902 
903  /* Make sure we're initialized */
904  if (!WsAsyncThreadInitialized) return;
905 
906  /* Allocate a block */
907  AsyncBlock = WsAsyncAllocateBlock(0);
908 
909  /* Initialize it for termination */
910  AsyncBlock->Operation = WsAsyncTerminate;
911 
912  /* Queue the request and return */
913  WsAsyncQueueRequest(AsyncBlock);
915 }
PWSASYNCBLOCK WSAAPI WsAsyncAllocateBlock(IN SIZE_T ExtraLength)
Definition: async.c:439
BOOLEAN WsAsyncThreadInitialized
Definition: async.c:15
VOID WSAAPI WsAsyncQueueRequest(IN PWSASYNCBLOCK AsyncBlock)
Definition: async.c:919
WSASYNCOPS Operation
Definition: ws2_32p.h:28

Referenced by WSACleanup().

◆ WSAttemptAutodialAddr()

BOOL WSAAPI WSAttemptAutodialAddr ( IN CONST SOCKADDR FAR Name,
IN INT  NameLength 
)

Definition at line 20 of file winsock.c.

22 {
24  PSOCKADDR_NB NetBios = (PSOCKADDR_NB)Name;
25  AUTODIAL_ADDR AutodialAddress;
26 
27  /* Check the family type */
28  switch (Name->sa_family)
29  {
30  case AF_INET:
31  /* Normal IPv4, set the Autodial Address Data */
32  AutodialAddress.Family = AutoDialIp;
33  AutodialAddress.Ip4Address = Ip->sin_addr;
34  break;
35 
36  case AF_NETBIOS:
37  /* NetBIOS, set the Autodial Address Data*/
38  AutodialAddress.Family = AutoDialNetBios;
39  RtlCopyMemory(&AutodialAddress.NetBiosAddress,
40  NetBios->snb_name,
42  break;
43 
44  default:
45  /* Unsupported family type */
46  return FALSE;
47  }
48 
49  /* Call the public routine */
50  return AcsHlpAttemptConnection(&AutodialAddress);
51 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
IN_ADDR Ip4Address
Definition: precomp.h:58
#define AF_NETBIOS
Definition: winsock.h:363
BOOLEAN WINAPI AcsHlpAttemptConnection(IN PAUTODIAL_ADDR ConnectionAddress)
Definition: autodial.c:89
struct sockaddr_nb * PSOCKADDR_NB
AUTODIAL_FAMILY Family
Definition: precomp.h:55
#define NETBIOS_NAME_LENGTH
Definition: wsnetbs.h:4
struct in_addr sin_addr
Definition: winsock.h:512
struct sockaddr_in * PSOCKADDR_IN
Definition: winsock.h:488
#define AF_INET
Definition: tcpip.h:117
CHAR NetBiosAddress[NETBIOS_NAME_LENGTH]
Definition: precomp.h:60
char snb_name[NETBIOS_NAME_LENGTH]
Definition: wsnetbs.h:14

Referenced by connect().

◆ WSAttemptAutodialName()

BOOL WSAAPI WSAttemptAutodialName ( IN CONST LPWSAQUERYSETW  lpqsRestrictions)

Definition at line 58 of file winsock.c.

59 {
60  AUTODIAL_ADDR AutodialAddress;
61  CHAR AnsiIp[17];
62  LPGUID Guid = Restrictions->lpServiceClassId;
63 
64  /* Make sure we actually have a name */
65  if (!Restrictions->lpszServiceInstanceName) return FALSE;
66 
67  /* Check if this is the Hostname GUID */
68  if (!memcmp(Guid, &HostnameGuid, sizeof(GUID)))
69  {
70  /* It is. Set up the Autodial Address Data */
71  AutodialAddress.Family = AutoDialIpHost;
73  0,
74  Restrictions->lpszServiceInstanceName,
75  -1,
76  AutodialAddress.HostName,
78  0,
79  0);
80 
81  /* Call the public routine */
82  return AcsHlpAttemptConnection(&AutodialAddress);
83  }
84  else if (!memcmp(Guid, &AddressGuid, sizeof(GUID)))
85  {
86  /* It's actually the IP String GUID */
87  AutodialAddress.Family = AutoDialIp;
88 
89  /* Convert the IP String to ANSI and then convert it to IP */
91  0,
92  Restrictions->lpszServiceInstanceName,
93  -1,
94  AnsiIp,
95  sizeof(AnsiIp) - 1,
96  0,
97  0);
98  _strlwr(AnsiIp);
99  AutodialAddress.Ip4Address.S_un.S_addr = inet_addr(AnsiIp);
100 
101  /* Make sure the IP is valid */
102  if (AutodialAddress.Ip4Address.S_un.S_addr == -1) return FALSE;
103 
104  /* Call the public routine */
105  return AcsHlpAttemptConnection(&AutodialAddress);
106  }
107  else
108  {
109  /* Unknown GUID type */
110  return FALSE;
111  }
112 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
union in_addr::@1005 S_un
#define inet_addr(cp)
Definition: inet.h:98
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
IN_ADDR Ip4Address
Definition: precomp.h:58
BOOLEAN WINAPI AcsHlpAttemptConnection(IN PAUTODIAL_ADDR ConnectionAddress)
Definition: autodial.c:89
CHAR HostName[INTERNET_MAX_PATH_LENGTH]
Definition: precomp.h:61
static GUID * Guid
Definition: apphelp.c:93
const GUID DECLSPEC_SELECTANY AddressGuid
Definition: nsp_dns.h:18
AUTODIAL_FAMILY Family
Definition: precomp.h:55
u_long S_addr
Definition: tcpip.h:131
#define INTERNET_MAX_PATH_LENGTH
Definition: wininet.h:49
_CRTIMP char *__cdecl _strlwr(_Inout_z_ char *_String)
const GUID DECLSPEC_SELECTANY HostnameGuid
Definition: nsp_dns.h:17

Referenced by WsNqLookupServiceNext().

◆ WsCheckCatalogState()

BOOL WSAAPI WsCheckCatalogState ( IN HANDLE  Event)

Definition at line 75 of file wsautil.c.

76 {
77  DWORD Return;
78 
79  /* Wait for the object */
80  Return = WaitForSingleObject(Event, 0);
81 
82  /* Check for the value */
83  if (Return == WAIT_OBJECT_0) return TRUE;
84 
85  /* If it timedout or anything else, return false */
86  return FALSE;
87 }
#define TRUE
Definition: types.h:120
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define WAIT_OBJECT_0
Definition: winbase.h:387
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by WsNcRefreshFromRegistry(), WsProcGetNsCatalog(), WsProcGetTCatalog(), and WsTcRefreshFromRegistry().

◆ WsCreateStartupSynchronization()

VOID WSAAPI WsCreateStartupSynchronization ( VOID  )

Definition at line 28 of file startup.c.

29 {
30  /* Initialize the startup lock */
32 }
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define WsStartupLock()
Definition: startup.c:21

Referenced by DllMain().

◆ WsDestroyStartupSynchronization()

VOID WSAAPI WsDestroyStartupSynchronization ( VOID  )

Definition at line 36 of file startup.c.

37 {
38  /* Destroy the startup lock */
40 }
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define WsStartupLock()
Definition: startup.c:21

Referenced by DllMain().

◆ WsGetProcess()

FORCEINLINE PWSPROCESS WsGetProcess ( VOID  )

◆ WsNcAllocate()

PNSCATALOG WSAAPI WsNcAllocate ( VOID  )

Definition at line 25 of file nscatalo.c.

26 {
27  PNSCATALOG Catalog;
28 
29  /* Allocate the catalog */
30  Catalog = HeapAlloc(WsSockHeap, HEAP_ZERO_MEMORY, sizeof(*Catalog));
31 
32  /* Return it */
33  return Catalog;
34 }
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HANDLE WsSockHeap
Definition: dllmain.c:21

Referenced by WsProcInitialize().

◆ WsNcDelete()

VOID WSAAPI WsNcDelete ( IN PNSCATALOG  Catalog)

Definition at line 603 of file nscatalo.c.

604 {
606  PNSCATALOG_ENTRY CatalogEntry;
607 
608  /* Check if we're initialized */
609  if (!Catalog->CatalogList.Flink) return;
610 
611  /* Acquire lock */
612  WsNcLock();
613 
614  /* Loop every entry */
615  Entry = Catalog->CatalogList.Flink;
616  while (Entry != &Catalog->CatalogList)
617  {
618  /* Get this entry */
619  CatalogEntry = CONTAINING_RECORD(Entry, NSCATALOG_ENTRY, CatalogLink);
620 
621  /* Remove it and dereference it */
622  WsNcRemoveCatalogItem(Catalog, CatalogEntry);
623  WsNcEntryDereference(CatalogEntry);
624 
625  /* Move to the next entry */
626  Entry = Catalog->CatalogList.Flink;
627  }
628 
629  /* Check if the catalog key is opened */
630  if (Catalog->CatalogKey)
631  {
632  /* Close it */
633  RegCloseKey(Catalog->CatalogKey);
634  Catalog->CatalogKey = NULL;
635  }
636 
637  /* Release and delete the lock */
638  WsNcUnlock();
639  DeleteCriticalSection(&Catalog->Lock);
640 
641  /* Delete the object */
642  HeapFree(WsSockHeap, 0, Catalog);
643 }
struct _Entry Entry
Definition: kefuncs.h:640
VOID WSAAPI WsNcEntryDereference(IN PNSCATALOG_ENTRY CatalogEntry)
Definition: nscatent.c:53
Definition: ws2_32p.h:121
#define WsNcUnlock()
Definition: nscatalo.c:19
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define WsNcLock()
Definition: nscatalo.c:18
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
Definition: typedefs.h:117
VOID WSAAPI WsNcRemoveCatalogItem(IN PNSCATALOG Catalog, IN PNSCATALOG_ENTRY Entry)
Definition: nscatalo.c:591
HANDLE WsSockHeap
Definition: dllmain.c:21
#define HeapFree(x, y, z)
Definition: compat.h:402
base of all file and directory entries
Definition: entries.h:82

Referenced by WsProcDelete().

◆ WsNcEntryAllocate()

PNSCATALOG_ENTRY WSAAPI WsNcEntryAllocate ( VOID  )

Definition at line 17 of file nscatent.c.

18 {
19  PNSCATALOG_ENTRY CatalogEntry;
20 
21  /* Allocate the catalog */
22  CatalogEntry = HeapAlloc(WsSockHeap, HEAP_ZERO_MEMORY, sizeof(*CatalogEntry));
23  if (CatalogEntry)
24  {
25  /* Set the default non-null members */
26  CatalogEntry->RefCount = 1;
27  CatalogEntry->Enabled = TRUE;
28  CatalogEntry->AddressFamily = -1;
29  }
30 
31  /* Return it */
32  return CatalogEntry;
33 }
#define TRUE
Definition: types.h:120
LONG AddressFamily
Definition: ws2_32p.h:126
Definition: ws2_32p.h:121
LONG RefCount
Definition: ws2_32p.h:124
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOLEAN Enabled
Definition: ws2_32p.h:130
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HANDLE WsSockHeap
Definition: dllmain.c:21

Referenced by WsNcRefreshFromRegistry().

◆ WsNcEntryDereference()

VOID WSAAPI WsNcEntryDereference ( IN PNSCATALOG_ENTRY  CatalogEntry)

Definition at line 53 of file nscatent.c.

54 {
55  /* Dereference and check if it's now 0 */
56  if (!(InterlockedDecrement(&CatalogEntry->RefCount)))
57  {
58  /* We can delete the Provider now */
59  WsNcEntryDelete(CatalogEntry);
60  }
61 }
#define InterlockedDecrement
Definition: armddk.h:52
VOID WSAAPI WsNcEntryDelete(IN PNSCATALOG_ENTRY CatalogEntry)
Definition: nscatent.c:37

Referenced by WsNcDelete(), WsNcRefreshFromRegistry(), and WsNcUpdateNamespaceList().

◆ WsNcEntryInitializeFromRegistry()

INT WSAAPI WsNcEntryInitializeFromRegistry ( IN PNSCATALOG_ENTRY  CatalogEntry,
IN HKEY  ParentKey,
IN ULONG  UniqueId 
)

Definition at line 65 of file nscatent.c.

68 {
69  INT ErrorCode;
70  CHAR CatalogEntryName[13];
71  HKEY EntryKey;
72  ULONG RegType = REG_SZ;
73  ULONG RegSize = MAX_PATH;
74  ULONG RegValue;
75 
76  /* Convert to a 00000xxx string */
77  sprintf(CatalogEntryName, "%0""12""i", (int)UniqueId);
78 
79  /* Open the Entry */
80  ErrorCode = RegOpenKeyEx(ParentKey,
81  CatalogEntryName,
82  0,
83  KEY_READ,
84  &EntryKey);
85  if (ErrorCode != ERROR_SUCCESS) return ErrorCode;
86  /* Read the Library Path */
87  ErrorCode = RegQueryValueExW(EntryKey,
88  L"LibraryPath",
89  0,
90  &RegType,
91  (LPBYTE)&CatalogEntry->DllPath,
92  &RegSize);
93  if (ErrorCode != ERROR_SUCCESS) goto out;
94  /* Query Display String Size*/
95  ErrorCode = RegQueryValueExW(EntryKey,
96  L"DisplayString",
97  0,
98  NULL,
99  NULL,
100  &RegSize);
101  if (ErrorCode != ERROR_SUCCESS) goto out;
102  /* Allocate it */
103  CatalogEntry->ProviderName = (LPWSTR)HeapAlloc(WsSockHeap, 0, RegSize);
104 
105  /* Read it */
106  ErrorCode = RegQueryValueExW(EntryKey,
107  L"DisplayString",
108  0,
109  &RegType,
110  (LPBYTE)CatalogEntry->ProviderName,
111  &RegSize);
112  if (ErrorCode != ERROR_SUCCESS) goto out;
113  /* Read the Provider Id */
114  RegType = REG_BINARY;
115  RegSize = sizeof(GUID);
116  ErrorCode = RegQueryValueEx(EntryKey,
117  "ProviderId",
118  0,
119  &RegType,
120  (LPBYTE)&CatalogEntry->ProviderId,
121  &RegSize);
122  if (ErrorCode != ERROR_SUCCESS) goto out;
123  /* Read the Address Family */
124  RegType = REG_DWORD;
125  RegSize = sizeof(DWORD);
126  ErrorCode = RegQueryValueEx(EntryKey,
127  "AddressFamily",
128  0,
129  &RegType,
130  (LPBYTE)&CatalogEntry->AddressFamily,
131  &RegSize);
132  if (ErrorCode != ERROR_SUCCESS) goto out;
133  /* Read the Namespace Id */
134  ErrorCode = RegQueryValueEx(EntryKey,
135  "SupportedNamespace",
136  0,
137  &RegType,
138  (LPBYTE)&CatalogEntry->NamespaceId,
139  &RegSize);
140  if (ErrorCode != ERROR_SUCCESS) goto out;
141  /* Read the Enabled Flag */
142  ErrorCode = RegQueryValueEx(EntryKey,
143  "Enabled",
144  0,
145  &RegType,
146  (LPBYTE)&RegValue,
147  &RegSize);
148  if (ErrorCode != ERROR_SUCCESS) goto out;
149  CatalogEntry->Enabled = RegValue != 0;
150 
151  /* Read the Version */
152  ErrorCode = RegQueryValueEx(EntryKey,
153  "Version",
154  0,
155  &RegType,
156  (LPBYTE)&CatalogEntry->Version,
157  &RegSize);
158  if (ErrorCode != ERROR_SUCCESS) goto out;
159  /* Read the Support Service Class Info Flag */
160  ErrorCode = RegQueryValueEx(EntryKey,
161  "StoresServiceClassInfo",
162  0,
163  &RegType,
164  (LPBYTE)&RegValue,
165  &RegSize);
166  CatalogEntry->StoresServiceClassInfo = RegValue != 0;
167 out:
168  /* Done */
169  RegCloseKey(EntryKey);
170  return ErrorCode;
171 }
#define RegQueryValueEx
Definition: winreg.h:524
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
char CHAR
Definition: xmlstorage.h:175
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
#define sprintf(buf, format,...)
Definition: sprintf.c:55
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
#define MAX_PATH
Definition: compat.h:26
static FILE * out
Definition: regtests2xml.c:44
static const WCHAR L[]
Definition: oid.c:1250
struct _GUID GUID
#define RegOpenKeyEx
Definition: winreg.h:520
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define REG_DWORD
Definition: sdbapi.c:596
HANDLE WsSockHeap
Definition: dllmain.c:21
#define REG_SZ
Definition: layer.c:22

Referenced by WsNcRefreshFromRegistry().

◆ WsNcEntrySetProvider()

VOID WSAAPI WsNcEntrySetProvider ( IN PNSCATALOG_ENTRY  Entry,
IN PNS_PROVIDER  Provider 
)

Definition at line 175 of file nscatent.c.

177 {
178  /* Reference the provider */
179  InterlockedIncrement(&Provider->RefCount);
180 
181  /* Set it */
182  Entry->Provider = Provider;
183 }
#define InterlockedIncrement
Definition: armddk.h:53
base of all file and directory entries
Definition: entries.h:82

Referenced by WsNcLoadProvider().

◆ WsNcEnumerateCatalogItems()

VOID WSAAPI WsNcEnumerateCatalogItems ( IN PNSCATALOG  Catalog,
IN PNSCATALOG_ENUMERATE_PROC  Callback,
IN PVOID  Context 
)

Definition at line 350 of file nscatalo.c.

353 {
355  PNSCATALOG_ENTRY CatalogEntry;
356  BOOL GoOn = TRUE;
357 
358  /* Lock the catalog */
359  WsNcLock();
360 
361  /* Loop the entries */
362  Entry = Catalog->CatalogList.Flink;
363  while (GoOn && (Entry != &Catalog->CatalogList))
364  {
365  /* Get the entry */
366  CatalogEntry = CONTAINING_RECORD(Entry, NSCATALOG_ENTRY, CatalogLink);
367 
368  /* Move to the next one and call the callback */
369  Entry = Entry->Flink;
370  GoOn = Callback(Context, CatalogEntry);
371  }
372 
373  /* Release the lock */
374  WsNcUnlock();
375 }
#define TRUE
Definition: types.h:120
struct _Entry Entry
Definition: kefuncs.h:640
Definition: ws2_32p.h:121
#define WsNcUnlock()
Definition: nscatalo.c:19
#define WsNcLock()
Definition: nscatalo.c:18
unsigned int BOOL
Definition: ntddk_ex.h:94
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
Definition: typedefs.h:117
LPFNPSPCALLBACK Callback
Definition: desk.c:111
base of all file and directory entries
Definition: entries.h:82

Referenced by WSAEnumNameSpaceProvidersInternal(), WSCGetProviderPath(), WsNqLookupServiceBegin(), and WsProcDelete().

◆ WsNcGetCatalogFromProviderId()

INT WSAAPI WsNcGetCatalogFromProviderId ( IN PNSCATALOG  Catalog,
IN LPGUID  ProviderId,
OUT PNSCATALOG_ENTRY CatalogEntry 
)

Definition at line 496 of file nscatalo.c.

499 {
501  PLIST_ENTRY NextEntry;
503 
504  /* Lock the catalog */
505  WsNcLock();
506 
507  /* Match the Id with all the entries in the List */
508  NextEntry = Catalog->CatalogList.Flink;
509  while (NextEntry != &Catalog->CatalogList)
510  {
511  /* Get the Current Entry */
512  Entry = CONTAINING_RECORD(NextEntry, NSCATALOG_ENTRY, CatalogLink);
513  NextEntry = NextEntry->Flink;
514 
515  /* Check if this is the Catalog Entry ID we want */
516  if (IsEqualGUID(&Entry->ProviderId, ProviderId))
517  {
518  /* If it doesn't already have a provider, load the provider */
519  if (!Entry->Provider)
520  ErrorCode = WsNcLoadProvider(Catalog, Entry);
521 
522  /* If we succeeded, reference the entry and return it */
523  if (Entry->Provider /* || ErrorCode == ERROR_SUCCESS */)
524  {
525  InterlockedIncrement(&Entry->RefCount);
526  *CatalogEntry = Entry;
528  break;
529  }
530  }
531  }
532 
533  /* Release the lock and return */
534  WsNcUnlock();
535  return ErrorCode;
536 }
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _Entry Entry
Definition: kefuncs.h:640
#define WSAEINVAL
Definition: winerror.h:1946
Definition: ws2_32p.h:121
int32_t INT
Definition: typedefs.h:56
#define WsNcUnlock()
Definition: nscatalo.c:19
#define WsNcLock()
Definition: nscatalo.c:18
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
Definition: typedefs.h:117
#define InterlockedIncrement
Definition: armddk.h:53
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
INT WSAAPI WsNcLoadProvider(IN PNSCATALOG Catalog, IN PNSCATALOG_ENTRY CatalogEntry)
Definition: nscatalo.c:379
base of all file and directory entries
Definition: entries.h:82

Referenced by WsNqLookupServiceBegin().

◆ WsNcGetServiceClassInfo()

INT WSAAPI WsNcGetServiceClassInfo ( IN PNSCATALOG  Catalog,
IN OUT LPDWORD  BugSize,
IN OUT LPWSASERVICECLASSINFOW  lpServiceClassInfo 
)

Definition at line 423 of file nscatalo.c.

426 {
427  /* Not yet implemented in the spec? */
429  return SOCKET_ERROR;
430 }
#define SOCKET_ERROR
Definition: winsock.h:333
#define ERROR_SUCCESS
Definition: deptool.c:10
#define SetLastError(x)
Definition: compat.h:417

Referenced by WsNqLookupServiceBegin().

◆ WsNcInitializeFromRegistry()

INT WSAAPI WsNcInitializeFromRegistry ( IN PNSCATALOG  Catalog,
IN HKEY  ParentKey,
IN HANDLE  CatalogEvent 
)

Definition at line 190 of file nscatalo.c.

193 {
195 
196  /* Open the catalog */
197  if (WsNcOpen(Catalog, ParentKey))
198  {
199  /* Refresh it */
200  ErrorCode = WsNcRefreshFromRegistry(Catalog, CatalogEvent);
201  }
202 
203  /* Return the status */
204  return ErrorCode;
205 }
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
int32_t INT
Definition: typedefs.h:56
BOOLEAN WSAAPI WsNcOpen(IN PNSCATALOG Catalog, IN HKEY ParentKey)
Definition: nscatalo.c:38
#define WSASYSCALLFAILURE
Definition: winerror.h:1994
INT WSAAPI WsNcRefreshFromRegistry(IN PNSCATALOG Catalog, IN HANDLE CatalogEvent)
Definition: nscatalo.c:209

Referenced by WsProcInitialize().

◆ WsNcLoadProvider()

INT WSAAPI WsNcLoadProvider ( IN PNSCATALOG  Catalog,
IN PNSCATALOG_ENTRY  CatalogEntry 
)

Definition at line 379 of file nscatalo.c.

381 {
384 
385  /* Lock the catalog */
386  WsNcLock();
387 
388  /* Check if we have a provider already */
389  if (!CatalogEntry->Provider)
390  {
391  /* Allocate a provider */
392  if ((Provider = WsNpAllocate()))
393  {
394  /* Initialize it */
396  CatalogEntry->DllPath,
397  &CatalogEntry->ProviderId);
398 
399  /* Ensure success */
400  if (ErrorCode == ERROR_SUCCESS)
401  {
402  /* Set the provider */
403  WsNcEntrySetProvider(CatalogEntry, Provider);
404  }
405 
406  /* Dereference it */
408  }
409  else
410  {
411  /* No memory */
413  }
414  }
415 
416  /* Release the lock and return */
417  WsNcUnlock();
418  return ErrorCode;
419 }
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WSAAPI WsNpInitialize(IN PNS_PROVIDER Provider, IN LPWSTR DllPath, IN LPGUID ProviderGuid)
Definition: nsprovid.c:82
int32_t INT
Definition: typedefs.h:56
#define WsNcUnlock()
Definition: nscatalo.c:19
#define WsNcLock()
Definition: nscatalo.c:18
VOID WSAAPI WsNpDereference(IN PNS_PROVIDER Provider)
Definition: nsprovid.c:180
#define WSA_NOT_ENOUGH_MEMORY
Definition: winsock2.h:593
VOID WSAAPI WsNcEntrySetProvider(IN PNSCATALOG_ENTRY Entry, IN PNS_PROVIDER Provider)
Definition: nscatent.c:175
PNS_PROVIDER WSAAPI WsNpAllocate(VOID)
Definition: nsprovid.c:63

Referenced by WsNcGetCatalogFromProviderId(), and WsNqBeginEnumerationProc().

◆ WsNcMatchProtocols()

BOOL WSAAPI WsNcMatchProtocols ( IN DWORD  NameSpace,
IN LONG  AddressFamily,
IN LPWSAQUERYSETW  QuerySet 
)

Definition at line 540 of file nscatalo.c.

543 {
544  DWORD ProtocolCount = QuerySet->dwNumberOfProtocols;
545  LPAFPROTOCOLS AfpProtocols = QuerySet->lpafpProtocols;
546  LONG Family;
547 
548  /* Check for valid family */
549  if (AddressFamily != -1)
550  {
551  /* Check if it's the magic */
552  if (AddressFamily == AF_UNSPEC) return TRUE;
554  }
555  else
556  {
557  /* No family given, check for namespace */
558  if (NameSpace == NS_SAP)
559  {
560  /* Use IPX family */
561  Family = AF_IPX;
562  }
563  else
564  {
565  /* Other namespace, it's valid */
566  return TRUE;
567  }
568  }
569 
570  /* Now try to get a match */
571  while (ProtocolCount--)
572  {
573  /* Check this protocol entry */
574  if ((AfpProtocols->iAddressFamily == AF_UNSPEC) ||
575  (AfpProtocols->iAddressFamily == Family))
576  {
577  /* Match found */
578  return TRUE;
579  }
580 
581  /* Move to the next one */
582  AfpProtocols++;
583  }
584 
585  /* No match */
586  return FALSE;
587 }
IN PCO_ADDRESS_FAMILY AddressFamily
Definition: ndis.h:1906
#define TRUE
Definition: types.h:120
static int Family
Definition: ping.c:62
long LONG
Definition: pedump.c:60
#define AF_UNSPEC
Definition: winsock.h:344
unsigned long DWORD
Definition: ntddk_ex.h:95
#define AF_IPX
Definition: winsock.h:350
INT iAddressFamily
Definition: winsock2.h:787
#define NS_SAP
Definition: nspapi.h:10

Referenced by WsNqBeginEnumerationProc().

◆ WsNcRefreshFromRegistry()

INT WSAAPI WsNcRefreshFromRegistry ( IN PNSCATALOG  Catalog,
IN HANDLE  CatalogEvent 
)

Definition at line 209 of file nscatalo.c.

211 {
212  INT ErrorCode;
213  BOOLEAN LocalEvent = FALSE;
214  LIST_ENTRY LocalList;
215  DWORD UniqueId;
216  HKEY EntriesKey;
217  DWORD CatalogEntries;
218  PNSCATALOG_ENTRY CatalogEntry;
219  BOOL NewChangesMade;
221  DWORD RegType = REG_DWORD;
222  DWORD RegSize = sizeof(DWORD);
223  DWORD i;
224 
225  /* Check if we got an event */
226  if (!CatalogEvent)
227  {
228  /* Create an event ourselves */
229  CatalogEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
230  if (!CatalogEvent) return WSASYSCALLFAILURE;
231  LocalEvent = TRUE;
232  }
233 
234  /* Lock the catalog */
235  WsNcLock();
236 
237  /* Initialize our local list for the loop */
238  InitializeListHead(&LocalList);
239 
240  /* Start looping */
241  do
242  {
243  /* Setup notifications for the catalog entry */
244  ErrorCode = WsSetupCatalogProtection(Catalog->CatalogKey,
245  CatalogEvent,
246  &UniqueId);
247  if (ErrorCode != ERROR_SUCCESS) break;
248 
249  /* Check if we've changed till now */
250  if (UniqueId == Catalog->UniqueId)
251  {
252  /* We haven't, so return */
254  break;
255  }
256 
257  /* Now Open the Entries */
258  ErrorCode = RegOpenKeyEx(Catalog->CatalogKey,
259  "Catalog_Entries",
260  0,
262  &EntriesKey);
263  if (ErrorCode != ERROR_SUCCESS)
264  {
265  /* Critical failure */
267  break;
268  }
269 
270  /* Find out how many there are */
271  ErrorCode = RegQueryValueEx(Catalog->CatalogKey,
272  "Num_Catalog_Entries",
273  0,
274  &RegType,
275  (LPBYTE)&CatalogEntries,
276  &RegSize);
277  if (ErrorCode != ERROR_SUCCESS)
278  {
279  /* Critical failure */
281  break;
282  }
283 
284  /* Initialize them all */
285  for (i = 1; i <= CatalogEntries; i++)
286  {
287  /* Allocate a Catalog Entry Structure */
288  CatalogEntry = WsNcEntryAllocate();
289  if (!CatalogEntry)
290  {
291  /* Not enough memory, fail */
293  break;
294  }
295 
296  /* Initialize it from the Registry Key */
298  EntriesKey,
299  i);
300  if (ErrorCode != ERROR_SUCCESS)
301  {
302  /* We failed to get it, dereference the entry and leave */
303  WsNcEntryDereference(CatalogEntry);
304  break;
305  }
306 
307  /* Insert it to our List */
308  InsertTailList(&LocalList, &CatalogEntry->CatalogLink);
309  }
310 
311  /* Close the catalog key */
312  RegCloseKey(EntriesKey);
313 
314  /* Check if we changed during our read and if we have success */
315  NewChangesMade = WsCheckCatalogState(CatalogEvent);
316  if (!NewChangesMade && ErrorCode == ERROR_SUCCESS)
317  {
318  /* All is good, update the protocol list */
319  WsNcUpdateNamespaceList(Catalog, &LocalList);
320 
321  /* Update and return */
322  Catalog->UniqueId = UniqueId;
323  break;
324  }
325 
326  /* We failed and/or catalog data changed, free what we did till now */
327  while (!IsListEmpty(&LocalList))
328  {
329  /* Get the LP Catalog Item */
330  Entry = RemoveHeadList(&LocalList);
331  CatalogEntry = CONTAINING_RECORD(Entry, NSCATALOG_ENTRY, CatalogLink);
332 
333  /* Dereference it */
334  WsNcEntryDereference(CatalogEntry);
335  }
336  } while (NewChangesMade);
337 
338  /* Release the lock */
339  WsNcUnlock();
340 
341  /* Close the event, if any was created by us */
342  if (LocalEvent) CloseHandle(CatalogEvent);
343 
344  /* All Done */
345  return ErrorCode;
346 }
#define CreateEvent
Definition: winbase.h:3582
#define RegQueryValueEx
Definition: winreg.h:524
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _Entry Entry
Definition: kefuncs.h:640
VOID WSAAPI WsNcEntryDereference(IN PNSCATALOG_ENTRY CatalogEntry)
Definition: nscatent.c:53
INT WSAAPI WsNcEntryInitializeFromRegistry(IN PNSCATALOG_ENTRY CatalogEntry, IN HKEY ParentKey, IN ULONG UniqueId)
Definition: nscatent.c:65
#define InsertTailList(ListHead, Entry)
LIST_ENTRY CatalogLink
Definition: ws2_32p.h:123
Definition: ws2_32p.h:121
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
#define WsNcUnlock()
Definition: nscatalo.c:19
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define WsNcLock()
Definition: nscatalo.c:18
unsigned int BOOL
Definition: ntddk_ex.h:94
INT WSAAPI WsSetupCatalogProtection(IN HKEY CatalogKey, IN HANDLE CatalogEvent, OUT LPDWORD UniqueId)
Definition: wsautil.c:142
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
VOID WSAAPI WsNcUpdateNamespaceList(IN PNSCATALOG Catalog, IN PLIST_ENTRY List)
Definition: nscatalo.c:434
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WSA_NOT_ENOUGH_MEMORY
Definition: winsock2.h:593
BOOL WSAAPI WsCheckCatalogState(IN HANDLE Event)
Definition: wsautil.c:75
Definition: typedefs.h:117
#define WSASYSCALLFAILURE
Definition: winerror.h:1994
#define RegOpenKeyEx
Definition: winreg.h:520
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
PNSCATALOG_ENTRY WSAAPI WsNcEntryAllocate(VOID)
Definition: nscatent.c:17
#define REG_DWORD
Definition: sdbapi.c:596
base of all file and directory entries
Definition: entries.h:82

Referenced by WsNcInitializeFromRegistry(), and WsProcGetNsCatalog().

◆ WsNcUpdateNamespaceList()

VOID WSAAPI WsNcUpdateNamespaceList ( IN PNSCATALOG  Catalog,
IN PLIST_ENTRY  List 
)

Definition at line 434 of file nscatalo.c.

436 {
437  LIST_ENTRY TempList;
438  PNSCATALOG_ENTRY CatalogEntry, OldCatalogEntry;
440 
441  /* First move from our list to the old one */
442  InsertHeadList(&Catalog->CatalogList, &TempList);
443  RemoveEntryList(&Catalog->CatalogList);
444  InitializeListHead(&Catalog->CatalogList);
445 
446  /* Loop every item on the list */
447  while (!IsListEmpty(List))
448  {
449  /* Get the catalog entry */
451  CatalogEntry = CONTAINING_RECORD(Entry, NSCATALOG_ENTRY, CatalogLink);
452 
453  /* Check if this item is already on our list */
454  Entry = TempList.Flink;
455  while (Entry != &TempList)
456  {
457  /* Get the catalog entry */
458  OldCatalogEntry = CONTAINING_RECORD(Entry, NSCATALOG_ENTRY, CatalogLink);
459  Entry = Entry->Flink;
460 
461  /* Check if they match */
462  if (IsEqualGUID(&CatalogEntry->ProviderId,
463  &OldCatalogEntry->ProviderId))
464  {
465  /* We have a match, use the old item instead */
466  WsNcEntryDereference(CatalogEntry);
467  CatalogEntry = OldCatalogEntry;
468  RemoveEntryList(&CatalogEntry->CatalogLink);
469 
470  /* Decrease the number of protocols we have */
471  Catalog->ItemCount--;
472  break;
473  }
474  }
475 
476  /* Add this item */
477  InsertTailList(&Catalog->CatalogList, &CatalogEntry->CatalogLink);
478  Catalog->ItemCount++;
479  }
480 
481  /* If there's anything left on the temporary list */
482  while (!IsListEmpty(&TempList))
483  {
484  /* Get the entry */
485  Entry = RemoveHeadList(&TempList);
486  CatalogEntry = CONTAINING_RECORD(Entry, NSCATALOG_ENTRY, CatalogLink);
487 
488  /* Remove it */
489  Catalog->ItemCount--;
490  WsNcEntryDereference(CatalogEntry);
491  }
492 }
struct _Entry Entry
Definition: kefuncs.h:640
VOID WSAAPI WsNcEntryDereference(IN PNSCATALOG_ENTRY CatalogEntry)
Definition: nscatent.c:53
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
#define InsertTailList(ListHead, Entry)
LIST_ENTRY CatalogLink
Definition: ws2_32p.h:123
Definition: ws2_32p.h:121
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
LIST_ENTRY List
Definition: psmgr.c:57
Definition: typedefs.h:117
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
GUID ProviderId
Definition: ws2_32p.h:132
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
base of all file and directory entries
Definition: entries.h:82

Referenced by WsNcRefreshFromRegistry().

◆ WSNoteSuccessfulHostentLookup()

VOID WSAAPI WSNoteSuccessfulHostentLookup ( IN CONST CHAR FAR Name,
IN CONST ULONG  Address 
)

Definition at line 119 of file winsock.c.

121 {
122  AUTODIAL_ADDR AutodialAddress;
123  AUTODIAL_CONN AutodialConnection;
124 
125  /* Make sure there actually is a name */
126  if (!(Name) || !strlen(Name)) return;
127 
128  /* Setup the Address */
129  AutodialAddress.Family = AutoDialIpHost;
130  strcpy(AutodialAddress.HostName, Name);
131 
132  /* Setup the new connection */
133  AutodialConnection.Family = ConnectionIp;
134  AutodialConnection.Ip4Address = Address;
135  AcsHlpNoteNewConnection(&AutodialAddress, &AutodialConnection);
136 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
ULONG Ip4Address
Definition: precomp.h:71
CHAR HostName[INTERNET_MAX_PATH_LENGTH]
Definition: precomp.h:61
static WCHAR Address[46]
Definition: ping.c:68
BOOLEAN WINAPI AcsHlpNoteNewConnection(IN PAUTODIAL_ADDR ConnectionAddress, IN PAUTODIAL_CONN Connection)
Definition: autodial.c:108
AUTODIAL_FAMILY Family
Definition: precomp.h:55
CONNECTION_FAMILY Family
Definition: precomp.h:67
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by gethostbyname().

◆ WsNpAllocate()

PNS_PROVIDER WSAAPI WsNpAllocate ( VOID  )

Definition at line 63 of file nsprovid.c.

64 {
66 
67  /* Allocate the object */
69  if (Provider)
70  {
71  /* Set non-null data */
72  Provider->RefCount = 1;
73  Provider->Service.cbSize = sizeof(NSP_ROUTINE);
74  }
75 
76  /* Return it */
77  return Provider;
78 }
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
struct _NSP_ROUTINE NSP_ROUTINE
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HANDLE WsSockHeap
Definition: dllmain.c:21

Referenced by WsNcLoadProvider().

◆ WsNpDelete()

VOID WSAAPI WsNpDelete ( IN PNS_PROVIDER  Provider)

Definition at line 161 of file nsprovid.c.

162 {
163  /* Make sure we have a loaded handle */
164  if (Provider->DllHandle)
165  {
166  /* Clean us up */
168 
169  /* Unload the library */
170  FreeLibrary(Provider->DllHandle);
171  Provider->DllHandle = NULL;
172  }
173 
174  /* Delete us */
176 }
DWORD WSAAPI WsNpNSPCleanup(IN PNS_PROVIDER Provider)
Definition: nsprovid.c:140
smooth NULL
Definition: ftsmooth.c:416
#define FreeLibrary(x)
Definition: compat.h:413
HANDLE WsSockHeap
Definition: dllmain.c:21
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by WsNpDereference().

◆ WsNpDereference()

VOID WSAAPI WsNpDereference ( IN PNS_PROVIDER  Provider)

Definition at line 180 of file nsprovid.c.

181 {
182  /* Decrease the reference count and check if it's zero */
183  if (!InterlockedDecrement(&Provider->RefCount))
184  {
185  /* Delete us*/
187  }
188 }
#define InterlockedDecrement
Definition: armddk.h:52
VOID WSAAPI WsNpDelete(IN PNS_PROVIDER Provider)
Definition: nsprovid.c:161

Referenced by WsNcEntryDelete(), WsNcLoadProvider(), and WsNqProvDelete().

◆ WsNpInitialize()

DWORD WSAAPI WsNpInitialize ( IN PNS_PROVIDER  Provider,
IN LPWSTR  DllPath,
IN LPGUID  ProviderGuid 
)

Definition at line 82 of file nsprovid.c.

85 {
87  LPNSPSTARTUP NSPStartupProc;
88  CHAR AnsiPath[MAX_PATH], ExpandedDllPath[MAX_PATH];
89 
90  /* Convert the path to ANSI */
92  0,
93  DllName,
94  -1,
95  AnsiPath,
96  MAX_PATH,
97  NULL,
98  NULL);
99 
100  /* Expand the DLL Path */
101  ExpandEnvironmentStringsA(AnsiPath,
102  ExpandedDllPath,
103  MAX_PATH);
104 
105  /* Load the DLL */
106  Provider->DllHandle = LoadLibraryA(ExpandedDllPath);
107  if (!Provider->DllHandle)
108  {
109  /* Fail */
111  goto Fail;
112  }
113 
114  /* Get the pointer to NSPStartup */
115  NSPStartupProc = (LPNSPSTARTUP)GetProcAddress(Provider->DllHandle,
116  "NSPStartup");
117  if (!NSPStartupProc)
118  {
119  /* Fail */
121  goto Fail;
122  }
123 
124  /* Call it */
125  (*NSPStartupProc)(ProviderId, &Provider->Service);
126 
127  /* Save the provider ID */
128  Provider->ProviderId = *ProviderId;
129  return ErrorCode;
130 
131 Fail:
132  /* Bail out */
133  if (Provider->DllHandle) FreeLibrary(Provider->DllHandle);
134  Provider->DllHandle = NULL;
135  return ErrorCode;
136 }
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
int32_t INT
Definition: typedefs.h:56
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
Definition: environ.c:399
#define FreeLibrary(x)
Definition: compat.h:413
#define MAX_PATH
Definition: compat.h:26
Definition: hiveinit.c:368
_Must_inspect_result_ INT(WSAAPI * LPNSPSTARTUP)(_In_ LPGUID lpProviderId, _Inout_ LPNSP_ROUTINE lpnspRoutines)
Definition: ws2spi.h:671
#define WSAEPROVIDERFAILEDINIT
Definition: winerror.h:1993
#define GetProcAddress(x, y)
Definition: compat.h:418

Referenced by WsNcLoadProvider().

◆ WsNpLookupServiceBegin()

DWORD WSAAPI WsNpLookupServiceBegin ( IN PNS_PROVIDER  Provider,
IN LPWSAQUERYSETW  Restrictions,
struct _WSAServiceClassInfoW ,
IN DWORD  ControlFlags,
OUT PHANDLE  LookupHandle 
)

◆ WsNpLookupServiceEnd()

DWORD WSAAPI WsNpLookupServiceEnd ( IN PNS_PROVIDER  Provider,
IN HANDLE  LookupHandle 
)

Definition at line 231 of file nsprovid.c.

233 {
234  /* Call the NSP */
235  return Provider->Service.NSPLookupServiceEnd(LookupHandle);
236 }

Referenced by WsNqProvLookupServiceEnd().

◆ WsNpLookupServiceNext()

DWORD WSAAPI WsNpLookupServiceNext ( IN PNS_PROVIDER  Provider,
IN HANDLE  LookupHandle,
IN DWORD  ControlFlags,
OUT PDWORD  BufferLength,
OUT LPWSAQUERYSETW  Results 
)

Definition at line 240 of file nsprovid.c.

245 {
246  /* Call the NSP */
247  return Provider->Service.NSPLookupServiceNext(LookupHandle,
248  ControlFlags,
249  BufferLength,
250  Results);
251 }
_In_ ULONG BufferLength
Definition: usbdlib.h:225

Referenced by WsNqProvLookupServiceNext().

◆ WsNpNSPCleanup()

DWORD WSAAPI WsNpNSPCleanup ( IN PNS_PROVIDER  Provider)

Definition at line 140 of file nsprovid.c.

141 {
143  LPNSPCLEANUP lpNSPCleanup = NULL;
144 
145  /* Make sure we have a loaded handle */
146  if (Provider->DllHandle)
147  {
148  /* Get the pointer and clear it */
149  lpNSPCleanup = InterlockedExchangePointer((PVOID*)&Provider->Service.NSPCleanup,
150  NULL);
151  /* If it's not NULL, call it */
152  if (lpNSPCleanup) ErrorCode = lpNSPCleanup(&Provider->ProviderId);
153  }
154 
155  /* Return */
156  return ErrorCode;
157 }
INT(WSAAPI * LPNSPCLEANUP)(_In_ LPGUID lpProviderId)
Definition: ws2spi.h:494
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45

Referenced by CleanupNamespaceProviders(), and WsNpDelete().

◆ WsNqAddProvider()

BOOL WSAAPI WsNqAddProvider ( IN PNSQUERY  NsQuery,
IN PNS_PROVIDER  Provider 
)

Definition at line 552 of file nsquery.c.

554 {
555  BOOL Success = TRUE;
556  PNSQUERY_PROVIDER QueryProvider;
557 
558  /* Allocate a new Query Provider */
559  if ((QueryProvider = WsNqProvAllocate()))
560  {
561  /* Initialize it */
562  WsNqProvInitialize(QueryProvider, Provider);
563 
564  /* Insert it into the provider list */
565  InsertTailList(&Query->ProviderList, &QueryProvider->QueryLink);
566  }
567  else
568  {
569  /* We failed */
571  Success = FALSE;
572  }
573 
574  /* Return */
575  return Success;
576 }
#define TRUE
Definition: types.h:120
#define InsertTailList(ListHead, Entry)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SetLastError(x)
Definition: compat.h:417
BOOL Query(LPCTSTR *ServiceArgs, DWORD ArgCount, BOOL bExtended)
Definition: query.c:292
LIST_ENTRY QueryLink
Definition: ws2_32p.h:116
#define WSASYSCALLFAILURE
Definition: winerror.h:1994
PNSQUERY_PROVIDER WSAAPI WsNqProvAllocate(VOID)
Definition: nsprovid.c:17
DWORD WSAAPI WsNqProvInitialize(IN PNSQUERY_PROVIDER QueryProvider, IN PNS_PROVIDER Provider)
Definition: nsprovid.c:30

Referenced by WsNqBeginEnumerationProc(), and WsNqLookupServiceBegin().

◆ WsNqAllocate()

PNSQUERY WSAAPI WsNqAllocate ( VOID  )

Definition at line 22 of file nsquery.c.

23 {
24  PNSQUERY NsQuery;
25 
26  /* Allocate the object */
27  NsQuery = HeapAlloc(WsSockHeap, HEAP_ZERO_MEMORY, sizeof(*NsQuery));
28  if (NsQuery)
29  {
30  /* Set non-zero fields */
31  NsQuery->Signature = ~0xBEADFACE;
33  NsQuery->TryAgain = TRUE;
34  }
35 
36  /* Return it */
37  return NsQuery;
38 }
#define TRUE
Definition: types.h:120
DWORD TryAgain
Definition: ws2_32p.h:157
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LIST_ENTRY ProviderList
Definition: ws2_32p.h:150
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HANDLE WsSockHeap
Definition: dllmain.c:21
DWORD Signature
Definition: ws2_32p.h:147

Referenced by WSALookupServiceBeginW().

◆ WsNqBeginEnumerationProc()

BOOL WSAAPI WsNqBeginEnumerationProc ( PVOID  Context,
PNSCATALOG_ENTRY  CatalogEntry 
)

Definition at line 117 of file nsquery.c.

119 {
121  BOOLEAN GoOn = TRUE;
122  PENUM_CONTEXT EnumContext = (PENUM_CONTEXT)Context;
123  PNSQUERY NsQuery = EnumContext->NsQuery;
124  DWORD NamespaceId = Entry->NamespaceId;
125 
126  /* Match the namespace ID, protocols and make sure it's enabled */
127  if ((((EnumContext->lpqsRestrictions->dwNameSpace == NamespaceId) ||
128  (EnumContext->lpqsRestrictions->dwNameSpace == NS_ALL)) &&
129  (!(EnumContext->lpqsRestrictions->dwNumberOfProtocols) ||
130  (WsNcMatchProtocols(NamespaceId,
131  Entry->AddressFamily,
132  EnumContext->lpqsRestrictions)))) &&
133  (Entry->Enabled))
134  {
135  /* Get the provider */
136  if (!(Provider = Entry->Provider))
137  {
138  /* None was loaded, load it */
139  if (WsNcLoadProvider(EnumContext->Catalog, Entry) != ERROR_SUCCESS)
140  {
141  /* Return TRUE to continue enumerating */
142  return TRUE;
143  }
144 
145  /* Set the provider */
146  Provider = Entry->Provider;
147  }
148 
149  /* Add it to the query */
150  if (!WsNqAddProvider(NsQuery, Provider))
151  {
152  /* We failed */
153  EnumContext->ErrorCode = WSASYSCALLFAILURE;
154  GoOn = FALSE;
155  }
156  }
157 
158  /* Return to caller */
159  return GoOn;
160 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
PNSCATALOG Catalog
Definition: ws2_32p.h:211
LPWSAQUERYSETW lpqsRestrictions
Definition: ws2_32p.h:208
BOOL WSAAPI WsNqAddProvider(IN PNSQUERY Query, IN PNS_PROVIDER Provider)
Definition: nsquery.c:552
struct _ENUM_CONTEXT * PENUM_CONTEXT
unsigned char BOOLEAN
PNSQUERY NsQuery
Definition: ws2_32p.h:210
#define NS_ALL
Definition: nspapi.h:8
INT WSAAPI WsNcLoadProvider(IN PNSCATALOG Catalog, IN PNSCATALOG_ENTRY CatalogEntry)
Definition: nscatalo.c:379
INT ErrorCode
Definition: ws2_32p.h:209
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WSASYSCALLFAILURE
Definition: winerror.h:1994
BOOL WSAAPI WsNcMatchProtocols(IN DWORD NameSpace, IN LONG AddressFamily, IN LPWSAQUERYSETW QuerySet)
Definition: nscatalo.c:540
base of all file and directory entries
Definition: entries.h:82

Referenced by WsNqLookupServiceBegin().

◆ WsNqDelete()

VOID WSAAPI WsNqDelete ( IN PNSQUERY  NsQuery)

Definition at line 74 of file nsquery.c.

75 {
78 
79  /* Make sure that we got initialized */
80  if (!NsQuery->ProviderList.Flink) return;
81 
82  /* Loop the provider list */
83  while (!IsListEmpty(&NsQuery->ProviderList))
84  {
85  /* Remove the entry */
86  Entry = RemoveHeadList(&NsQuery->ProviderList);
87 
88  /* Get the provider */
90 
91  /* Delete it */
93  }
94 
95  /* Remove the signature and delete the lock */
96  NsQuery->Signature = ~0xBEADFACE;
97  DeleteCriticalSection(&NsQuery->Lock);
98 
99  /* Free us */
100  HeapFree(WsSockHeap, 0, NsQuery);
101 }
struct _Entry Entry
Definition: kefuncs.h:640
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
VOID WSAAPI WsNqProvDelete(IN PNSQUERY_PROVIDER QueryProvider)
Definition: nsprovid.c:45
Definition: typedefs.h:117
HANDLE WsSockHeap
Definition: dllmain.c:21
#define HeapFree(x, y, z)
Definition: compat.h:402
base of all file and directory entries
Definition: entries.h:82

Referenced by WSALookupServiceBeginW(), and WsNqDereference().

◆ WsNqDereference()

VOID WSAAPI WsNqDereference ( IN PNSQUERY  Query)

Definition at line 105 of file nsquery.c.

106 {
107  /* Decrease the reference count and check if it's zero */
108  if (!InterlockedDecrement(&Query->RefCount))
109  {
110  /* Delete us*/
111  WsNqDelete(Query);
112  }
113 }
BOOL Query(LPCTSTR *ServiceArgs, DWORD ArgCount, BOOL bExtended)
Definition: query.c:292
#define InterlockedDecrement
Definition: armddk.h:52
VOID WSAAPI WsNqDelete(IN PNSQUERY NsQuery)
Definition: nsquery.c:74

Referenced by WSALookupServiceEnd(), and WSALookupServiceNextW().

◆ WsNqInitialize()

DWORD WSAAPI WsNqInitialize ( IN PNSQUERY  NsQuery)

Definition at line 42 of file nsquery.c.

43 {
44  /* Initialize the lock */
46 
47  /* Set initial reference count and signature */
48  Query->RefCount = 1;
49  Query->Signature = 0xBEADFACE;
50 
51  /* Return success */
52  return ERROR_SUCCESS;
53 }
#define ERROR_SUCCESS
Definition: deptool.c:10
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
BOOL Query(LPCTSTR *ServiceArgs, DWORD ArgCount, BOOL bExtended)
Definition: query.c:292

Referenced by WSALookupServiceBeginW().

◆ WsNqLookupServiceBegin()

DWORD WSAAPI WsNqLookupServiceBegin ( IN PNSQUERY  NsQuery,
IN LPWSAQUERYSETW  QuerySet,
IN DWORD  ControlFlags,
IN PNSCATALOG  Catalog 
)

Definition at line 347 of file nsquery.c.

351 {
352  WSASERVICECLASSINFOW ClassInfo;
353  LPWSASERVICECLASSINFOW pClassInfo = &ClassInfo;
354  PNSQUERY_PROVIDER Provider, NextProvider;
356  INT ErrorCode;
357  DWORD ClassInfoSize;
358  PNSCATALOG_ENTRY CatalogEntry = NULL;
359  ENUM_CONTEXT EnumContext;
361 
362  /* Check for RAS Auto-dial attempt */
363  if (NsQuery->TryAgain)
364  {
365  /* Make a copy of the query set */
366  ErrorCode = CopyQuerySetW(Restrictions, &NsQuery->QuerySet);
368 
369  /* Check if we'll try again */
370  if (!TryAgain)
371  {
372  /* We won't, fail */
375  NsQuery->TryAgain = FALSE;
376  goto Exit;
377  }
378 
379  /* Cache the information for a restart */
380  NsQuery->ControlFlags = ControlFlags;
381  NsQuery->Catalog = Catalog;
382  }
383 
384  /* Check if we have a specific ID */
385  if (Restrictions->lpNSProviderId)
386  {
387  /* Get the catalog entry */
389  Restrictions->lpNSProviderId,
390  &CatalogEntry);
391  /* Check for failure */
392  if (ErrorCode != ERROR_SUCCESS)
393  {
394  /* Fail */
397  goto Exit;
398  }
399  /* We succeeded, add this provider */
400  else if (!WsNqAddProvider(NsQuery, CatalogEntry->Provider))
401  {
402  /* Fail */
405  goto Exit;
406  }
407  }
408  else
409  {
410  /* Setup the lookup context */
411  EnumContext.lpqsRestrictions = Restrictions;
412  EnumContext.ErrorCode = ERROR_SUCCESS;
413  EnumContext.NsQuery = NsQuery;
414  EnumContext.Catalog = Catalog;
415 
416  /* Do a lookup for every entry */
419  &EnumContext);
420  ErrorCode = EnumContext.ErrorCode;
421 
422  /* Check for success */
423  if (ErrorCode != ERROR_SUCCESS)
424  {
425  /* Fail */
428  goto Exit;
429  }
430  }
431 
432  /* Get the class information */
433  ClassInfo.lpServiceClassId = Restrictions->lpServiceClassId;
434  ErrorCode = WsNcGetServiceClassInfo(Catalog, &ClassInfoSize, pClassInfo);
435 
436  /* Check if more buffer space is needed */
437  if ((ErrorCode == SOCKET_ERROR) && (GetLastError() == WSAEFAULT))
438  {
439  /* FIXME: The WS 2.2 spec hasn't been finalized yet on this... */
440  }
441  else
442  {
443  /* Assume success */
445  }
446 
447  /* Check if the provider list is empty */
448  if (IsListEmpty(&NsQuery->ProviderList))
449  {
450  /* We don't have any providers to handle this! */
453  goto Exit;
454  }
455 
456  /* Get the first provider and loop */
457  Entry = NsQuery->ProviderList.Flink;
458  NextProvider = CONTAINING_RECORD(Entry, NSQUERY_PROVIDER, QueryLink);
459  while (NextProvider)
460  {
461  /* Call it */
462  ErrorCode = WsNqProvLookupServiceBegin(NextProvider,
463  Restrictions,
464  pClassInfo,
465  ControlFlags);
466  /* Check for error */
467  if (ErrorCode == SOCKET_ERROR)
468  {
469  /* Remove this provider, get the next one, delete the old one */
470  Provider = NextProvider;
471  NextProvider = WsNqNextProvider(NsQuery, NextProvider);
472  RemoveEntryList(&Provider->QueryLink);
474  }
475  else
476  {
477  /* Get the next provider */
478  NextProvider = WsNqNextProvider(NsQuery, NextProvider);
479  }
480  }
481 
482 Exit:
483  /* Check if we had an error somewhere */
484  if (ErrorCode == SOCKET_ERROR)
485  {
486  /* Loop the list */
487  while (!IsListEmpty(&NsQuery->ProviderList))
488  {
489  /* Remove this provider */
490  Entry = RemoveHeadList(&NsQuery->ProviderList);
491 
492  /* Get the failed provider and delete it */
495  }
496  }
497  else
498  {
499  /* Set the active provider */
500  Entry = NsQuery->ProviderList.Flink;
501  NsQuery->ActiveProvider = CONTAINING_RECORD(Entry,
503  QueryLink);
504  }
505 
506  /* Return */
507  return ErrorCode;
508 }
#define SOCKET_ERROR
Definition: winsock.h:333
#define WSAEFAULT
Definition: winerror.h:1945
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _Entry Entry
Definition: kefuncs.h:640
#define WSASERVICE_NOT_FOUND
Definition: winerror.h:1995
PNSCATALOG Catalog
Definition: ws2_32p.h:211
#define WSAEINVAL
Definition: winerror.h:1946
INT WSAAPI WsNcGetCatalogFromProviderId(IN PNSCATALOG Catalog, IN LPGUID ProviderId, OUT PNSCATALOG_ENTRY *CatalogEntry)
Definition: nscatalo.c:496
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
Definition: ws2_32p.h:121
int32_t INT
Definition: typedefs.h:56
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
LPWSAQUERYSETW lpqsRestrictions
Definition: ws2_32p.h:208
BOOL WSAAPI WsNqAddProvider(IN PNSQUERY Query, IN PNS_PROVIDER Provider)
Definition: nsquery.c:552
Definition: bl.h:897
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
PNSQUERY NsQuery
Definition: ws2_32p.h:210
PNSQUERY_PROVIDER WSAAPI WsNqNextProvider(IN PNSQUERY Query, IN PNSQUERY_PROVIDER Provider)
Definition: nsquery.c:512
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
BOOL WSAAPI WsNqBeginEnumerationProc(PVOID Context, PNSCATALOG_ENTRY Entry)
Definition: nsquery.c:117
DWORD WSAAPI WsNqProvLookupServiceBegin(IN PNSQUERY_PROVIDER QueryProvider, IN LPWSAQUERYSETW QuerySet, IN LPWSASERVICECLASSINFOW ServiceClassInfo, IN DWORD)
Definition: nsprovid.c:216
INT ErrorCode
Definition: ws2_32p.h:209
static void Exit(void)
Definition: sock.c:1331
PNS_PROVIDER Provider
Definition: ws2_32p.h:125
INT WSAAPI CopyQuerySetW(IN LPWSAQUERYSETW UnicodeSet, OUT LPWSAQUERYSETW *UnicodeCopy)
Definition: qshelpr.c:1050
unsigned long DWORD
Definition: ntddk_ex.h:95
VOID WSAAPI WsNqProvDelete(IN PNSQUERY_PROVIDER QueryProvider)
Definition: nsprovid.c:45
#define SetLastError(x)
Definition: compat.h:417
#define WSA_NOT_ENOUGH_MEMORY
Definition: winsock2.h:593
Definition: typedefs.h:117
VOID WSAAPI WsNcEnumerateCatalogItems(IN PNSCATALOG Catalog, IN PNSCATALOG_ENUMERATE_PROC Callback, IN PVOID Context)
Definition: nscatalo.c:350
INT WSAAPI WsNcGetServiceClassInfo(IN PNSCATALOG Catalog, IN OUT LPDWORD BugSize, IN OUT LPWSASERVICECLASSINFOW lpServiceClassInfo)
Definition: nscatalo.c:423
base of all file and directory entries
Definition: entries.h:82

Referenced by WSALookupServiceBeginW(), and WsNqLookupServiceNext().

◆ WsNqLookupServiceEnd()

DWORD WSAAPI WsNqLookupServiceEnd ( IN PNSQUERY  NsQuery)

Definition at line 164 of file nsquery.c.

165 {
168 
169  /* Protect us from closure */
170  WsNqLock();
171  NsQuery->ShuttingDown = TRUE;
172 
173  /* Get the list and loop */
174  Entry = NsQuery->ProviderList.Flink;
175  while (Entry != &NsQuery->ProviderList)
176  {
177  /* Get the provider */
179 
180  /* Call its routine */
182 
183  /* Move to the next one */
184  Entry = Entry->Flink;
185  }
186 
187  /* Release lock and return success */
188  WsNqUnlock();
189  return ERROR_SUCCESS;
190 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _Entry Entry
Definition: kefuncs.h:640
#define WsNqUnlock()
Definition: nsquery.c:16
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define WsNqLock()
Definition: nsquery.c:15
Definition: typedefs.h:117
DWORD WSAAPI WsNqProvLookupServiceEnd(IN PNSQUERY_PROVIDER QueryProvider)
Definition: nsprovid.c:192
base of all file and directory entries
Definition: entries.h:82

Referenced by WSALookupServiceEnd().

◆ WsNqLookupServiceNext()

DWORD WSAAPI WsNqLookupServiceNext ( PNSQUERY  NsQuery,
DWORD  ,
PDWORD  ,
OUT LPWSAQUERYSETW  QuerySet 
)

Referenced by WSALookupServiceNextW().

◆ WsNqNextProvider()

PNSQUERY_PROVIDER WSAAPI WsNqNextProvider ( PNSQUERY  NsQuery,
IN PNSQUERY_PROVIDER  Provider 
)

◆ WsNqPreviousProvider()

PNSQUERY_PROVIDER WSAAPI WsNqPreviousProvider ( IN PNSQUERY  Query,
IN PNSQUERY_PROVIDER  Provider 
)

Definition at line 532 of file nsquery.c.

534 {
535  PNSQUERY_PROVIDER PrevProvider = NULL;
537 
538  /* Get the last entry and get its provider */
539  Entry = Provider->QueryLink.Blink;
540  if (Entry != &Query->ProviderList)
541  {
542  /* Get the current provider */
543  PrevProvider = CONTAINING_RECORD(Entry, NSQUERY_PROVIDER, QueryLink);
544  }
545 
546  /* Return it */
547  return PrevProvider;
548 }
struct _Entry Entry
Definition: kefuncs.h:640
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
BOOL Query(LPCTSTR *ServiceArgs, DWORD ArgCount, BOOL bExtended)
Definition: query.c:292
Definition: typedefs.h:117
base of all file and directory entries
Definition: entries.h:82

Referenced by WsNqLookupServiceNext().

◆ WsNqProvAllocate()

PNSQUERY_PROVIDER WSAAPI WsNqProvAllocate ( VOID  )

Definition at line 17 of file nsprovid.c.

18 {
20 
21  /* Allocate the object */
23 
24  /* Return it */
25  return Provider;
26 }
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HANDLE WsSockHeap
Definition: dllmain.c:21

Referenced by WsNqAddProvider().

◆ WsNqProvDelete()

VOID WSAAPI WsNqProvDelete ( IN PNSQUERY_PROVIDER  QueryProvider)

Definition at line 45 of file nsprovid.c.

46 {
47  /* Check if we have a provider */
48  if (QueryProvider->Provider)
49  {
50  /* Dereference it */
51  WsNpDereference(QueryProvider->Provider);
52 
53  /* Clear it */
54  QueryProvider->Provider = NULL;
55  }
56 
57  /* Delete us */
58  HeapFree(WsSockHeap, 0, QueryProvider);
59 }
smooth NULL
Definition: ftsmooth.c:416
VOID WSAAPI WsNpDereference(IN PNS_PROVIDER Provider)
Definition: nsprovid.c:180
HANDLE WsSockHeap
Definition: dllmain.c:21
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by WsNqDelete(), WsNqLookupServiceBegin(), and WsNqLookupServiceNext().

◆ WsNqProvInitialize()

DWORD WSAAPI WsNqProvInitialize ( IN PNSQUERY_PROVIDER  QueryProvider,
IN PNS_PROVIDER  Provider 
)

Definition at line 30 of file nsprovid.c.

32 {
33  /* Reference the provider */
34  InterlockedIncrement(&Provider->RefCount);
35 
36  /* Set it as our own */
37  QueryProvider->Provider = Provider;
38 
39  /* Return success */
40  return ERROR_SUCCESS;
41 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by WsNqAddProvider().

◆ WsNqProvLookupServiceBegin()

DWORD WSAAPI WsNqProvLookupServiceBegin ( IN PNSQUERY_PROVIDER  QueryProvider,
IN LPWSAQUERYSETW  QuerySet,
IN LPWSASERVICECLASSINFOW  ServiceClassInfo,
IN  DWORD 
)

Definition at line 216 of file nsprovid.c.

220 {
221  /* Simply call the provider */
222  return WsNpLookupServiceBegin(QueryProvider->Provider,
223  Restrictions,
224  ServiceClassInfo,
225  ControlFlags,
226  &QueryProvider->LookupHandle);
227 }
DWORD WSAAPI WsNpLookupServiceBegin(IN PNS_PROVIDER Provider, IN LPWSAQUERYSETW Restrictions, IN LPWSASERVICECLASSINFOW ServiceClassInfo, IN DWORD ControlFlags, OUT PHANDLE LookupHandle)
Definition: nsprovid.c:255

Referenced by WsNqLookupServiceBegin().

◆ WsNqProvLookupServiceEnd()

DWORD WSAAPI WsNqProvLookupServiceEnd ( IN PNSQUERY_PROVIDER  QueryProvider)

Definition at line 192 of file nsprovid.c.

193 {
194  /* Simply call the provider */
195  return WsNpLookupServiceEnd(QueryProvider->Provider,
196  QueryProvider->LookupHandle);
197 }
DWORD WSAAPI WsNpLookupServiceEnd(IN PNS_PROVIDER Provider, IN HANDLE LookupHandle)
Definition: nsprovid.c:231

Referenced by WsNqLookupServiceEnd(), and WsNqLookupServiceNext().

◆ WsNqProvLookupServiceNext()

DWORD WSAAPI WsNqProvLookupServiceNext ( IN PNSQUERY_PROVIDER  QueryProvider,
DWORD  ,
PDWORD  ,
LPWSAQUERYSETW  QuerySet 
)

Referenced by WsNqLookupServiceNext().

◆ WsNqValidateAndReference()

BOOL WSAAPI WsNqValidateAndReference ( IN PNSQUERY  Query)

Definition at line 57 of file nsquery.c.

58 {
59  /* Check the signature first */
60  if (Query->Signature != 0xBEADFACE) return FALSE;
61 
62  /* Validate the reference count */
63  if (!Query->RefCount) return FALSE;
64 
65  /* Increase reference count */
66  InterlockedIncrement(&Query->RefCount);
67 
68  /* Return success */
69  return TRUE;
70 }
#define TRUE
Definition: types.h:120
BOOL Query(LPCTSTR *ServiceArgs, DWORD ArgCount, BOOL bExtended)
Definition: query.c:292
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by WSALookupServiceEnd(), and WSALookupServiceNextW().

◆ WsOpenRegistryRoot()

HKEY WSAAPI WsOpenRegistryRoot ( VOID  )

Definition at line 17 of file wsautil.c.

18 {
19  HKEY WinsockRootKey;
20  INT ErrorCode;
22 
23  /* Open Registry Key */
26  0,
28  &WinsockRootKey);
29 
30  /* Check if it wasn't found */
32  {
33  /* Create it */
36  0,
37  NULL,
40  NULL,
41  &WinsockRootKey,
43  }
44  else if (ErrorCode == ERROR_SUCCESS)
45  {
46  /* It already exists */
48  }
49 
50  /* Check for failure */
51  if (ErrorCode != ERROR_SUCCESS) return NULL;
52 
53  /* Check if we had to create a new key */
55  {
56  /* Write the Winsock Version */
57  RegSetValueEx(WinsockRootKey,
58  "WinSock_Registry_Version",
59  0,
60  REG_SZ,
61  (BYTE*)"2.2",
62  4);
63  }
64  else
65  {
66  /* Read the Winsock Version */
67  }
68 
69  /* Return the key */
70  return WinsockRootKey;
71 }
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
#define REG_OPENED_EXISTING_KEY
Definition: nt_native.h:1085
int32_t INT
Definition: typedefs.h:56
#define WINSOCK_ROOT
Definition: ws2_32p.h:10
smooth NULL
Definition: ftsmooth.c:416
#define REG_CREATED_NEW_KEY
Definition: nt_native.h:1084
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
unsigned char BYTE
Definition: mem.h:68
#define RegOpenKeyEx
Definition: winreg.h:520
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
unsigned int ULONG
Definition: retypes.h:1
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT _In_ ULONG CreateDisposition
Definition: create.c:4157
#define RegSetValueEx
Definition: winreg.h:533
#define RegCreateKeyEx
Definition: winreg.h:501
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by OpenInitializedCatalog(), WsProcInitialize(), and WsRasLoadHelperDll().

◆ WsProcDelete()

VOID WSAAPI WsProcDelete ( IN PWSPROCESS  Process)

Definition at line 247 of file dprocess.c.

248 {
249  /* Check if we didn't even initialize yet */
250  if (!Process->LockReady) return;
251 
252  /* No more current process */
254 
255  /* If we have a socket table */
256  if (WsSockHandleTable)
257  {
258  /* Enumerate the sockets with a delete callback */
261  Process);
262  }
263 
264  /* Close APC Helper */
265  if (Process->ApcHelper) WahCloseApcHelper(Process->ApcHelper);
266 
267  /* Close handle helper */
268  if (Process->HandleHelper) WahCloseHandleHelper(Process->HandleHelper);
269 
270  /* Check for notification helper */
271  if (Process->NotificationHelper)
272  {
273  /* Close notification helper */
274  WahCloseNotificationHandleHelper(Process->NotificationHelper);
275  }
276 
277  /* Check if we have a protocol catalog*/
278  if (Process->ProtocolCatalog)
279  {
280  /* Enumerate it to clean it up */
281  WsTcEnumerateCatalogItems(Process->ProtocolCatalog,
283  NULL);
284 
285  /* Delete it */
286  WsTcDelete(Process->ProtocolCatalog);
287  Process->ProtocolCatalog = NULL;
288  }
289 
290  /* Check if we have a namespace catalog*/
291  if (Process->NamespaceCatalog)
292  {
293  /* Enumerate it to clean it up */
294  WsNcEnumerateCatalogItems(Process->NamespaceCatalog,
296  NULL);
297 
298  /* Delete it */
299  WsNcDelete(Process->NamespaceCatalog);
300  Process->NamespaceCatalog = NULL;
301  }
302 
303  /* Delete the thread lock */
304  DeleteCriticalSection(&Process->ThreadLock);
305 
306  /* Delete us */
308 }
VOID WSAAPI WsTcDelete(IN PTCATALOG Catalog)
Definition: dcatalog.c:862
PWSPROCESS CurrentWsProcess
Definition: dprocess.c:15
DWORD WINAPI WahCloseApcHelper(IN HANDLE ApcHelperHandle)
Definition: apc.c:42
BOOL WSAAPI CleanupProtocolProviders(IN PVOID Callback, IN PTCATALOG_ENTRY Entry)
Definition: dprocess.c:227
smooth NULL
Definition: ftsmooth.c:416
BOOL WSAAPI WsSockDeleteSockets(IN LPVOID Context, IN PWAH_HANDLE Handle)
Definition: dsocket.c:180
DWORD WINAPI WahCloseHandleHelper(IN HANDLE HelperHandle)
Definition: handle.c:86
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
PWAH_HANDLE_TABLE WsSockHandleTable
Definition: dsocket.c:15
BOOL WINAPI WahEnumerateHandleContexts(IN PWAH_HANDLE_TABLE Table, IN PWAH_HANDLE_ENUMERATE_PROC Callback, IN PVOID Context)
Definition: context.c:280
VOID WSAAPI WsTcEnumerateCatalogItems(IN PTCATALOG Catalog, IN PTCATALOG_ENUMERATE_PROC Callback, IN PVOID Context)
Definition: dcatalog.c:729
VOID WSAAPI WsNcEnumerateCatalogItems(IN PNSCATALOG Catalog, IN PNSCATALOG_ENUMERATE_PROC Callback, IN PVOID Context)
Definition: nscatalo.c:350
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
VOID WSAAPI WsNcDelete(IN PNSCATALOG Catalog)
Definition: nscatalo.c:603
BOOL WSAAPI CleanupNamespaceProviders(IN PVOID Callback, IN PNSCATALOG_ENTRY Entry)
Definition: dprocess.c:208
DWORD WINAPI WahCloseNotificationHandleHelper(IN HANDLE HelperHandle)
Definition: notify.c:22
HANDLE WsSockHeap
Definition: dllmain.c:21
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by DllMain(), and WSACleanup().

◆ WsProcDetachSocket()

BOOL WSAAPI WsProcDetachSocket ( IN PWSPROCESS  Process,
IN PWAH_HANDLE  Handle 
)

Definition at line 182 of file dprocess.c.

184 {
185  PWSSOCKET Socket = (PWSSOCKET)Handle;
186 
187  /* Disassociate this socket from the table */
189 
190  /* If this is isn't an IFS socket */
191  if (!Socket->Provider)
192  {
193  /* Check if we have an active handle helper */
194  if (Process->HandleHelper)
195  {
196  /* Close it */
197  WahCloseSocketHandle(Process->HandleHelper, (SOCKET)Socket->Handle);
198  }
199  }
200 
201  /* Remove a reference and return */
202  WsSockDereference(Socket);
203  return TRUE;
204 }
#define TRUE
Definition: types.h:120
HANDLE Handle
Definition: ws2_32p.h:197
VOID WSAAPI WsSockDereference(IN PWSSOCKET Socket)
Definition: dsocket.c:205
DWORD WINAPI WahRemoveHandleContext(IN PWAH_HANDLE_TABLE Table, IN PWAH_HANDLE Handle)
Definition: context.c:564
DWORD WINAPI WahCloseSocketHandle(IN HANDLE HelperHandle, IN SOCKET Socket)
Definition: handle.c:113
_In_ HANDLE Handle
Definition: extypes.h:390
PTPROVIDER Provider
Definition: ws2_32p.h:199
PWAH_HANDLE_TABLE WsSockHandleTable
Definition: dsocket.c:15
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
UINT_PTR SOCKET
Definition: winsock.h:47
struct _WSSOCKET * PWSSOCKET

Referenced by WsSockDeleteSockets().

◆ WsProcGetAsyncHelper()

INT WSAAPI WsProcGetAsyncHelper ( IN PWSPROCESS  Process,
OUT PHANDLE  Handle 
)

Definition at line 107 of file dprocess.c.

109 {
110  /* Check if we have it already set up */
111  if (Process->ApcHelper)
112  {
113  /* Just return it */
114  *Handle = Process->ApcHelper;
115  return ERROR_SUCCESS;
116  }
117  else
118  {
119  /* Open it for the first time */
121  }
122 }
#define ERROR_SUCCESS
Definition: deptool.c:10
_In_ HANDLE Handle
Definition: extypes.h:390
INT WSAAPI WsProcOpenAsyncHelperDevice(IN PWSPROCESS Process, OUT PHANDLE Handle)
Definition: dprocess.c:83
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219

Referenced by WsThreadInitialize().

◆ WsProcGetNsCatalog()

PNSCATALOG WSAAPI WsProcGetNsCatalog ( IN PWSPROCESS  Process)

Definition at line 166 of file dprocess.c.

167 {
168  /* Check if the catalogs have been modified */
169  if (WsCheckCatalogState(Process->NamespaceCatalogEvent))
170  {
171  /* Modification happened, reload them */
172  WsNcRefreshFromRegistry(Process->NamespaceCatalog,
173  Process->NamespaceCatalogEvent);
174  }
175 
176  /* Return it */
177  return Process->NamespaceCatalog;
178 }
INT WSAAPI WsNcRefreshFromRegistry(IN PNSCATALOG Catalog, IN HANDLE CatalogEvent)
Definition: nscatalo.c:209
BOOL WSAAPI WsCheckCatalogState(IN HANDLE Event)
Definition: wsautil.c:75
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219

Referenced by WSAEnumNameSpaceProvidersInternal(), WSALookupServiceBeginW(), and WSCGetProviderPath().

◆ WsProcGetTCatalog()

PTCATALOG WSAAPI WsProcGetTCatalog ( IN PWSPROCESS  Process)

Definition at line 150 of file dprocess.c.

151 {
152  /* Check if the catalogs have been modified */
153  if (WsCheckCatalogState(Process->ProtocolCatalogEvent))
154  {
155  /* Modification happened, reload them */
156  WsTcRefreshFromRegistry(Process->ProtocolCatalog,
157  Process->ProtocolCatalogEvent);
158  }
159 
160  /* Return it */
161  return Process->ProtocolCatalog;
162 }
DWORD WSAAPI WsTcRefreshFromRegistry(IN PTCATALOG TCatalog, PVOID)
BOOL WSAAPI WsCheckCatalogState(IN HANDLE Event)
Definition: wsautil.c:75
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219

Referenced by WPUModifyIFSHandle(), WPUQueryBlockingCallback(), WSAAddressToStringA(), WSAAddressToStringW(), WSASocketW(), WSAStringToAddressA(), WSAStringToAddressW(), and WsSockFindIfsSocket().

◆ WsProcSetVersion()

VOID WSAAPI WsProcSetVersion ( IN PWSPROCESS  Process,
IN WORD  VersionRequested 
)

Definition at line 312 of file dprocess.c.

314 {
315  WORD Major, Minor;
316  WORD OldMajor, OldMinor;
317 
318  /* Get the version data */
319  Major = LOBYTE(VersionRequested);
320  Minor = HIBYTE(VersionRequested);
321  OldMajor = LOBYTE(Process->Version);
322  OldMinor = HIBYTE(Process->Version);
323 
324  /* Check if we're going lower */
325  if ((Major < OldMajor) || ((Major == OldMajor) && (Minor < OldMinor)))
326  {
327  /* Set the new version */
328  Process->Version = VersionRequested;
329  }
330 }
_Out_opt_ PULONG Minor
Definition: cmfuncs.h:44
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
unsigned short WORD
Definition: ntddk_ex.h:93
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219

Referenced by WSAStartup().

◆ WsProcStartup()

INT WSAAPI WsProcStartup ( VOID  )

Definition at line 126 of file dprocess.c.

127 {
129 
130  /* Create a new process */
132 
133  /* Initialize it */
134  if (CurrentWsProcess)
135  {
136  /* Initialize the process */
138  }
139  else
140  {
141  /* No memory for the process object */
143  }
144 
145  return ErrorCode;
146 }
#define WSAEFAULT
Definition: winerror.h:1945
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
PWSPROCESS CurrentWsProcess
Definition: dprocess.c:15
int32_t INT
Definition: typedefs.h:56
PWSPROCESS WSAAPI WsProcAllocate(VOID)
Definition: dprocess.c:65
#define WSA_NOT_ENOUGH_MEMORY
Definition: winsock2.h:593
INT WSAAPI WsProcInitialize(IN PWSPROCESS Process)
Definition: dprocess.c:24

Referenced by WSAStartup().

◆ WsQuickProlog()

FORCEINLINE DWORD WsQuickProlog ( VOID  )

Definition at line 892 of file ws2_32p.h.

893 {
894  /* Try to see if we're initialized. If not, do the full prolog */
895  return WsGetProcess() ? ERROR_SUCCESS : WsSlowProlog();
896 }
INT WSAAPI WsSlowProlog(VOID)
Definition: wsautil.c:109
#define ERROR_SUCCESS
Definition: deptool.c:10
FORCEINLINE PWSPROCESS WsGetProcess(VOID)
Definition: ws2_32p.h:885

Referenced by bind(), closesocket(), getaddrinfo(), getnameinfo(), getpeername(), getsockname(), listen(), select(), shutdown(), WSAAsyncSelect(), WSAConnect(), WSADuplicateSocketW(), WSAEnumNetworkEvents(), WSAEventSelect(), WSAGetOverlappedResult(), WSAGetQOSByName(), WSAHtonl(), WSAHtons(), WSANtohl(), and WSANtohs().

◆ WsQuickPrologTid()

FORCEINLINE DWORD WsQuickPrologTid ( LPWSATHREADID Tid)

Definition at line 900 of file ws2_32p.h.

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 }
#define ERROR_SUCCESS
Definition: deptool.c:10
LPWSATHREADID WSAAPI WsThreadGetThreadId(IN PWSPROCESS Process)
Definition: dthread.c:297
FORCEINLINE PWSPROCESS WsGetProcess(VOID)
Definition: ws2_32p.h:885
INT WSAAPI WsSlowPrologTid(OUT LPWSATHREADID *ThreadId)
Definition: wsautil.c:120

Referenced by recv(), recvfrom(), send(), sendto(), WSAIoctl(), WSARecv(), WSARecvFrom(), WSASend(), and WSASendTo().

◆ WsRasInitializeAutodial()

VOID WSAAPI WsRasInitializeAutodial ( VOID  )

Definition at line 47 of file rasdial.c.

48 {
49  /* Initialize the autodial lock */
51 }
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
CRITICAL_SECTION WsRasHelperLock
Definition: rasdial.c:35

Referenced by DllMain().

◆ WsRasUninitializeAutodial()

VOID WSAAPI WsRasUninitializeAutodial ( VOID  )

Definition at line 55 of file rasdial.c.

56 {
57  /* Acquire lock */
58  WsRasLock();
59 
60  /* Free the library if it's loaded */
63 
64  /* Release and delete lock */
65  WsRasUnlock();
67 }
#define WsRasLock()
Definition: rasdial.c:40
smooth NULL
Definition: ftsmooth.c:416
#define FreeLibrary(x)
Definition: compat.h:413
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
CRITICAL_SECTION WsRasHelperLock
Definition: rasdial.c:35
#define WsRasUnlock()
Definition: rasdial.c:41
HINSTANCE WsRasDllHandle
Definition: rasdial.c:34

Referenced by DllMain().

◆ WsSetupCatalogProtection()

INT WSAAPI WsSetupCatalogProtection ( IN HKEY  CatalogKey,
IN HANDLE  CatalogEvent,
OUT LPDWORD  UniqueId 
)

Definition at line 142 of file wsautil.c.

145 {
146  INT ErrorCode;
147  HKEY RegistryKey;
148  DWORD NewUniqueId;
149  CHAR KeyBuffer[32];
150  DWORD RegType = REG_DWORD;
151  DWORD RegSize = sizeof(DWORD);
152 
153  /* Start loop */
154  do
155  {
156 #if 0
157  /* Ask for notifications */
158  ErrorCode = RegNotifyChangeKeyValue(CatalogKey,
159  FALSE,
161  CatalogEvent,
162  TRUE);
163  if (ErrorCode != ERROR_SUCCESS)
164  {
165  /* Normalize error code */
167  break;
168  }
169 #endif
170 
171  /* Read the current ID */
172  ErrorCode = RegQueryValueEx(CatalogKey,
173  "Serial_Access_Num",
174  0,
175  &RegType,
176  (LPBYTE)&NewUniqueId,
177  &RegSize);
178  if (ErrorCode != ERROR_SUCCESS)
179  {
180  /* Critical failure */
182  break;
183  }
184 
185  /* Try to open it for writing */
186  sprintf(KeyBuffer, "%8.8lX", NewUniqueId);
187  ErrorCode = RegOpenKeyEx(CatalogKey,
188  KeyBuffer,
189  0,
191  &RegistryKey);
192 
193  /* If the key doesn't exist or is being delete, that's ok for us */
194  if ((ErrorCode == ERROR_FILE_NOT_FOUND) ||
196  {
197  /* Set success and return the new ID */
199  *UniqueId = NewUniqueId;
200  break;
201  }
202  else if (ErrorCode != ERROR_SUCCESS)
203  {
204  /* Any other failure is bad */
206  break;
207  }
208 
209  /* If we could actually open the key, someone is using it :/ */
210  ErrorCode = RegCloseKey(RegistryKey);
211 
212  /* In case we break out prematurely */
214 
215  /* Keep looping until they let go of the registry writing */
216  } while (!WaitForSingleObject(CatalogEvent, 180 * 1000));
217 
218  /* Return error code */
219  return ErrorCode;
220 }
#define RegQueryValueEx
Definition: winreg.h:524
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
#define TRUE
Definition: types.h:120
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
char CHAR
Definition: xmlstorage.h:175
#define REG_NOTIFY_CHANGE_NAME
Definition: winreg.h:38
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define ERROR_KEY_DELETED
Definition: winerror.h:597
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define WSANO_RECOVERY
Definition: winerror.h:2002
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WSASYSCALLFAILURE
Definition: winerror.h:1994
#define RegOpenKeyEx
Definition: winreg.h:520
LONG WINAPI RegNotifyChangeKeyValue(HKEY hKey, BOOL bWatchSubtree, DWORD dwNotifyFilter, HANDLE hEvent, BOOL fAsynchronous)
Definition: reg.c:3175
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by WsNcRefreshFromRegistry(), and WsTcRefreshFromRegistry().

◆ WsSlowProlog()

INT WSAAPI WsSlowProlog ( VOID  )

Definition at line 109 of file wsautil.c.

110 {
113 
114  /* Call the prolog */
115  return WsApiProlog(&Process, &Thread);
116 }
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
INT WSAAPI WsApiProlog(OUT PWSPROCESS *Process, OUT PWSTHREAD *Thread)
Definition: wsautil.c:91
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219

Referenced by WsQuickProlog().

◆ WsSlowPrologTid()

INT WSAAPI WsSlowPrologTid ( OUT LPWSATHREADID ThreadId)

Definition at line 120 of file wsautil.c.

121 {
124  INT ErrorCode;
125 
126  /* Call the prolog */
128 
129  /* Check for success */
130  if (ErrorCode == ERROR_SUCCESS)
131  {
132  /* Return the Thread ID */
133  *ThreadId = &Thread->WahThreadId;
134  }
135 
136  /* Return status */
137  return ErrorCode;
138 }
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
int32_t INT
Definition: typedefs.h:56
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
INT WSAAPI WsApiProlog(OUT PWSPROCESS *Process, OUT PWSTHREAD *Thread)
Definition: wsautil.c:91
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219

Referenced by WsQuickPrologTid().

◆ WsSockAddApiReference()

INT WSAAPI WsSockAddApiReference ( IN SOCKET  Handle)

Definition at line 159 of file dsocket.c.

160 {
161  PWSSOCKET Socket;
162 
163  /* Get the Socket now */
164  if ((Socket = WsSockGetSocketNoExport(Handle)))
165  {
166  /* Mark it as an API Socket */
167  if (Socket) Socket->ApiSocket = TRUE;
168 
169  /* Remove a reference and return */
170  WsSockDereference(Socket);
171  return ERROR_SUCCESS;
172  }
173 
174  /* Return error */
175  return WSASYSCALLFAILURE;
176 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOLEAN ApiSocket
Definition: ws2_32p.h:202
_In_ HANDLE Handle
Definition: extypes.h:390
VOID WSAAPI WsSockDereference(IN PWSSOCKET Socket)
Definition: dsocket.c:205
#define WSASYSCALLFAILURE
Definition: winerror.h:1994
PWSSOCKET WSAAPI WsSockGetSocketNoExport(IN SOCKET Handle)
Definition: dsocket.c:92

Referenced by WSAAccept(), WSAJoinLeaf(), and WSASocketW().

◆ WsSockAllocate()

PWSSOCKET WSAAPI WsSockAllocate ( VOID  )

Definition at line 48 of file dsocket.c.

49 {
50  PWSSOCKET Socket;
51 
52  /* Allocate the socket object */
53  Socket = HeapAlloc(WsSockHeap, HEAP_ZERO_MEMORY, sizeof(*Socket));
54  if (Socket)
55  {
56  /* Setup default non-zero values */
57  Socket->RefCount = 2;
58  Socket->Overlapped = TRUE;
59  }
60 
61  /* Return it */
62  return Socket;
63 }
#define TRUE
Definition: types.h:120
BOOLEAN Overlapped
Definition: ws2_32p.h:201
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG RefCount
Definition: ws2_32p.h:196
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HANDLE WsSockHeap
Definition: dllmain.c:21

Referenced by WPUModifyIFSHandle().

◆ WsSockAssociateHandle()

INT WSAAPI WsSockAssociateHandle ( IN PWSSOCKET  Socket,
IN SOCKET  Handle,
IN BOOLEAN  IsProvider 
)

Definition at line 225 of file dsocket.c.

228 {
230  PWSSOCKET OldSocket;
231 
232  /* Save the socket and provider */
233  Socket->IsProvider = IsProvider;
234  Socket->Handle = (HANDLE)Handle;
235 
236  /* Insert it into the handle table */
238  (PWAH_HANDLE)Socket);
239 
240  /* Check if a socket already existed */
241  if (OldSocket != Socket)
242  {
243  /* We'll dereference it */
244  WsSockDereference(OldSocket);
245  }
246  else if (!OldSocket)
247  {
248  /* No memory to allocate it */
250  }
251 
252  /* Return */
253  return ErrorCode;
254 }
BOOLEAN IsProvider
Definition: ws2_32p.h:203
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
PWAH_HANDLE_TABLE WsSockHandleTable
Definition: dsocket.c:15
int32_t INT
Definition: typedefs.h:56
PWAH_HANDLE WINAPI WahInsertHandleContext(IN PWAH_HANDLE_TABLE Table, IN PWAH_HANDLE Handle)
Definition: context.c:336
_In_ HANDLE Handle
Definition: extypes.h:390
PVOID HANDLE
Definition: typedefs.h:71
VOID WSAAPI WsSockDereference(IN PWSSOCKET Socket)
Definition: dsocket.c:205
struct _WSSOCKET * PWSSOCKET
#define WSAENOBUFS
Definition: winerror.h:1968

Referenced by WPUModifyIFSHandle().

◆ WsSockCleanup()

VOID WSAAPI WsSockCleanup ( VOID  )

Definition at line 36 of file dsocket.c.

37 {
38  /* Check if we have a socket table */
40  {
41  /* Destroy it */
43  }
44 }
PWAH_HANDLE_TABLE WsSockHandleTable
Definition: dsocket.c:15
DWORD WINAPI WahDestroyHandleContextTable(IN PWAH_HANDLE_TABLE Table)
Definition: context.c:246

Referenced by DllMain().

◆ WsSockDeleteSockets()

BOOL WSAAPI WsSockDeleteSockets ( IN LPVOID  Context,
IN PWAH_HANDLE  Handle 
)

Definition at line 180 of file dsocket.c.

182 {
183  /* Call the detach routine */
185 }
BOOL WSAAPI WsProcDetachSocket(IN PWSPROCESS Process, IN PWAH_HANDLE Handle)
Definition: dprocess.c:182
_In_ HANDLE Handle
Definition: extypes.h:390

Referenced by WsProcDelete().

◆ WsSockDereference()

VOID WSAAPI WsSockDereference ( IN PWSSOCKET  Socket)

◆ WsSockDisassociateHandle()

INT WSAAPI WsSockDisassociateHandle ( IN PWSSOCKET  Socket)

Definition at line 217 of file dsocket.c.

218 {
219  /* Remove it from the list */
221 }
PWAH_HANDLE_TABLE WsSockHandleTable
Definition: dsocket.c:15
DWORD WINAPI WahRemoveHandleContext(IN PWAH_HANDLE_TABLE Table, IN PWAH_HANDLE Handle)
Definition: context.c:564

Referenced by closesocket().

◆ WsSockGetSocket()

PWSSOCKET WSAAPI WsSockGetSocket ( IN SOCKET  Handle)

Definition at line 140 of file dsocket.c.

141 {
142  PWSSOCKET Socket;
143 
144  /* Let WAH do the translation */
146  (HANDLE)Handle)))
147  {
148  return Socket;
149  }
150  else
151  {
152  /* WAH didn't find it, use IFS */
153  return WsSockFindIfsSocket(Handle);
154  }
155 }
PWSSOCKET WSAAPI WsSockFindIfsSocket(IN SOCKET Handle)
Definition: dsocket.c:101
PWAH_HANDLE_TABLE WsSockHandleTable
Definition: dsocket.c:15
_In_ HANDLE Handle
Definition: extypes.h:390
PWAH_HANDLE WINAPI WahReferenceContextByHandle(IN PWAH_HANDLE_TABLE Table, IN HANDLE Handle)
Definition: context.c:524

Referenced by bind(), closesocket(), connect(), getpeername(), getsockname(), getsockopt(), listen(), recv(), recvfrom(), select(), send(), sendto(), setsockopt(), shutdown(), WSAAccept(), WSAAsyncSelect(), WSAConnect(), WSADuplicateSocketW(), WSAEnumNetworkEvents(), WSAEventSelect(), WSAGetOverlappedResult(), WSAGetQOSByName(), WSAHtonl(), WSAHtons(), WSAIoctl(), WSAJoinLeaf(), WSANtohl(), WSANtohs(), WSARecv(), WSARecvDisconnect(), WSARecvFrom(), WSASend(), WSASendDisconnect(), and WSASendTo().

◆ WsSockInitialize()

INT WSAAPI WsSockInitialize ( IN PWSSOCKET  Socket,
IN PTCATALOG_ENTRY  CatalogEntry 
)

Definition at line 67 of file dsocket.c.

69 {
70  PWSTHREAD CurrentThread;
71 
72  /* Associate this catalog and reference it */
73  Socket->CatalogEntry = CatalogEntry;
74  InterlockedIncrement(&CatalogEntry->RefCount);
75 
76  /* Associate the Provider and Process Objects */
77  Socket->Provider = CatalogEntry->Provider;
78 
79  /* Get the current Thread Object */
80  if ((CurrentThread = TlsGetValue(TlsIndex)))
81  {
82  /* Set the overlapped mode */
83  Socket->Overlapped = (CurrentThread->OpenType == 0);
84  }
85 
86  /* Return status */
87  return ERROR_SUCCESS;
88 }
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD OpenType
Definition: ws2_32p.h:190
#define TlsIndex
Definition: ws2_32p.h:277
#define InterlockedIncrement
Definition: armddk.h:53
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1228

Referenced by WPUModifyIFSHandle().

◆ WsSockStartup()

INT WSAAPI WsSockStartup ( VOID  )

Definition at line 21 of file dsocket.c.

22 {
23  /* Check if we have a socket table */
24  if (!WsSockHandleTable)
25  {
26  /* Create it */
28  }
29 
30  /* Nothing to do */
31  return NO_ERROR;
32 }
PWAH_HANDLE_TABLE WsSockHandleTable
Definition: dsocket.c:15
#define NO_ERROR
Definition: dderror.h:5
DWORD WINAPI WahCreateHandleContextTable(OUT PWAH_HANDLE_TABLE *Table)
Definition: context.c:189

Referenced by WSAStartup().

◆ WsTcAllocate()

PTCATALOG WSAAPI WsTcAllocate ( VOID  )

Definition at line 25 of file dcatalog.c.

26 {
27  PTCATALOG Catalog;
28 
29  /* Allocate the object */
30  Catalog = HeapAlloc(WsSockHeap, HEAP_ZERO_MEMORY, sizeof(*Catalog));
31 
32  /* Return it */
33  return Catalog;
34 }
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HANDLE WsSockHeap
Definition: dllmain.c:21

Referenced by OpenInitializedCatalog(), and WsProcInitialize().

◆ WsTcDelete()

VOID WSAAPI WsTcDelete ( IN PTCATALOG  Catalog)

Definition at line 862 of file dcatalog.c.

863 {
865  PTCATALOG_ENTRY CatalogEntry;
866 
867  /* Check if we're initialized */
868  if (!Catalog->ProtocolList.Flink) return;
869 
870  /* Acquire lock */
871  WsTcLock();
872 
873  /* Loop every entry */
874  Entry = Catalog->ProtocolList.Flink;
875  while (Entry != &Catalog->ProtocolList)
876  {
877  /* Get this entry */
878  CatalogEntry = CONTAINING_RECORD(Entry, TCATALOG_ENTRY, CatalogLink);
879 
880  /* Remove it and dereference it */
881  WsTcRemoveCatalogItem(Catalog, CatalogEntry);
882  WsTcEntryDereference(CatalogEntry);
883 
884  /* Move to the next entry */
885  Entry = Catalog->ProtocolList.Flink;
886  }
887 
888  /* Check if the catalog key is opened */
889  if (Catalog->CatalogKey)
890  {
891  /* Close it */
892  RegCloseKey(Catalog->CatalogKey);
893  Catalog->CatalogKey = NULL;
894  }
895 
896  /* Release and delete the lock */
897  WsTcUnlock();
898  DeleteCriticalSection(&Catalog->Lock);
899 
900  /* Delete the object */
901  HeapFree(WsSockHeap, 0, Catalog);
902 }
Definition: ws2_32p.h:85
struct _Entry Entry
Definition: kefuncs.h:640
#define WsTcUnlock()
Definition: dcatalog.c:19
VOID WSAAPI WsTcRemoveCatalogItem(IN PTCATALOG Catalog, IN PTCATALOG_ENTRY Entry)
Definition: dcatalog.c:850
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
VOID WSAAPI WsTcEntryDereference(IN PTCATALOG_ENTRY CatalogEntry)
Definition: dcatitem.c:51
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define WsTcLock()
Definition: dcatalog.c:18
Definition: typedefs.h:117
HANDLE WsSockHeap
Definition: dllmain.c:21
#define HeapFree(x, y, z)
Definition: compat.h:402
base of all file and directory entries
Definition: entries.h:82

Referenced by WSCEnumProtocols(), and WsProcDelete().

◆ WsTcEntryAllocate()

PTCATALOG_ENTRY WSAAPI WsTcEntryAllocate ( VOID  )

Definition at line 17 of file dcatitem.c.

18 {
19