ReactOS  0.4.14-dev-342-gdc047f9
sputil.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS WinSock 2 API
4  * FILE: dll/win32/ws2_32_new/src/sputil.c
5  * PURPOSE: Transport Service Provider Utility Functions
6  * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
7  */
8 
9 /* INCLUDES ******************************************************************/
10 
11 #include <ws2_32.h>
12 
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* FUNCTIONS *****************************************************************/
17 
18 /*
19  * @unimplemented
20  */
21 INT
22 WSPAPI
25  IN DWORD dwError,
26  IN DWORD cbTransferred,
27  OUT LPINT lpErrno)
28 {
30  return 0;
31 }
32 
33 /*
34  * @unimplemented
35  */
36 BOOL
37 WSPAPI
39  OUT LPINT lpErrno)
40 {
42  return FALSE;
43 }
44 
45 /*
46  * @unimplemented
47  */
48 INT
49 WSPAPI
51  OUT LPINT lpErrno)
52 {
54  return 0;
55 }
56 
57 /*
58  * @unimplemented
59  */
61 WSPAPI
63 {
65  return (WSAEVENT)0;
66 }
67 
68 /*
69  * @unimplemented
70  */
71 INT
72 WSPAPI
74  OUT LPINT lpErrno)
75 {
77  return 0;
78 }
79 
80 /*
81  * @implemented
82  */
83 BOOL
84 WSPAPI
86  IN UINT Msg,
89 {
90  /* Make sure we have a post routine */
92 
93  /* Call it */
95 }
96 
97 /*
98  * @implemented
99  */
100 INT
101 WSPAPI
103  OUT LPBLOCKINGCALLBACK FAR* lplpfnCallback,
104  OUT PDWORD_PTR lpdwContext,
105  OUT LPINT lpErrno)
106 {
109  PTCATALOG Catalog;
110  INT ErrorCode;
111  INT Status;
112  LPBLOCKINGCALLBACK Callback = NULL;
114  DWORD_PTR Context = 0;
115  DPRINT("WPUQueryBlockingCallback: %lx \n", dwCatalogEntryId);
116 
117  /* Enter prolog */
119  {
120  /* Get the callback function */
121  Callback = Thread->BlockingCallback;
122 
123  /* Check if there is one */
124  if (Callback)
125  {
126  /* Get the catalog */
127  Catalog = WsProcGetTCatalog(Process);
128 
129  /* Find the entry for this ID */
131  dwCatalogEntryId,
132  &Entry);
133 
134  /* Check for success */
135  if (ErrorCode == ERROR_SUCCESS)
136  {
137  /* Get the context */
138  Context = (DWORD_PTR)Entry->Provider->Service.lpWSPCancelBlockingCall;
139 
140  /* Dereference the entry */
142  }
143  }
144  }
145 
146  /* Check error code */
147  if (ErrorCode == ERROR_SUCCESS)
148  {
149  /* Return success as well */
151  }
152  else
153  {
154  /* Return expected value and no callback */
156  Callback = NULL;
157  }
158 
159  /* Return the settings */
160  *lpdwContext = Context;
161  *lpErrno = ErrorCode;
162  *lplpfnCallback = Callback;
163 
164  /* Return to caller */
165  return Status;
166 }
167 
168 /*
169  * @unimplemented
170  */
171 INT
172 WSPAPI
174  IN LPWSAUSERAPC lpfnUserApc,
175  IN DWORD_PTR dwContext,
176  OUT LPINT lpErrno)
177 {
179  return 0;
180 }
181 
182 /*
183  * @unimplemented
184  */
185 BOOL
186 WSPAPI
188  OUT LPINT lpErrno)
189 {
191  return FALSE;
192 }
193 
194 /*
195  * @unimplemented
196  */
197 BOOL
198 WSPAPI
200  OUT LPINT lpErrno)
201 {
203  return FALSE;
204 }
#define SOCKET_ERROR
Definition: winsock.h:333
PWS_SOCK_POST_ROUTINE WsSockPostRoutine
Definition: startup.c:18
#define IN
Definition: typedefs.h:38
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
Definition: ws2_32p.h:85
#define ERROR_SUCCESS
Definition: deptool.c:10
#define DWORD_PTR
Definition: treelist.c:76
struct _Entry Entry
Definition: kefuncs.h:640
#define WSAEVENT
Definition: winsock2.h:585
struct @1591 Msg[]
HWND hWnd
Definition: settings.c:17
UINT_PTR WPARAM
Definition: windef.h:207
DWORD WSAAPI WsTcGetEntryFromCatalogEntryId(IN PTCATALOG TCatalog, IN DWORD CatalogEntryId, IN PTCATALOG_ENTRY *CatalogEntry)
Definition: dcatalog.c:434
WSAEVENT WSPAPI WPUCreateEvent(OUT LPINT lpErrno)
Definition: sputil.c:62
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
static HANDLE hEvent
Definition: comm.c:54
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FAR
Definition: guiddef.h:36
INT WSPAPI WPUQueryBlockingCallback(IN DWORD dwCatalogEntryId, OUT LPBLOCKINGCALLBACK FAR *lplpfnCallback, OUT PDWORD_PTR lpdwContext, OUT LPINT lpErrno)
Definition: sputil.c:102
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
INT WSPAPI WPUCompleteOverlappedRequest(IN SOCKET s, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwError, IN DWORD cbTransferred, OUT LPINT lpErrno)
Definition: sputil.c:23
void DPRINT(...)
Definition: polytest.cpp:61
#define PostMessage
Definition: winuser.h:5733
VOID WSAAPI WsTcEntryDereference(IN PTCATALOG_ENTRY CatalogEntry)
Definition: dcatitem.c:51
BOOL WSPAPI WPUCloseEvent(IN WSAEVENT hEvent, OUT LPINT lpErrno)
Definition: sputil.c:38
BOOL WSPAPI WPUResetEvent(IN WSAEVENT hEvent, OUT LPINT lpErrno)
Definition: sputil.c:187
BOOL WSPAPI WPUSetEvent(IN WSAEVENT hEvent, OUT LPINT lpErrno)
Definition: sputil.c:199
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
INT WSPAPI WPUOpenCurrentThread(OUT LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
Definition: sputil.c:73
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:184
INT WSAAPI WsApiProlog(OUT PWSPROCESS *Process, OUT PWSTHREAD *Thread)
Definition: wsautil.c:91
GLdouble s
Definition: gl.h:2039
uint32_t DWORD_PTR
Definition: typedefs.h:63
Status
Definition: gdiplustypes.h:24
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:90
INT WSPAPI WPUCloseThread(IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
Definition: sputil.c:50
INT WSPAPI WPUQueueApc(IN LPWSATHREADID lpThreadId, IN LPWSAUSERAPC lpfnUserApc, IN DWORD_PTR dwContext, OUT LPINT lpErrno)
Definition: sputil.c:173
unsigned int UINT
Definition: ndis.h:50
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
#define OUT
Definition: typedefs.h:39
struct tagContext Context
Definition: acpixf.h:1030
#define UNIMPLEMENTED
Definition: debug.h:114
UINT_PTR SOCKET
Definition: winsock.h:47
LPFNPSPCALLBACK Callback
Definition: desk.c:111
LPARAM lParam
Definition: combotst.c:139
base of all file and directory entries
Definition: entries.h:82
PTCATALOG WSAAPI WsProcGetTCatalog(IN PWSPROCESS Process)
Definition: dprocess.c:150
BOOL WSPAPI WPUPostMessage(IN HWND hWnd, IN UINT Msg, IN WPARAM wParam, IN LPARAM lParam)
Definition: sputil.c:85
int * LPINT
Definition: windef.h:178
#define WSPAPI
Definition: ws2spi.h:39