ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

sputil.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:   See COPYING in the top level directory
00003  * PROJECT:     ReactOS WinSock 2 API
00004  * FILE:        sputil.c
00005  * PURPOSE:     Transport Service Provider Utility Functions
00006  * PROGRAMMER:  Alex Ionescu (alex@relsoft.net)
00007  */
00008 
00009 /* INCLUDES ******************************************************************/
00010 #include "ws2_32.h"
00011 
00012 //#define NDEBUG
00013 #include <debug.h>
00014 
00015 /* DATA **********************************************************************/
00016 
00017 /* FUNCTIONS *****************************************************************/
00018 
00019 /*
00020  * @unimplemented
00021  */
00022 INT
00023 WSPAPI
00024 WPUCompleteOverlappedRequest(IN SOCKET s,
00025                              IN LPWSAOVERLAPPED lpOverlapped,
00026                              IN DWORD dwError,
00027                              IN DWORD cbTransferred,
00028                              OUT LPINT lpErrno)
00029 {
00030     UNIMPLEMENTED;
00031     return 0;
00032 }
00033 
00034 /*
00035  * @unimplemented
00036  */
00037 BOOL
00038 WSPAPI
00039 WPUCloseEvent(IN WSAEVENT hEvent,
00040               OUT LPINT lpErrno)
00041 {
00042     UNIMPLEMENTED;
00043     return FALSE;
00044 }
00045 
00046 /*
00047  * @unimplemented
00048  */
00049 INT
00050 WSPAPI
00051 WPUCloseThread(IN LPWSATHREADID lpThreadId,
00052                OUT LPINT lpErrno)
00053 {
00054     UNIMPLEMENTED;
00055     return 0;
00056 }
00057 
00058 /*
00059  * @unimplemented
00060  */
00061 WSAEVENT
00062 WSPAPI
00063 WPUCreateEvent(OUT LPINT lpErrno)
00064 {
00065     UNIMPLEMENTED;
00066     return (WSAEVENT)0;
00067 }
00068 
00069 /*
00070  * @unimplemented
00071  */
00072 INT
00073 WSPAPI
00074 WPUOpenCurrentThread(OUT LPWSATHREADID lpThreadId,
00075                      OUT LPINT lpErrno)
00076 {
00077     UNIMPLEMENTED;
00078     return 0;
00079 }
00080 
00081 /*
00082  * @implemented
00083  */
00084 BOOL
00085 WSPAPI
00086 WPUPostMessage(IN HWND hWnd,
00087                IN UINT Msg,
00088                IN WPARAM wParam,
00089                IN LPARAM lParam)
00090 {
00091     /* Make sure we have a post routine */
00092     if (!WsSockPostRoutine) WsSockPostRoutine = PostMessage;
00093 
00094     /* Call it */
00095     return WsSockPostRoutine(hWnd, Msg, wParam, lParam);
00096 }
00097 
00098 /*
00099  * @implemented
00100  */
00101 INT
00102 WSPAPI
00103 WPUQueryBlockingCallback(IN DWORD dwCatalogEntryId,
00104                          OUT LPBLOCKINGCALLBACK FAR* lplpfnCallback,
00105                          OUT PDWORD_PTR lpdwContext,
00106                          OUT LPINT lpErrno)
00107 {
00108     PWSPROCESS Process;
00109     PWSTHREAD Thread;
00110     PTCATALOG Catalog;
00111     INT ErrorCode;
00112     INT Status;
00113     LPBLOCKINGCALLBACK Callback = NULL;
00114     PTCATALOG_ENTRY Entry;
00115     DWORD_PTR Context = 0;
00116     DPRINT("WPUQueryBlockingCallback: %lx \n", dwCatalogEntryId);
00117 
00118     /* Enter prolog */
00119     if ((ErrorCode = WsApiProlog(&Process, &Thread)) == ERROR_SUCCESS)
00120     {
00121         /* Get the callback function */
00122         Callback = Thread->BlockingCallback;
00123 
00124         /* Check if there is one */
00125         if (Callback)
00126         {
00127             /* Get the catalog */
00128             Catalog = WsProcGetTCatalog(Process);
00129 
00130             /* Find the entry for this ID */
00131             ErrorCode = WsTcGetEntryFromCatalogEntryId(Catalog,
00132                                                        dwCatalogEntryId,
00133                                                        &Entry);
00134 
00135             /* Check for success */
00136             if (ErrorCode == ERROR_SUCCESS)
00137             {
00138                 /* Get the context */
00139                 Context = (DWORD_PTR)Entry->Provider->Service.lpWSPCancelBlockingCall;
00140 
00141                 /* Dereference the entry */
00142                 WsTcEntryDereference(Entry);
00143             }
00144         }
00145     }
00146 
00147     /* Check error code */
00148     if (ErrorCode == ERROR_SUCCESS)
00149     {
00150         /* Return success as well */
00151         Status = ERROR_SUCCESS;
00152     }
00153     else
00154     {
00155         /* Return excpected value and no callback */
00156         Status = SOCKET_ERROR;
00157         Callback = NULL;
00158     }
00159 
00160     /* Return the settings */
00161     *lpdwContext = Context;
00162     *lpErrno = ErrorCode;
00163     *lplpfnCallback = Callback;
00164 
00165     /* Return to caller */
00166     return Status;
00167 }
00168 
00169 /*
00170  * @unimplemented
00171  */
00172 INT
00173 WSPAPI
00174 WPUQueueApc(IN LPWSATHREADID lpThreadId,
00175             IN LPWSAUSERAPC lpfnUserApc,
00176             IN DWORD_PTR dwContext,
00177             OUT LPINT lpErrno)
00178 {
00179     UNIMPLEMENTED;
00180     return 0;
00181 }
00182 
00183 /*
00184  * @unimplemented
00185  */
00186 BOOL
00187 WSPAPI
00188 WPUResetEvent(IN WSAEVENT hEvent,
00189               OUT LPINT lpErrno)
00190 {
00191     UNIMPLEMENTED;
00192     return FALSE;
00193 }
00194 
00195 /*
00196  * @unimplemented
00197  */
00198 BOOL
00199 WSPAPI
00200 WPUSetEvent(IN WSAEVENT hEvent,
00201             OUT LPINT lpErrno)
00202 {
00203     UNIMPLEMENTED;
00204     return FALSE;
00205 }

Generated on Sat May 26 2012 04:25:40 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.