ReactOS  0.4.14-dev-390-g34947ad
handle.c File Reference
#include "precomp.h"
#include <ndk/iofuncs.h>
#include "wshdrv.h"
Include dependency graph for handle.c:

Go to the source code of this file.

Classes

struct  _WSH_HELPER_CONTEXT
 

Macros

#define APCH   (HANDLE)'SOR '
 

Typedefs

typedef struct _WSH_HELPER_CONTEXT WSH_HELPER_CONTEXT
 
typedef struct _WSH_HELPER_CONTEXTPWAH_HELPER_CONTEXT
 

Functions

VOID CALLBACK ApcThread (ULONG_PTR Context)
 
NTSTATUS WINAPI DoSocketCancel (PVOID Context1, PVOID Context2, PVOID Context3)
 
NTSTATUS WINAPI DoSocketRequest (PVOID Context1, PVOID Context2, PVOID Context3)
 
VOID CALLBACK ExitThreadApc (ULONG_PTR Context)
 
DWORD WINAPI WahCloseHandleHelper (IN HANDLE HelperHandle)
 
DWORD WINAPI WahCloseSocketHandle (IN HANDLE HelperHandle, IN SOCKET Socket)
 
DWORD WINAPI WahCreateSocketHandle (IN HANDLE HelperHandle, OUT SOCKET *Socket)
 
INT WINAPI WahDisableNonIFSHandleSupport (VOID)
 
INT WINAPI WahEnableNonIFSHandleSupport (VOID)
 
DWORD WINAPI WahOpenHandleHelper (OUT PHANDLE HelperHandle)
 
DWORD WINAPI WahCompleteRequest (IN HANDLE HelperHandle, IN SOCKET Socket, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD ErrorCode, IN DWORD BytesTransferred)
 

Variables

LPFN_WSASEND pWSASend
 
LPFN_WSARECV pWSARecv
 
LPFN_WSASENDTO pWSASendTo
 
LPFN_WSARECVFROM pWSARecvFrom
 
LPFN_WSAGETLASTERROR pWSAGetLastError
 
LPFN_WSACANCELBLOCKINGCALL pWSACancelBlockingCall
 
LPFN_WSASETBLOCKINGHOOK pWSASetBlockingHook
 
LPFN_SELECT pSelect
 
LPFN_WSASTARTUP pWSAStartup
 
LPFN_WSACLEANUP pWSACleanup
 
LPFN_GETSOCKOPT pGetSockOpt
 
LPFN_WSAIOCTL pWSAIoctl
 

Macro Definition Documentation

◆ APCH

#define APCH   (HANDLE)'SOR '

Definition at line 38 of file handle.c.

Typedef Documentation

◆ PWAH_HELPER_CONTEXT

◆ WSH_HELPER_CONTEXT

Function Documentation

◆ ApcThread()

VOID CALLBACK ApcThread ( ULONG_PTR  Context)

Definition at line 44 of file handle.c.

45 {
46 
47 }

Referenced by WahOpenHandleHelper().

◆ DoSocketCancel()

NTSTATUS WINAPI DoSocketCancel ( PVOID  Context1,
PVOID  Context2,
PVOID  Context3 
)

Definition at line 51 of file handle.c.

54 {
55  return STATUS_SUCCESS;
56 }
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by WahOpenHandleHelper().

◆ DoSocketRequest()

NTSTATUS WINAPI DoSocketRequest ( PVOID  Context1,
PVOID  Context2,
PVOID  Context3 
)

Definition at line 60 of file handle.c.

63 {
64  return STATUS_SUCCESS;
65 }
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by WahOpenHandleHelper().

◆ ExitThreadApc()

VOID CALLBACK ExitThreadApc ( ULONG_PTR  Context)

Definition at line 69 of file handle.c.

