ReactOS 0.4.15-dev-7953-g1f49173
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}
#define NULL
Definition: types.h:112
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
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble s
Definition: gl.h:2039
Definition: ftp_var.h:139
uint32_t ULONG
Definition: typedefs.h:59

◆ 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;
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 */
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 ERROR_SUCCESS
Definition: deptool.c:10
#define SetLastError(x)
Definition: compat.h:752
Status
Definition: gdiplustypes.h:25
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:93
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define DPRINT
Definition: sndvol32.h:71
WSPPROC_TABLE Service
Definition: ws2_32p.h:80
LPWSPIOCTL lpWSPIoctl
Definition: ws2spi.h:477
PTPROVIDER Provider
Definition: ws2_32p.h:199
int32_t INT
Definition: typedefs.h:58
_In_ DWORD dwIoControlCode
Definition: winddi.h:1700
#define WSAENOTSOCK
Definition: winerror.h:1951
#define SOCKET_ERROR
Definition: winsock.h:333
VOID WSAAPI WsSockDereference(IN PWSSOCKET Socket)
Definition: dsocket.c:205
FORCEINLINE DWORD WsQuickPrologTid(LPWSATHREADID *Tid)
Definition: ws2_32p.h:900
PWSSOCKET WSAAPI WsSockGetSocket(IN SOCKET Handle)
Definition: dsocket.c:140

Referenced by AcceptEx(), getInterfaces(), ioctlsocket(), setipv4sourcefilter(), setsourcefilter(), test_ip_pktinfo(), Test_WSAIoctl_GetInterfaceList(), and TransmitFile().