dpwsockx: Stub implementation.
[wine] / dlls / dpwsockx / dpwsockx_main.c
1 /* Internet TCP/IP and IPX Connection For DirectPlay
2  *
3  * Copyright 2008 Ismael Barros Barros
4  *
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.
9  *
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.
14  *
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
18  */
19
20 #include "config.h"
21
22 #include <stdarg.h>
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "dpwsockx_dll.h"
27 #include "wine/debug.h"
28 #include "dplay.h"
29 #include "wine/dplaysp.h"
30
31 WINE_DEFAULT_DEBUG_CHANNEL(dplay);
32
33
34 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
35 {
36     TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
37
38     switch (fdwReason)
39     {
40     case DLL_WINE_PREATTACH:
41         return FALSE;    /* prefer native version */
42     case DLL_PROCESS_ATTACH:
43         /* TODO: Initialization */
44         DisableThreadLibraryCalls(hinstDLL);
45         break;
46     case DLL_PROCESS_DETACH:
47         break;
48     default:
49         break;
50     }
51
52     return TRUE;
53 }
54
55
56 static HRESULT WINAPI DPWSCB_EnumSessions( LPDPSP_ENUMSESSIONSDATA data )
57 {
58     FIXME( "(%p,%d,%p,%u) stub\n",
59            data->lpMessage, data->dwMessageSize,
60            data->lpISP, data->bReturnStatus );
61     return DPERR_UNSUPPORTED;
62 }
63
64 static HRESULT WINAPI DPWSCB_Reply( LPDPSP_REPLYDATA data )
65 {
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;
70 }
71
72 static HRESULT WINAPI DPWSCB_Send( LPDPSP_SENDDATA data )
73 {
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;
79 }
80
81 static HRESULT WINAPI DPWSCB_CreatePlayer( LPDPSP_CREATEPLAYERDATA data )
82 {
83     FIXME( "(%d,0x%08x,%p,%p) stub\n",
84            data->idPlayer, data->dwFlags,
85            data->lpSPMessageHeader, data->lpISP );
86     return DPERR_UNSUPPORTED;
87 }
88
89 static HRESULT WINAPI DPWSCB_DeletePlayer( LPDPSP_DELETEPLAYERDATA data )
90 {
91     FIXME( "(%d,0x%08x,%p) stub\n",
92            data->idPlayer, data->dwFlags, data->lpISP );
93     return DPERR_UNSUPPORTED;
94 }
95
96 static HRESULT WINAPI DPWSCB_GetAddress( LPDPSP_GETADDRESSDATA data )
97 {
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;
102 }
103
104 static HRESULT WINAPI DPWSCB_GetCaps( LPDPSP_GETCAPSDATA data )
105 {
106     FIXME( "(%d,%p,0x%08x,%p)\n",
107            data->idPlayer, data->lpCaps, data->dwFlags, data->lpISP );
108     return DPERR_UNSUPPORTED;
109 }
110
111 static HRESULT WINAPI DPWSCB_Open( LPDPSP_OPENDATA data )
112 {
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;
117 }
118
119 static HRESULT WINAPI DPWSCB_CloseEx( LPDPSP_CLOSEDATA data )
120 {
121     FIXME( "(%p) stub\n", data->lpISP );
122     return DPERR_UNSUPPORTED;
123 }
124
125 static HRESULT WINAPI DPWSCB_ShutdownEx( LPDPSP_SHUTDOWNDATA data )
126 {
127     FIXME( "(%p) stub\n", data->lpISP );
128     return DPERR_UNSUPPORTED;
129 }
130
131 static HRESULT WINAPI DPWSCB_GetAddressChoices( LPDPSP_GETADDRESSCHOICESDATA data )
132 {
133     FIXME( "(%p,%p,%p) stub\n",
134            data->lpAddress, data->lpdwAddressSize, data->lpISP );
135     return DPERR_UNSUPPORTED;
136 }
137
138 static HRESULT WINAPI DPWSCB_SendEx( LPDPSP_SENDEXDATA data )
139 {
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;
146 }
147
148 static HRESULT WINAPI DPWSCB_SendToGroupEx( LPDPSP_SENDTOGROUPEXDATA data )
149 {
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,
154            data->lpdwSPMsgID );
155     return DPERR_UNSUPPORTED;
156 }
157
158 static HRESULT WINAPI DPWSCB_Cancel( LPDPSP_CANCELDATA data )
159 {
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;
164 }
165
166 static HRESULT WINAPI DPWSCB_GetMessageQueue( LPDPSP_GETMESSAGEQUEUEDATA data )
167 {
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;
172 }
173
174 static void setup_callbacks( LPDPSP_SPCALLBACKS lpCB )
175 {
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;
191
192     lpCB->AddPlayerToGroup       = NULL;
193     lpCB->Close                  = NULL;
194     lpCB->CreateGroup            = NULL;
195     lpCB->DeleteGroup            = NULL;
196     lpCB->RemovePlayerFromGroup  = NULL;
197     lpCB->SendToGroup            = NULL;
198     lpCB->Shutdown               = NULL;
199 }
200
201
202
203 /******************************************************************
204  *              SPInit (DPWSOCKX.1)
205  */
206 HRESULT WINAPI SPInit( LPSPINITDATA lpspData )
207 {
208     TRACE( "Initializing library for %s (%s)\n",
209            wine_dbgstr_guid(lpspData->lpGuid), debugstr_w(lpspData->lpszName) );
210
211     /* We only support TCP/IP service */
212     if ( !IsEqualGUID(lpspData->lpGuid, &DPSPGUID_TCPIP) )
213     {
214         return DPERR_UNAVAILABLE;
215     }
216
217     /* Assign callback functions */
218     setup_callbacks( lpspData->lpCB );
219
220     return DP_OK;
221 }