70 {
72  HMODULE DllHandle = HelperContext->DllHandle;
73 
74  /* Close the file handle */
75  CloseHandle(HelperContext->FileHandle);
76 
77  /* Free the context */
78  HeapFree(GlobalHeap, 0, HelperContext);
79 
80  /* Exit the thread and library */
82 }
#define ERROR_SUCCESS
Definition: deptool.c:10
VOID WINAPI FreeLibraryAndExitThread(HMODULE hLibModule, DWORD dwExitCode)
Definition: loader.c:516
HANDLE DllHandle
Definition: handle.c:22
HANDLE FileHandle
Definition: handle.c:20
HANDLE GlobalHeap
Definition: dllmain.c:19
BOOL WINAPI CloseHandle(IN HANDLE hObject)
Definition: handle.c:129
#define HeapFree(x, y, z)
Definition: compat.h:402
struct _WSH_HELPER_CONTEXT * PWAH_HELPER_CONTEXT

Referenced by WahCloseHandleHelper().

◆ WahCloseHandleHelper()

DWORD WINAPI WahCloseHandleHelper ( IN HANDLE  HelperHandle)

Definition at line 86 of file handle.c.

87 {
89  PWAH_HELPER_CONTEXT Context = HelperHandle;
90 
91  /* Enter the prolog, make sure we're initialized */
93  if (ErrorCode != ERROR_SUCCESS) return ErrorCode;
94 
95  /* Validate the handle */
96  if (!Context) return ERROR_INVALID_PARAMETER;
97 
98  /* Queue an APC to exit the thread */
99  if (QueueUserAPC(ExitThreadApc, Context->ThreadHandle, (ULONG_PTR)Context))
100  {
101  /* Done */
102  return ERROR_SUCCESS;
103  }
104  else
105  {
106  /* We failed somewhere */
107  return ERROR_GEN_FAILURE;
108  }
109 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define WS2HELP_PROLOG()
Definition: precomp.h:47
DWORD WINAPI QueueUserAPC(IN PAPCFUNC pfnAPC, IN HANDLE hThread, IN ULONG_PTR dwData)
Definition: thread.c:947
VOID CALLBACK ExitThreadApc(ULONG_PTR Context)
Definition: handle.c:69
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERROR_GEN_FAILURE
Definition: winerror.h:134

Referenced by WsProcDelete().

◆ WahCloseSocketHandle()

DWORD WINAPI WahCloseSocketHandle ( IN HANDLE  HelperHandle,
IN SOCKET  Socket 
)

Definition at line 113 of file handle.c.

115 {
117  PWAH_HELPER_CONTEXT Context = HelperHandle;
118 
119  /* Enter the prolog, make sure we're initialized */
121  if (ErrorCode != ERROR_SUCCESS) return ErrorCode;
122 
123  /* Validate the handle */
124  if (!(Context) || (Socket == INVALID_SOCKET) || !(Socket))
125  {
126  /* Invalid handle and/or socket */
128  }
129 
130  /* Just close the handle and return */
131  CloseHandle((HANDLE)Socket);
132  return ERROR_SUCCESS;
133 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WS2HELP_PROLOG()
Definition: precomp.h:47
#define INVALID_SOCKET
Definition: winsock.h:332
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI CloseHandle(IN HANDLE hObject)
Definition: handle.c:129

Referenced by WsProcDetachSocket().

◆ WahCompleteRequest()

DWORD WINAPI WahCompleteRequest ( IN HANDLE  HelperHandle,
IN SOCKET  Socket,
IN LPWSAOVERLAPPED  lpOverlapped,
IN DWORD  ErrorCode,
IN DWORD  BytesTransferred 
)

Definition at line 438 of file handle.c.

443 {
444  UNREFERENCED_PARAMETER(HelperHandle);
445  UNREFERENCED_PARAMETER(Socket);
448  UNREFERENCED_PARAMETER(BytesTransferred);
449  return ERROR_SUCCESS;
450 }
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:90

◆ WahCreateSocketHandle()

DWORD WINAPI WahCreateSocketHandle ( IN HANDLE  HelperHandle,
OUT SOCKET Socket 
)

Definition at line 137 of file handle.c.

139 {
141  INT OpenType;
142  DWORD Size = sizeof(OpenType);
143  DWORD CreateOptions = 0;
147  PWAH_EA_DATA EaData;
148  CHAR EaBuffer[sizeof(*Ea) + sizeof(*EaData)];
152 
153  /* Enter the prolog, make sure we're initialized */
155  if (ErrorCode != ERROR_SUCCESS) return ErrorCode;
156 
157  /* Validate the handle and pointer */
158  if (!(Context) || !(Socket))
159  {
160  /* Invalid handle and/or socket */
162  }
163 
164  /* Set pointer to EA */
166 
167  /* Get the open type to determine the create options */
169  SOL_SOCKET,
170  SO_OPENTYPE,
171  (PCHAR)&OpenType,
172  (INT FAR*)&Size) == ERROR_SUCCESS) && (OpenType))
173  {
174  /* This is a sync open */
176  }
177 
178  /* Initialize the attributes for the driver */
179  RtlInitUnicodeString(&Name, L"\\Device\\WS2IFSL\\NifsSct");
181  &Name,
182  0,
183  NULL,
184  NULL);
185 
186  /* Set up the EA */
187  Ea->NextEntryOffset = 0;
188  Ea->Flags = 0;
189  Ea->EaNameLength = sizeof("NifsSct");
190  Ea->EaValueLength = sizeof(*EaData);
191  RtlCopyMemory(Ea->EaName, "NifsSct", Ea->EaNameLength);
192 
193  /* Get our EA data */
194  EaData = (PWAH_EA_DATA)(Ea + 1);
195 
196  /* Write the EA Data */
197  EaData->FileHandle = Context->FileHandle;
198  EaData->Context = NULL;
199 
200  /* Call the driver */
201  Status = NtCreateFile((PHANDLE)Socket,
204  &IoStatusBlock,
205  NULL,
207  0,
208  FILE_OPEN_IF,
210  Ea,
211  sizeof(*Ea) + sizeof(*EaData));
212 
213  /* Check for success */
214  if (NT_SUCCESS(Status))
215  {
216  /* Write the socket handle */
217  EaData->Context =(HANDLE)*Socket;
218 
219  /* Tell the driver about it */
220  if (DeviceIoControl((HANDLE)*Socket,
222  &EaData,
223  sizeof(WSH_EA_DATA),
224  NULL,
225  0,
226  &Size,
227  NULL))
228  {
229  /* Set success */
231  }
232  else
233  {
234  /* We failed. Get the error and close the socket */
236  CloseHandle((HANDLE)*Socket);
237  *Socket = 0;
238  }
239  }
240  else
241  {
242  /* Create file failed, conver error code */
244  }
245 
246  /* Return to caller */
247  return ErrorCode;
248 }
signed char * PCHAR
Definition: retypes.h:7
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
LPFN_GETSOCKOPT pGetSockOpt
Definition: handle.c:35
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define FILE_OPEN_IF
Definition: from_kernel.h:56
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FILE_ALL_ACCESS
Definition: nt_native.h:651
struct _FILE_FULL_EA_INFORMATION * PFILE_FULL_EA_INFORMATION
char CHAR
Definition: xmlstorage.h:175
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_opt_ PVOID EaBuffer
Definition: iofuncs.h:835
LONG NTSTATUS
Definition: precomp.h:26
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define IOCTL_WS2IFSL_SET_HANDLE
Definition: wshdrv.h:26
#define SOL_SOCKET
Definition: winsock.h:398
#define NO_ERROR
Definition: dderror.h:5
int32_t INT
Definition: typedefs.h:56
#define WS2HELP_PROLOG()
Definition: precomp.h:47
#define FAR
Definition: guiddef.h:36
struct NameRec_ * Name
Definition: cdprocs.h:464
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
#define INVALID_SOCKET
Definition: winsock.h:332
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
struct _WSH_EA_DATA * PWAH_EA_DATA
PVOID HANDLE
Definition: typedefs.h:71
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG CreateOptions
Definition: fltkernel.h:1230
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR L[]
Definition: oid.c:1250
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
HANDLE FileHandle
Definition: wshdrv.h:13
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define SO_OPENTYPE
Definition: ws2_32.h:40
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
PVOID Context
Definition: wshdrv.h:14
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
BOOL WINAPI CloseHandle(IN HANDLE hObject)
Definition: handle.c:129
struct _WSH_HELPER_CONTEXT * PWAH_HELPER_CONTEXT

