1 /* Internet TCP/IP and IPX Connection For DirectPlay
3 * Copyright 2008 Ismael Barros Barros
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include "dpwsockx_dll.h"
27 #include "wine/debug.h"
29 #include "wine/dplaysp.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(dplay);
34 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
36 TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
40 case DLL_WINE_PREATTACH:
41 return FALSE; /* prefer native version */
42 case DLL_PROCESS_ATTACH:
43 /* TODO: Initialization */
44 DisableThreadLibraryCalls(hinstDLL);
46 case DLL_PROCESS_DETACH:
56 static HRESULT WINAPI DPWSCB_EnumSessions( LPDPSP_ENUMSESSIONSDATA data )
58 FIXME( "(%p,%d,%p,%u) stub\n",
59 data->lpMessage, data->dwMessageSize,
60 data->lpISP, data->bReturnStatus );
61 return DPERR_UNSUPPORTED;
64 static HRESULT WINAPI DPWSCB_Reply( LPDPSP_REPLYDATA data )
66 FIXME( "(%p,%p,%d,%d,%p) stub\n",
67 data->lpSPMessageHeader, data->lpMessage, data->dwMessageSize,
68 data->idNameServer, data->lpISP );
69 return DPERR_UNSUPPORTED;
72 static HRESULT WINAPI DPWSCB_Send( LPDPSP_SENDDATA data )
74 FIXME( "(0x%08x,%d,%d,%p,%d,%u,%p) stub\n",
75 data->dwFlags, data->idPlayerTo, data->idPlayerFrom,
76 data->lpMessage, data->dwMessageSize,
77 data->bSystemMessage, data->lpISP );
78 return DPERR_UNSUPPORTED;
81 static HRESULT WINAPI DPWSCB_CreatePlayer( LPDPSP_CREATEPLAYERDATA data )
83 FIXME( "(%d,0x%08x,%p,%p) stub\n",
84 data->idPlayer, data->dwFlags,
85 data->lpSPMessageHeader, data->lpISP );
86 return DPERR_UNSUPPORTED;
89 static HRESULT WINAPI DPWSCB_DeletePlayer( LPDPSP_DELETEPLAYERDATA data )
91 FIXME( "(%d,0x%08x,%p) stub\n",
92 data->idPlayer, data->dwFlags, data->lpISP );
93 return DPERR_UNSUPPORTED;
96 static HRESULT WINAPI DPWSCB_GetAddress( LPDPSP_GETADDRESSDATA data )
98 FIXME( "(%d,0x%08x,%p,%p,%p) stub\n",
99 data->idPlayer, data->dwFlags, data->lpAddress,
100 data->lpdwAddressSize, data->lpISP );
101 return DPERR_UNSUPPORTED;
104 static HRESULT WINAPI DPWSCB_GetCaps( LPDPSP_GETCAPSDATA data )
106 FIXME( "(%d,%p,0x%08x,%p)\n",
107 data->idPlayer, data->lpCaps, data->dwFlags, data->lpISP );
108 return DPERR_UNSUPPORTED;
111 static HRESULT WINAPI DPWSCB_Open( LPDPSP_OPENDATA data )
113 FIXME( "(%u,%p,%p,%u,0x%08x,0x%08x) stub\n",
114 data->bCreate, data->lpSPMessageHeader, data->lpISP,
115 data->bReturnStatus, data->dwOpenFlags, data->dwSessionFlags );
116 return DPERR_UNSUPPORTED;
119 static HRESULT WINAPI DPWSCB_CloseEx( LPDPSP_CLOSEDATA data )
121 FIXME( "(%p) stub\n", data->lpISP );
122 return DPERR_UNSUPPORTED;
125 static HRESULT WINAPI DPWSCB_ShutdownEx( LPDPSP_SHUTDOWNDATA data )
127 FIXME( "(%p) stub\n", data->lpISP );
128 return DPERR_UNSUPPORTED;
131 static HRESULT WINAPI DPWSCB_GetAddressChoices( LPDPSP_GETADDRESSCHOICESDATA data )
133 FIXME( "(%p,%p,%p) stub\n",
134 data->lpAddress, data->lpdwAddressSize, data->lpISP );
135 return DPERR_UNSUPPORTED;
138 static HRESULT WINAPI DPWSCB_SendEx( LPDPSP_SENDEXDATA data )
140 FIXME( "(%p,0x%08x,%d,%d,%p,%d,%d,%d,%d,%p,%p,%u) stub\n",
141 data->lpISP, data->dwFlags, data->idPlayerTo, data->idPlayerFrom,
142 data->lpSendBuffers, data->cBuffers, data->dwMessageSize,
143 data->dwPriority, data->dwTimeout, data->lpDPContext,
144 data->lpdwSPMsgID, data->bSystemMessage );
145 return DPERR_UNSUPPORTED;
148 static HRESULT WINAPI DPWSCB_SendToGroupEx( LPDPSP_SENDTOGROUPEXDATA data )
150 FIXME( "(%p,0x%08x,%d,%d,%p,%d,%d,%d,%d,%p,%p) stub\n",
151 data->lpISP, data->dwFlags, data->idGroupTo, data->idPlayerFrom,
152 data->lpSendBuffers, data->cBuffers, data->dwMessageSize,
153 data->dwPriority, data->dwTimeout, data->lpDPContext,
155 return DPERR_UNSUPPORTED;
158 static HRESULT WINAPI DPWSCB_Cancel( LPDPSP_CANCELDATA data )
160 FIXME( "(%p,0x%08x,%p,%d,0x%08x,0x%08x) stub\n",
161 data->lpISP, data->dwFlags, data->lprglpvSPMsgID, data->cSPMsgID,
162 data->dwMinPriority, data->dwMaxPriority );
163 return DPERR_UNSUPPORTED;
166 static HRESULT WINAPI DPWSCB_GetMessageQueue( LPDPSP_GETMESSAGEQUEUEDATA data )
168 FIXME( "(%p,0x%08x,%d,%d,%p,%p) stub\n",
169 data->lpISP, data->dwFlags, data->idFrom, data->idTo,
170 data->lpdwNumMsgs, data->lpdwNumBytes );
171 return DPERR_UNSUPPORTED;
174 static void setup_callbacks( LPDPSP_SPCALLBACKS lpCB )
176 lpCB->EnumSessions = DPWSCB_EnumSessions;
177 lpCB->Reply = DPWSCB_Reply;
178 lpCB->Send = DPWSCB_Send;
179 lpCB->CreatePlayer = DPWSCB_CreatePlayer;
180 lpCB->DeletePlayer = DPWSCB_DeletePlayer;
181 lpCB->GetAddress = DPWSCB_GetAddress;
182 lpCB->GetCaps = DPWSCB_GetCaps;
183 lpCB->Open = DPWSCB_Open;
184 lpCB->CloseEx = DPWSCB_CloseEx;
185 lpCB->ShutdownEx = DPWSCB_ShutdownEx;
186 lpCB->GetAddressChoices = DPWSCB_GetAddressChoices;
187 lpCB->SendEx = DPWSCB_SendEx;
188 lpCB->SendToGroupEx = DPWSCB_SendToGroupEx;
189 lpCB->Cancel = DPWSCB_Cancel;
190 lpCB->GetMessageQueue = DPWSCB_GetMessageQueue;
192 lpCB->AddPlayerToGroup = NULL;
194 lpCB->CreateGroup = NULL;
195 lpCB->DeleteGroup = NULL;
196 lpCB->RemovePlayerFromGroup = NULL;
197 lpCB->SendToGroup = NULL;
198 lpCB->Shutdown = NULL;
203 /******************************************************************
204 * SPInit (DPWSOCKX.1)
206 HRESULT WINAPI SPInit( LPSPINITDATA lpspData )
208 TRACE( "Initializing library for %s (%s)\n",
209 wine_dbgstr_guid(lpspData->lpGuid), debugstr_w(lpspData->lpszName) );
211 /* We only support TCP/IP service */
212 if ( !IsEqualGUID(lpspData->lpGuid, &DPSPGUID_TCPIP) )
214 return DPERR_UNAVAILABLE;
217 /* Assign callback functions */
218 setup_callbacks( lpspData->lpCB );