ReactOS  0.4.13-dev-73-gcfe54aa
ioctl.c File Reference
#include <ws2_32.h>
#include <debug.h>
Include dependency graph for ioctl.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

INT WSAAPI ioctlsocket (IN SOCKET s, IN LONG cmd, IN OUT ULONG FAR *argp)
 
INT WSAAPI WSAIoctl (IN SOCKET s, IN DWORD dwIoControlCode, IN LPVOID lpvInBuffer, IN DWORD cbInBuffer, OUT LPVOID lpvOutBuffer, IN DWORD cbOutBuffer, OUT LPDWORD lpcbBytesReturned, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file ioctl.c.

Function Documentation

◆ ioctlsocket()

INT WSAAPI ioctlsocket ( IN SOCKET  s,
IN LONG  cmd,
IN OUT ULONG FAR argp 
)

Definition at line 23 of file ioctl.c.

26 {
27  DWORD Dummy;
28 
29  /* Let WSA do it */
30  return WSAIoctl(s,
31  cmd,
32  argp,
33  sizeof(ULONG),
34  argp,
35  sizeof(ULONG),
36  &Dummy,
37  NULL,
38  NULL);
39 }
Definition: ftp_var.h:139
INT WSAAPI WSAIoctl(IN SOCKET s, IN DWORD dwIoControlCode, IN LPVOID lpvInBuffer, IN DWORD cbInBuffer, OUT LPVOID lpvOutBuffer, IN DWORD cbOutBuffer, OUT LPDWORD lpcbBytesReturned, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
Definition: ioctl.c:46
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble s
Definition: gl.h:2039
unsigned int ULONG
Definition: retypes.h:1

◆ WSAIoctl()

INT WSAAPI WSAIoctl ( IN SOCKET  s,
IN DWORD  dwIoControlCode,
IN LPVOID  lpvInBuffer,
IN DWORD  cbInBuffer,
OUT LPVOID  lpvOutBuffer,
IN DWORD  cbOutBuffer,
OUT LPDWORD  lpcbBytesReturned,
IN LPWSAOVERLAPPED  lpOverlapped,
IN LPWSAOVERLAPPED_COMPLETION_ROUTINE  lpCompletionRoutine 
)

Definition at line 46 of file ioctl.c.

55 {
56  PWSSOCKET Socket;
57  INT Status;
58  INT ErrorCode;
59  LPWSATHREADID ThreadId;
60  DPRINT("WSAIoctl: %lx, %lx\n", s, dwIoControlCode);
61 
62  /* Check for WSAStartup */
63  if ((ErrorCode = WsQuickPrologTid(&ThreadId)) == ERROR_SUCCESS)
64  {
65  /* Get the Socket Context */
66  if ((Socket = WsSockGetSocket(s)))
67  {
68  /* Make the call */
69  Status = Socket->Provider->Service.lpWSPIoctl(s,
71  lpvInBuffer,
72  cbInBuffer,
73  lpvOutBuffer,
74  cbOutBuffer,
75  lpcbBytesReturned,
77  lpCompletionRoutine,
78  ThreadId,
79  &ErrorCode);
80 
81  /* Deference the Socket Context */
82  WsSockDereference(Socket);
83 
84  /* Return Provider Value */
85  if (Status == ERROR_SUCCESS) return Status;
86  }
87  else
88  {
89  /* No Socket Context Found */
91  }
92  }
93 
94  /* Return with an Error */
96  return SOCKET_ERROR;
97 }
#define WSAENOTSOCK
Definition: winerror.h:1951
#define SOCKET_ERROR
Definition: winsock.h:333
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4418
#define ERROR_SUCCESS
Definition: deptool.c:10
PWSSOCKET WSAAPI WsSockGetSocket(IN SOCKET Handle)
Definition: dsocket.c:140
int32_t INT
Definition: typedefs.h:56
WSPPROC_TABLE Service
Definition: ws2_32p.h:80
VOID WSAAPI WsSockDereference(IN PWSSOCKET Socket)
Definition: dsocket.c:205
LPWSPIOCTL lpWSPIoctl
Definition: ws2spi.h:477
void DPRINT(...)
Definition: polytest.cpp:61
FORCEINLINE DWORD WsQuickPrologTid(LPWSATHREADID *Tid)
Definition: ws2_32p.h:900
PTPROVIDER Provider
Definition: ws2_32p.h:199
#define SetLastError(x)
Definition: compat.h:409
GLdouble s
Definition: gl.h:2039
Status
Definition: gdiplustypes.h:24
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:90
_In_ DWORD dwIoControlCode
Definition: winddi.h:1700

Referenced by AcceptEx(), getInterfaces(), idealsendbacklognotify(), idealsendbacklogquery(), ioctlsocket(), setipv4sourcefilter(), setsourcefilter(), test_AcceptEx(), test_address_list_query(), test_completion_port(), test_ConnectEx(), test_DisconnectEx(), test_ioctlsocket(), test_ip_pktinfo(), test_sioAddressListChange(), test_sioRoutingInterfaceQuery(), test_synchronous_WSAIoctl(), test_TransmitFile(), Test_WSAIoctl_GetInterfaceList(), test_WSASendMsg(), and TransmitFile().