◆ WahDisableNonIFSHandleSupport()

INT WINAPI WahDisableNonIFSHandleSupport ( VOID  )

Definition at line 252 of file handle.c.

253 {
255  SC_HANDLE ServiceMgrHandle, Ws2IfsHandle;
256 
257  /* Enter the prolog, make sure we're initialized */
259  if (ErrorCode != ERROR_SUCCESS) return ErrorCode;
260 
261  /* Open the service DB */
262  ServiceMgrHandle = OpenSCManager(NULL,
265  if (!ServiceMgrHandle) return GetLastError();
266 
267  /* Open the service */
268  Ws2IfsHandle = OpenService(ServiceMgrHandle, "WS2IFSL", SERVICE_ALL_ACCESS);
269 
270  /* Disable the service */
271  ChangeServiceConfig(Ws2IfsHandle,
275  NULL,
276  NULL,
277  NULL,
278  NULL,
279  NULL,
280  NULL,
281  NULL);
282 
283  /* Close the handles and return */
284  CloseServiceHandle(ServiceMgrHandle);
285  CloseServiceHandle(Ws2IfsHandle);
286  return ERROR_SUCCESS;
287 }
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
#define SERVICES_ACTIVE_DATABASE
Definition: winsvc.h:564
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SERVICE_ALL_ACCESS
Definition: winsvc.h:62
#define OpenService
Definition: winsvc.h:576
#define SERVICE_NO_CHANGE
Definition: winsvc.h:20
#define WS2HELP_PROLOG()
Definition: precomp.h:47
#define SERVICE_DISABLED
Definition: cmtypes.h:977
#define ChangeServiceConfig
Definition: winsvc.h:567
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
smooth NULL
Definition: ftsmooth.c:416
#define SC_MANAGER_CREATE_SERVICE
Definition: winsvc.h:15
#define OpenSCManager
Definition: winsvc.h:575
unsigned long DWORD
Definition: ntddk_ex.h:95

◆ WahEnableNonIFSHandleSupport()

INT WINAPI WahEnableNonIFSHandleSupport ( VOID  )

Definition at line 291 of file handle.c.

292 {
293  return 0;
294 }

◆ WahOpenHandleHelper()

DWORD WINAPI WahOpenHandleHelper ( OUT PHANDLE  HelperHandle)

Definition at line 298 of file handle.c.

299 {
301  HINSTANCE hWs2_32;
305  PWAH_EA_DATA2 EaData;
306  CHAR EaBuffer[sizeof(*Ea) + sizeof(*EaData)];
309  DWORD Tid;
311 
312  /* Enter the prolog, make sure we're initialized */
314  if (ErrorCode != ERROR_SUCCESS) return ErrorCode;
315 
316  /* Validate the pointer */
317  if (!HelperHandle)
318  {
319  /* Invalid handle and/or socket */
321  }
322 
323  /* Get ws2_32.dll's handle. We don't load it: it MUST be here */
324  hWs2_32 = GetModuleHandle ("WS2_32.DLL");
325  if (!hWs2_32) return WSASYSCALLFAILURE;
326 
327  /* Dynamically load all its APIs */
328  if (!((pGetSockOpt = (LPFN_GETSOCKOPT)GetProcAddress(hWs2_32, "getsockopt"))) ||
329  !((pSelect = (LPFN_SELECT)GetProcAddress(hWs2_32, "select"))) ||
330  !((pWSACancelBlockingCall = (LPFN_WSACANCELBLOCKINGCALL)GetProcAddress(hWs2_32, "WSACancelBlockingCall"))) ||
331  !((pWSACleanup = (LPFN_WSACLEANUP)GetProcAddress(hWs2_32, "WSACleanup"))) ||
332  !((pWSAGetLastError = (LPFN_WSAGETLASTERROR)GetProcAddress(hWs2_32, "WSAGetLastError"))) ||
333  !((pWSASetBlockingHook = (LPFN_WSASETBLOCKINGHOOK)GetProcAddress(hWs2_32, "WSASetBlockingHook"))) ||
334  !((pWSARecv = (LPFN_WSARECV)GetProcAddress(hWs2_32, "WSARecv"))) ||
335  !((pWSASend = (LPFN_WSASEND)GetProcAddress(hWs2_32, "WSASend"))) ||
336  !((pWSASendTo = (LPFN_WSASENDTO)GetProcAddress(hWs2_32, "WSASendTo"))) ||
337  !((pWSAStartup = (LPFN_WSASTARTUP)GetProcAddress(hWs2_32, "WSAStartup"))) ||
338  !((pWSARecvFrom = (LPFN_WSARECVFROM)GetProcAddress(hWs2_32, "WSARecvFrom"))) ||
339  !((pWSAIoctl = (LPFN_WSAIOCTL)GetProcAddress(hWs2_32, "WSAIoctl"))))
340  {
341  /* Uh, guess we failed somewhere */
342  return WSASYSCALLFAILURE;
343  }
344 
345  /* Set pointer EA structure */
347 
348  /* Create the helper context */
350  if (Context)
351  {
352  /* Create the special request thread */
353  Context->ThreadHandle = CreateThread(NULL,
354  0,
355  (PVOID)ApcThread,
356  Context,
358  &Tid);
359  if (Context->ThreadHandle)
360  {
361  /* Create the attributes for the driver open */
362  RtlInitUnicodeString(&Name, L"\\Device\\WS2IFSL\\NifsPvd");
364  &Name,
365  0,
366  NULL,
367  NULL);
368 
369  /* Setup the EA */
370  Ea->NextEntryOffset = 0;
371  Ea->Flags = 0;
372  Ea->EaNameLength = sizeof("NifsPvd");
373  Ea->EaValueLength = sizeof(*EaData);
374  RtlCopyMemory(Ea->EaName, "NifsPvd", Ea->EaNameLength);
375 
376  /* Get our EA data */
377  EaData = (PWAH_EA_DATA2)(Ea + 1);
378 
379  /* Fill out the EA Data */
380  EaData->ThreadHandle = Context->ThreadHandle;
382  EaData->CancelRoutine = DoSocketCancel;
383  EaData->ApcContext = Context;
384  EaData->Reserved = 0;
385 
386  /* Call the driver */
387  Status = NtCreateFile(&Context->FileHandle,
390  &IoStatusBlock,
391  NULL,
393  0,
394  FILE_OPEN_IF,
395  0,
396  Ea,
397  sizeof(*Ea) + sizeof(*EaData));
398 
399  /* Check for success */
400  if (NT_SUCCESS(Status))
401  {
402  /* Resume the thread and return a handle to the context */
403  ResumeThread(Context->ThreadHandle);
404  *HelperHandle = (HANDLE)Context;
405  return ERROR_SUCCESS;
406  }
407  else
408  {
409  /* Get the error code */
411  }
412 
413  /* We failed, mark us as such */
414  Context->FileHandle = NULL;
415  ResumeThread(Context->ThreadHandle);
416  }
417  else
418  {
419  /* Get the error code */
421  }
422 
423  /* If we got here, we failed, so free the context */
425  }
426  else
427  {
428  /* Get the error code */
430  }
431 
432  /* Return to caller */
433  return ErrorCode;
434 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
LPFN_WSACANCELBLOCKINGCALL pWSACancelBlockingCall
Definition: handle.c:30
LPFN_WSAIOCTL pWSAIoctl
Definition: handle.c:36
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
LPFN_GETSOCKOPT pGetSockOpt
Definition: handle.c:35
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define FILE_OPEN_IF
Definition: from_kernel.h:56
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FILE_ALL_ACCESS
Definition: nt_native.h:651
struct _FILE_FULL_EA_INFORMATION * PFILE_FULL_EA_INFORMATION
LPFN_SELECT pSelect
Definition: handle.c:32
LPFN_WSARECVFROM pWSARecvFrom
Definition: handle.c:28
char CHAR
Definition: xmlstorage.h:175
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_opt_ PVOID EaBuffer
Definition: iofuncs.h:835
LONG NTSTATUS
Definition: precomp.h:26
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
LPFN_WSACLEANUP pWSACleanup
Definition: handle.c:34
LPFN_WSASENDTO pWSASendTo
Definition: handle.c:27
#define WS2HELP_PROLOG()
Definition: precomp.h:47
LPFN_WSASTARTUP pWSAStartup
Definition: handle.c:33
#define CREATE_SUSPENDED
Definition: winbase.h:178
ULONG Reserved
Definition: wshdrv.h:23
struct NameRec_ * Name
Definition: cdprocs.h:464
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
smooth NULL
Definition: ftsmooth.c:416
PVOID CancelRoutine
Definition: wshdrv.h:21
NTSTATUS WINAPI DoSocketCancel(PVOID Context1, PVOID Context2, PVOID Context3)
Definition: handle.c:51
LPFN_WSASETBLOCKINGHOOK pWSASetBlockingHook
Definition: handle.c:31
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PVOID HANDLE
Definition: typedefs.h:71
unsigned long DWORD
Definition: ntddk_ex.h:95
NTSTATUS WINAPI DoSocketRequest(PVOID Context1, PVOID Context2, PVOID Context3)
Definition: handle.c:60
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR L[]
Definition: oid.c:1250
HANDLE GlobalHeap
Definition: dllmain.c:19
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define WSASYSCALLFAILURE
Definition: winerror.h:1994
#define GetModuleHandle
Definition: winbase.h:3651
VOID CALLBACK ApcThread(ULONG_PTR Context)
Definition: handle.c:44
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
LPFN_WSARECV pWSARecv
Definition: handle.c:26
PVOID ApcContext
Definition: wshdrv.h:22
HANDLE ThreadHandle
Definition: wshdrv.h:19
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:566
struct tagContext Context
Definition: acpixf.h:1030
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define GetProcAddress(x, y)
Definition: compat.h:418
PVOID RequestRoutine
Definition: wshdrv.h:20
struct _WAH_EA_DATA2 * PWAH_EA_DATA2
LPFN_WSASEND pWSASend
Definition: handle.c:25
LPFN_WSAGETLASTERROR pWSAGetLastError
Definition: handle.c:29
#define HeapFree(x, y, z)
Definition: compat.h:402

Variable Documentation

◆ pGetSockOpt

LPFN_GETSOCKOPT pGetSockOpt

Definition at line 35 of file handle.c.

Referenced by WahCreateSocketHandle(), and WahOpenHandleHelper().

◆ pSelect

LPFN_SELECT pSelect

Definition at line 32 of file handle.c.

Referenced by WahOpenHandleHelper().

◆ pWSACancelBlockingCall

LPFN_WSACANCELBLOCKINGCALL pWSACancelBlockingCall

Definition at line 30 of file handle.c.

Referenced by AreLegacyFunctionsSupported(), and WahOpenHandleHelper().

◆ pWSACleanup

LPFN_WSACLEANUP pWSACleanup

Definition at line 34 of file handle.c.

Referenced by WahOpenHandleHelper().

◆ pWSAGetLastError

LPFN_WSAGETLASTERROR pWSAGetLastError

Definition at line 29 of file handle.c.

Referenced by AreLegacyFunctionsSupported(), IsWinsockInitialized(), and WahOpenHandleHelper().

◆ pWSAIoctl

LPFN_WSAIOCTL pWSAIoctl

Definition at line 36 of file handle.c.

Referenced by WahOpenHandleHelper().

◆ pWSARecv

LPFN_WSARECV pWSARecv

Definition at line 26 of file handle.c.

Referenced by WahOpenHandleHelper().

◆ pWSARecvFrom

LPFN_WSARECVFROM pWSARecvFrom

Definition at line 28 of file handle.c.

Referenced by WahOpenHandleHelper().

◆ pWSASend

LPFN_WSASEND pWSASend

Definition at line 25 of file handle.c.

Referenced by WahOpenHandleHelper().

◆ pWSASendTo

LPFN_WSASENDTO pWSASendTo

Definition at line 27 of file handle.c.

Referenced by WahOpenHandleHelper().

◆ pWSASetBlockingHook

LPFN_WSASETBLOCKINGHOOK pWSASetBlockingHook

Definition at line 31 of file handle.c.

Referenced by WahOpenHandleHelper().

◆ pWSAStartup

LPFN_WSASTARTUP pWSAStartup

Definition at line 33 of file handle.c.

Referenced by WahOpenHandleHelper().