ReactOS 0.4.17-dev-966-gf06eace
dplaysp.c
Go to the documentation of this file.
1/* This contains the implementation of the interface Service
2 * Providers require to communicate with Direct Play
3 *
4 * Copyright 2000 Peter Hunnisett
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include <string.h>
22#include "winerror.h"
23#include "wine/debug.h"
24
25#include "wine/dplaysp.h"
26#include "dplay_global.h"
27#include "name_server.h"
28#include "dplayx_messages.h"
29
30#include "dplayx_global.h" /* FIXME: For global hack */
31
32/* FIXME: Need to add interface locking inside procedures */
33
35
36typedef struct IDirectPlaySPImpl
37{
38 IDirectPlaySP IDirectPlaySP_iface;
44 IDirectPlayImpl *dplay; /* FIXME: This should perhaps be iface not impl */
46
47/* This structure is passed to the DP object for safe keeping */
48typedef struct tagDP_SPPLAYERDATA
49{
52
56
57
58static inline IDirectPlaySPImpl *impl_from_IDirectPlaySP( IDirectPlaySP *iface )
59{
60 return CONTAINING_RECORD( iface, IDirectPlaySPImpl, IDirectPlaySP_iface );
61}
62
64 void **ppv )
65{
66 TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid( riid ), ppv );
67
68 if ( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDirectPlaySP, riid ) )
69 {
70 *ppv = iface;
71 IDirectPlaySP_AddRef( iface );
72 return S_OK;
73 }
74
75 FIXME( "Unsupported interface %s\n", debugstr_guid( riid ) );
76 *ppv = NULL;
77 return E_NOINTERFACE;
78}
79
80static ULONG WINAPI IDirectPlaySPImpl_AddRef( IDirectPlaySP *iface )
81{
84
85 TRACE( "(%p) ref=%ld\n", This, ref );
86
87 return ref;
88}
89
90static ULONG WINAPI IDirectPlaySPImpl_Release( IDirectPlaySP *iface )
91{
94
95 TRACE( "(%p) ref=%ld\n", This, ref );
96
97 if( !ref )
98 {
99 free( This->remote_data );
100 free( This->local_data );
101 free( This );
102 }
103
104 return ref;
105}
106
107static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry( IDirectPlaySP *iface, LPCWSTR lpSection,
108 LPCWSTR lpKey, const void *lpData, DWORD dwDataSize, DWORD dwMaxEntries )
109{
111
112 /* Should be able to call the comctl32 undocumented MRU routines.
113 I suspect that the interface works appropriately */
114 FIXME( "(%p)->(%p,%p%p,0x%08lx,0x%08lx): stub\n",
115 This, lpSection, lpKey, lpData, dwDataSize, dwMaxEntries );
116
117 return DP_OK;
118}
119
120static HRESULT WINAPI IDirectPlaySPImpl_CreateAddress( IDirectPlaySP *iface, REFGUID guidSP,
121 REFGUID guidDataType, const void *lpData, DWORD dwDataSize, void *lpAddress,
122 DWORD *lpdwAddressSize )
123{
125
126 FIXME( "(%p)->(%s,%s,%p,0x%08lx,%p,%p): stub\n",
127 This, debugstr_guid(guidSP), debugstr_guid(guidDataType),
128 lpData, dwDataSize, lpAddress, lpdwAddressSize );
129
130 return DP_OK;
131}
132
133static HRESULT WINAPI IDirectPlaySPImpl_EnumAddress( IDirectPlaySP *iface,
134 LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, const void *lpAddress, DWORD dwAddressSize,
135 void *lpContext )
136{
138
139 TRACE( "(%p)->(%p,%p,0x%08lx,%p)\n",
140 This, lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
141
142 DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
143
144 return DP_OK;
145}
146
147static HRESULT WINAPI IDirectPlaySPImpl_EnumMRUEntries( IDirectPlaySP *iface, LPCWSTR lpSection,
148 LPCWSTR lpKey, LPENUMMRUCALLBACK lpEnumMRUCallback, void *lpContext )
149{
151
152 /* Should be able to call the comctl32 undocumented MRU routines.
153 I suspect that the interface works appropriately */
154 FIXME( "(%p)->(%p,%p,%p,%p): stub\n",
155 This, lpSection, lpKey, lpEnumMRUCallback, lpContext );
156
157 return DP_OK;
158}
159
160static HRESULT WINAPI IDirectPlaySPImpl_GetPlayerFlags( IDirectPlaySP *iface, DPID idPlayer,
161 DWORD *lpdwPlayerFlags )
162{
164
165 FIXME( "(%p)->(0x%08lx,%p): stub\n",
166 This, idPlayer, lpdwPlayerFlags );
167
168 return DP_OK;
169}
170
171static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData( IDirectPlaySP *iface, DPID idPlayer,
172 void **lplpData, DWORD *lpdwDataSize, DWORD dwFlags )
173{
175 HRESULT hr;
177
178 TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx)\n",
179 This, idPlayer, lplpData, lpdwDataSize, dwFlags );
180
181 hr = DP_GetSPPlayerData( This->dplay, idPlayer, (void**)&lpPlayerData );
182
183 if( FAILED(hr) )
184 {
185 TRACE( "Couldn't get player data: %s\n", DPLAYX_HresultToString(hr) );
186 return DPERR_INVALIDPLAYER;
187 }
188
189 /* What to do in the case where there is nothing set yet? */
190 if( dwFlags == DPSET_LOCAL )
191 {
192 *lplpData = lpPlayerData->lpPlayerLocalData;
193 *lpdwDataSize = lpPlayerData->dwPlayerLocalDataSize;
194 }
195 else if( dwFlags == DPSET_REMOTE )
196 {
197 *lplpData = lpPlayerData->lpPlayerRemoteData;
198 *lpdwDataSize = lpPlayerData->dwPlayerRemoteDataSize;
199 }
200
201 if( *lplpData == NULL )
202 {
204 }
205
206 return hr;
207}
208
209static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage( IDirectPlaySP *iface, void *lpMessageBody,
210 DWORD dwMessageBodySize, void *lpMessageHeader )
211{
213 LPDPMSG_SENDENVELOPE lpMsg = lpMessageBody;
215 WORD wCommandId;
216 WORD wVersion;
218
219 TRACE( "(%p)->(%p,0x%08lx,%p)\n",
220 This, lpMessageBody, dwMessageBodySize, lpMessageHeader );
221
222 if ( dwMessageBodySize < sizeof( DPMSG_SENDENVELOPE ) )
223 return DPERR_GENERIC;
224
225 if ( lpMsg->dwMagic != DPMSGMAGIC_DPLAYMSG )
226 {
227 LPDPMSG_SYSMSGENVELOPE gameMsg = lpMessageBody;
228 return DP_HandleGameMessage( This->dplay, lpMessageBody, dwMessageBodySize,
229 gameMsg->dwPlayerFrom, gameMsg->dwPlayerTo );
230 }
231
232 wCommandId = lpMsg->wCommandId;
233 wVersion = lpMsg->wVersion;
234
235 TRACE( "Incoming message has envelope of 0x%08lx, %u, %u\n",
236 lpMsg->dwMagic, wCommandId, wVersion );
237
238 if( lpMsg->dwMagic != DPMSGMAGIC_DPLAYMSG )
239 {
240 ERR( "Unknown magic 0x%08lx!\n", lpMsg->dwMagic );
241 return DPERR_GENERIC;
242 }
243
244#if 0
245 {
246 const LPDWORD lpcHeader = lpMessageHeader;
247
248 TRACE( "lpMessageHeader = [0x%08lx] [0x%08lx] [0x%08lx] [0x%08lx] [0x%08lx]\n",
249 lpcHeader[0], lpcHeader[1], lpcHeader[2], lpcHeader[3], lpcHeader[4] );
250 }
251#endif
252
253 /* Pass everything else to Direct Play */
254 data.lpMessage = NULL;
255 data.dwMessageSize = 0;
256
257 /* Pass this message to the dplay interface to handle */
258 hr = DP_HandleMessage( This->dplay, lpMessageBody, dwMessageBodySize, lpMessageHeader,
259 wCommandId, wVersion, &data.lpMessage, &data.dwMessageSize );
260
261 if( FAILED(hr) )
262 {
263 ERR( "Command processing failed %s\n", DPLAYX_HresultToString(hr) );
264 }
265
266 /* Do we want a reply? */
267 if( data.lpMessage != NULL )
268 {
269 data.lpSPMessageHeader = lpMessageHeader;
270 data.idNameServer = 0;
271 data.lpISP = iface;
272
273 hr = This->dplay->dp2->spData.lpCB->Reply( &data );
274
275 if( FAILED(hr) )
276 {
277 ERR( "Reply failed %s\n", DPLAYX_HresultToString(hr) );
278 }
279 }
280
281 return hr;
282
283#if 0
284 HRESULT hr = DP_OK;
285 HANDLE hReceiveEvent = 0;
286 /* FIXME: Acquire some sort of interface lock */
287 /* FIXME: Need some sort of context for this callback. Need to determine
288 * how this is actually done with the SP
289 */
290 /* FIXME: Who needs to delete the message when done? */
291 switch( lpMsg->dwType )
292 {
294 {
296
297 if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
298 {
299 hr = DP_IF_CreatePlayer( This, lpMessageHeader, msg->dpId,
300 &msg->dpnName, 0, msg->lpData,
301 msg->dwDataSize, msg->dwFlags, ... );
302 }
303 else if( msg->dwPlayerType == DPPLAYERTYPE_GROUP )
304 {
305 /* Group in group situation? */
306 if( msg->dpIdParent == DPID_NOPARENT_GROUP )
307 {
308 hr = DP_IF_CreateGroup( This, lpMessageHeader, msg->dpId,
309 &msg->dpnName, 0, msg->lpData,
310 msg->dwDataSize, msg->dwFlags, ... );
311 }
312 else /* Group in Group */
313 {
314 hr = DP_IF_CreateGroupInGroup( This, lpMessageHeader, msg->dpIdParent,
315 &msg->dpnName, 0, msg->lpData,
316 msg->dwDataSize, msg->dwFlags, ... );
317 }
318 }
319 else /* Hmmm? */
320 {
321 ERR( "Corrupt msg->dwPlayerType for DPSYS_CREATEPLAYERORGROUP\n" );
322 return;
323 }
324
325 break;
326 }
327
329 {
331
332 if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
333 {
334 hr = DP_IF_DestroyPlayer( This, msg->dpId, ... );
335 }
336 else if( msg->dwPlayerType == DPPLAYERTYPE_GROUP )
337 {
338 hr = DP_IF_DestroyGroup( This, msg->dpId, ... );
339 }
340 else /* Hmmm? */
341 {
342 ERR( "Corrupt msg->dwPlayerType for DPSYS_DESTROYPLAYERORGROUP\n" );
343 return;
344 }
345
346 break;
347 }
348
350 {
352
353 hr = DP_IF_AddPlayerToGroup( This, msg->dpIdGroup, msg->dpIdPlayer, ... );
354 break;
355 }
356
358 {
360
361 hr = DP_IF_DeletePlayerFromGroup( This, msg->dpIdGroup, msg->dpIdPlayer,
362 ... );
363
364 break;
365 }
366
368 {
369 LPDPMSG_SESSIONLOST msg = lpMsg;
370
371 FIXME( "DPSYS_SESSIONLOST not handled\n" );
372
373 break;
374 }
375
376 case DPSYS_HOST:
377 {
378 LPDPMSG_HOST msg = lpMsg;
379
380 FIXME( "DPSYS_HOST not handled\n" );
381
382 break;
383 }
384
386 {
388
389 if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
390 {
391 hr = DP_IF_SetPlayerData( This, msg->dpId, msg->lpData, msg->dwDataSize, DPSET_REMOTE, ... );
392 }
393 else if( msg->dwPlayerType == DPPLAYERTYPE_GROUP )
394 {
395 hr = DP_IF_SetGroupData( This, msg->dpId, msg->lpData, msg->dwDataSize,
396 DPSET_REMOTE, ... );
397 }
398 else /* Hmmm? */
399 {
400 ERR( "Corrupt msg->dwPlayerType for LPDPMSG_SETPLAYERORGROUPDATA\n" );
401 return;
402 }
403
404 break;
405 }
406
408 {
410
411 if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
412 {
413 hr = DP_IF_SetPlayerName( This, msg->dpId, msg->dpnName, ... );
414 }
415 else if( msg->dwPlayerType == DPPLAYERTYPE_GROUP )
416 {
417 hr = DP_IF_SetGroupName( This, msg->dpId, msg->dpnName, ... );
418 }
419 else /* Hmmm? */
420 {
421 ERR( "Corrupt msg->dwPlayerType for LPDPMSG_SETPLAYERORGROUPDATA\n" );
422 return;
423 }
424
425 break;
426 }
427
429 {
431
432 hr = DP_IF_SetSessionDesc( This, &msg->dpDesc );
433
434 break;
435 }
436
438 {
440
441 hr = DP_IF_AddGroupToGroup( This, msg->dpIdParentGroup, msg->dpIdGroup,
442 ... );
443
444 break;
445 }
446
448 {
450
451 hr = DP_IF_DeleteGroupFromGroup( This, msg->dpIdParentGroup,
452 msg->dpIdGroup, ... );
453
454 break;
455 }
456
458 {
460
461 FIXME( "DPSYS_SECUREMESSAGE not implemented\n" );
462
463 break;
464 }
465
467 {
469
470 FIXME( "DPSYS_STARTSESSION not implemented\n" );
471
472 break;
473 }
474
475 case DPSYS_CHAT:
476 {
477 LPDPMSG_CHAT msg = lpMsg;
478
479 FIXME( "DPSYS_CHAT not implemented\n" );
480
481 break;
482 }
483
485 {
487
488 FIXME( "DPSYS_SETGROUPOWNER not implemented\n" );
489
490 break;
491 }
492
494 {
496
497 FIXME( "DPSYS_SENDCOMPLETE not implemented\n" );
498
499 break;
500 }
501
502 default:
503 {
504 /* NOTE: This should be a user defined type. There is nothing that we
505 * need to do with it except queue it.
506 */
507 TRACE( "Received user message type(?) 0x%08lx through SP.\n",
508 lpMsg->dwType );
509 break;
510 }
511 }
512
513 FIXME( "Queue message in the receive queue. Need some context data!\n" );
514
515 if( FAILED(hr) )
516 {
517 ERR( "Unable to perform action for msg type 0x%08lx\n", lpMsg->dwType );
518 }
519 /* If a receive event was registered for this player, invoke it */
520 if( hReceiveEvent )
521 {
522 SetEvent( hReceiveEvent );
523 }
524#endif
525}
526
527static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData( IDirectPlaySP *iface, DPID idPlayer,
528 void *lpData, DWORD dwDataSize, DWORD dwFlags )
529{
531 HRESULT hr;
532 LPDP_SPPLAYERDATA lpPlayerEntry;
534
535 TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx)\n", This, idPlayer, lpData, dwDataSize, dwFlags );
536
537 hr = DP_GetSPPlayerData( This->dplay, idPlayer, (void**)&lpPlayerEntry );
538 if( FAILED(hr) )
539 {
540 /* Player must not exist */
541 return DPERR_INVALIDPLAYER;
542 }
543
544 lpPlayerData = malloc( dwDataSize );
545 CopyMemory( lpPlayerData, lpData, dwDataSize );
546
547 if( dwFlags == DPSET_LOCAL )
548 {
549 lpPlayerEntry->lpPlayerLocalData = lpPlayerData;
550 lpPlayerEntry->dwPlayerLocalDataSize = dwDataSize;
551 }
552 else if( dwFlags == DPSET_REMOTE )
553 {
554 lpPlayerEntry->lpPlayerRemoteData = lpPlayerData;
555 lpPlayerEntry->dwPlayerRemoteDataSize = dwDataSize;
556 }
557
558 hr = DP_SetSPPlayerData( This->dplay, idPlayer, lpPlayerEntry );
559
560 return hr;
561}
562
564 const DPCOMPOUNDADDRESSELEMENT *lpElements, DWORD dwElementCount, void *lpAddress,
565 DWORD *lpdwAddressSize )
566{
568
569 FIXME( "(%p)->(%p,0x%08lx,%p,%p): stub\n",
570 This, lpElements, dwElementCount, lpAddress, lpdwAddressSize );
571
572 return DP_OK;
573}
574
575static HRESULT WINAPI IDirectPlaySPImpl_GetSPData( IDirectPlaySP *iface, void **lplpData,
576 DWORD *lpdwDataSize, DWORD dwFlags )
577{
579 HRESULT hr = DP_OK;
580
581 TRACE( "(%p)->(%p,%p,0x%08lx)\n", This, lplpData, lpdwDataSize, dwFlags );
582
583#if 0
584 /* This is what the documentation says... */
585 if( dwFlags != DPSET_REMOTE )
586 {
587 return DPERR_INVALIDPARAMS;
588 }
589#else
590 /* ... but most service providers call this with 1 */
591 /* Guess that this is using a DPSET_LOCAL or DPSET_REMOTE type of
592 * thing?
593 */
594 if( dwFlags != DPSET_REMOTE )
595 {
596 TRACE( "Undocumented dwFlags 0x%08lx used\n", dwFlags );
597 }
598#endif
599
600 /* FIXME: What to do in the case where this isn't initialized yet? */
601
602 /* Yes, we're supposed to return a pointer to the memory we have stored! */
603 if( dwFlags == DPSET_REMOTE )
604 {
605 *lpdwDataSize = This->remote_data_size;
606 *lplpData = This->remote_data;
607
608 if( !This->remote_data )
610 }
611 else if( dwFlags == DPSET_LOCAL )
612 {
613 *lpdwDataSize = This->local_data_size;
614 *lplpData = This->local_data;
615
616 if( !This->local_data )
618 }
619
620 return hr;
621}
622
623static HRESULT WINAPI IDirectPlaySPImpl_SetSPData( IDirectPlaySP *iface, void *lpData,
624 DWORD dwDataSize, DWORD dwFlags )
625{
627 LPVOID lpSpData;
628
629 TRACE( "(%p)->(%p,0x%08lx,0x%08lx)\n", This, lpData, dwDataSize, dwFlags );
630
631#if 0
632 /* This is what the documentation says... */
633 if( dwFlags != DPSET_REMOTE )
634 {
635 return DPERR_INVALIDPARAMS;
636 }
637#else
638 /* ... but most service providers call this with 1 */
639 /* Guess that this is using a DPSET_LOCAL or DPSET_REMOTE type of
640 * thing?
641 */
642 if( dwFlags != DPSET_REMOTE )
643 {
644 TRACE( "Undocumented dwFlags 0x%08lx used\n", dwFlags );
645 }
646#endif
647
648 lpSpData = malloc( dwDataSize );
649 CopyMemory( lpSpData, lpData, dwDataSize );
650
651 /* If we have data already allocated, free it and replace it */
652 if( dwFlags == DPSET_REMOTE )
653 {
654 free( This->remote_data );
655 This->remote_data_size = dwDataSize;
656 This->remote_data = lpSpData;
657 }
658 else if ( dwFlags == DPSET_LOCAL )
659 {
660 free( This->local_data );
661 This->local_data = lpSpData;
662 This->local_data_size = dwDataSize;
663 }
664
665 return DP_OK;
666}
667
668static void WINAPI IDirectPlaySPImpl_SendComplete( IDirectPlaySP *iface, void *unknownA,
669 DWORD unknownB )
670{
672
673 FIXME( "(%p)->(%p,0x%08lx): stub\n",
674 This, unknownA, unknownB );
675}
676
677static const IDirectPlaySPVtbl directPlaySPVT =
678{
694};
695
697{
699 HRESULT hr;
700
701 TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
702
703 *ppv = NULL;
704 obj = calloc( 1, sizeof( *obj ) );
705 if ( !obj )
706 return DPERR_OUTOFMEMORY;
707
708 obj->IDirectPlaySP_iface.lpVtbl = &directPlaySPVT;
709 obj->ref = 1;
710 obj->dplay = dp;
711
712 hr = IDirectPlaySP_QueryInterface( &obj->IDirectPlaySP_iface, riid, ppv );
713 IDirectPlaySP_Release( &obj->IDirectPlaySP_iface );
714
715 return hr;
716}
717
718/* DP external interfaces to call into DPSP interface */
719
720/* Allocate the structure */
722{
723 TRACE( "Creating SPPlayer data struct\n" );
724 return calloc( 1, sizeof( DP_SPPLAYERDATA ) );
725}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
static LPCTSTR lpKey
Definition: virtmem.c:102
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
static HRESULT DP_IF_DestroyPlayer(IDirectPlayImpl *This, void *lpMsgHdr, DPID idPlayer, BOOL bAnsi)
Definition: dplay.c:2487
HRESULT DP_SetSPPlayerData(IDirectPlayImpl *lpDP, DPID idPlayer, void *lpData)
Definition: dplay.c:6490
static HRESULT DP_IF_CreateGroup(IDirectPlayImpl *This, void *lpMsgHdr, DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi)
Definition: dplay.c:1578
HRESULT DP_HandleMessage(IDirectPlayImpl *This, void *messageBody, DWORD dwMessageBodySize, void *messageHeader, WORD wCommandId, WORD wVersion, void **lplpReply, DWORD *lpdwMsgSize)
Definition: dplay.c:453
static HRESULT DP_IF_CreateGroupInGroup(IDirectPlayImpl *This, void *lpMsgHdr, DPID idParentGroup, DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi)
Definition: dplay.c:4665
static HRESULT DP_IF_SetPlayerName(IDirectPlayImpl *This, DPID idPlayer, DPNAME *lpPlayerName, DWORD dwFlags, BOOL bAnsi)
Definition: dplay.c:4377
static HRESULT DP_IF_CreatePlayer(IDirectPlayImpl *This, DPID *lpidPlayer, DPNAME *lpPlayerName, HANDLE hEvent, void *lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi)
Definition: dplay.c:2103
static HRESULT DP_IF_DestroyGroup(IDirectPlayImpl *This, void *lpMsgHdr, DPID idGroup, BOOL bAnsi)
Definition: dplay.c:2387
#define DPID_NOPARENT_GROUP
Definition: dplay.c:74
static HRESULT DP_IF_SetGroupName(IDirectPlayImpl *This, DPID idGroup, DPNAME *lpGroupName, DWORD dwFlags, BOOL bAnsi)
Definition: dplay.c:4214
HRESULT DP_HandleGameMessage(IDirectPlayImpl *This, void *messageBody, DWORD messageBodySize, DPID fromId, DPID toId)
Definition: dplay.c:695
HRESULT DP_GetSPPlayerData(IDirectPlayImpl *lpDP, DPID idPlayer, void **lplpData)
Definition: dplay.c:6462
#define DPERR_GENERIC
Definition: dplay.h:99
#define DPPLAYERTYPE_PLAYER
Definition: dplay.h:1135
#define DPSET_REMOTE
Definition: dplay.h:1056
#define DPSYS_SETSESSIONDESC
Definition: dplay.h:1109
#define DPSYS_CHAT
Definition: dplay.h:1124
#define DPSYS_DESTROYPLAYERORGROUP
Definition: dplay.h:1088
#define DPSET_LOCAL
Definition: dplay.h:1057
#define DPSYS_SECUREMESSAGE
Definition: dplay.h:1118
#define DPSYS_SENDCOMPLETE
Definition: dplay.h:1130
#define DPSYS_SETGROUPOWNER
Definition: dplay.h:1127
#define DPPLAYERTYPE_GROUP
Definition: dplay.h:1134
#define DP_OK
Definition: dplay.h:88
#define DPSYS_SETPLAYERORGROUPDATA
Definition: dplay.h:1103
#define DPSYS_HOST
Definition: dplay.h:1100
#define DPSYS_ADDGROUPTOGROUP
Definition: dplay.h:1112
#define DPSYS_DELETEPLAYERFROMGROUP
Definition: dplay.h:1094
DWORD DPID
Definition: dplay.h:158
#define DPERR_INVALIDPLAYER
Definition: dplay.h:104
#define DPSYS_DELETEGROUPFROMGROUP
Definition: dplay.h:1115
#define DPERR_INVALIDPARAMS
Definition: dplay.h:103
#define DPSYS_CREATEPLAYERORGROUP
Definition: dplay.h:1085
#define DPERR_OUTOFMEMORY
Definition: dplay.h:109
#define DPSYS_SESSIONLOST
Definition: dplay.h:1097
#define DPSYS_SETPLAYERORGROUPNAME
Definition: dplay.h:1106
#define DPSYS_ADDPLAYERTOGROUP
Definition: dplay.h:1091
#define DPSYS_STARTSESSION
Definition: dplay.h:1121
struct PlayerData * lpPlayerData
Definition: dplay_global.h:100
HRESULT DPL_EnumAddress(LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext)
Definition: dplobby.c:368
static void WINAPI IDirectPlaySPImpl_SendComplete(IDirectPlaySP *iface, void *unknownA, DWORD unknownB)
Definition: dplaysp.c:668
static IDirectPlaySPImpl * impl_from_IDirectPlaySP(IDirectPlaySP *iface)
Definition: dplaysp.c:58
LPVOID DPSP_CreateSPPlayerData(void)
Definition: dplaysp.c:721
static HRESULT WINAPI IDirectPlaySPImpl_GetSPData(IDirectPlaySP *iface, void **lplpData, DWORD *lpdwDataSize, DWORD dwFlags)
Definition: dplaysp.c:575
static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage(IDirectPlaySP *iface, void *lpMessageBody, DWORD dwMessageBodySize, void *lpMessageHeader)
Definition: dplaysp.c:209
static HRESULT WINAPI IDirectPlaySPImpl_CreateCompoundAddress(IDirectPlaySP *iface, const DPCOMPOUNDADDRESSELEMENT *lpElements, DWORD dwElementCount, void *lpAddress, DWORD *lpdwAddressSize)
Definition: dplaysp.c:563
static HRESULT WINAPI IDirectPlaySPImpl_GetPlayerFlags(IDirectPlaySP *iface, DPID idPlayer, DWORD *lpdwPlayerFlags)
Definition: dplaysp.c:160
static ULONG WINAPI IDirectPlaySPImpl_AddRef(IDirectPlaySP *iface)
Definition: dplaysp.c:80
static ULONG WINAPI IDirectPlaySPImpl_Release(IDirectPlaySP *iface)
Definition: dplaysp.c:90
struct tagDP_SPPLAYERDATA * LPDP_SPPLAYERDATA
static HRESULT WINAPI IDirectPlaySPImpl_EnumMRUEntries(IDirectPlaySP *iface, LPCWSTR lpSection, LPCWSTR lpKey, LPENUMMRUCALLBACK lpEnumMRUCallback, void *lpContext)
Definition: dplaysp.c:147
static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData(IDirectPlaySP *iface, DPID idPlayer, void *lpData, DWORD dwDataSize, DWORD dwFlags)
Definition: dplaysp.c:527
static HRESULT WINAPI IDirectPlaySPImpl_QueryInterface(IDirectPlaySP *iface, REFIID riid, void **ppv)
Definition: dplaysp.c:63
static const IDirectPlaySPVtbl directPlaySPVT
Definition: dplaysp.c:677
static HRESULT WINAPI IDirectPlaySPImpl_EnumAddress(IDirectPlaySP *iface, LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, const void *lpAddress, DWORD dwAddressSize, void *lpContext)
Definition: dplaysp.c:133
HRESULT dplaysp_create(REFIID riid, void **ppv, IDirectPlayImpl *dp)
Definition: dplaysp.c:696
static HRESULT WINAPI IDirectPlaySPImpl_CreateAddress(IDirectPlaySP *iface, REFGUID guidSP, REFGUID guidDataType, const void *lpData, DWORD dwDataSize, void *lpAddress, DWORD *lpdwAddressSize)
Definition: dplaysp.c:120
struct tagDP_SPPLAYERDATA DP_SPPLAYERDATA
static HRESULT WINAPI IDirectPlaySPImpl_SetSPData(IDirectPlaySP *iface, void *lpData, DWORD dwDataSize, DWORD dwFlags)
Definition: dplaysp.c:623
static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry(IDirectPlaySP *iface, LPCWSTR lpSection, LPCWSTR lpKey, const void *lpData, DWORD dwDataSize, DWORD dwMaxEntries)
Definition: dplaysp.c:107
static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData(IDirectPlaySP *iface, DPID idPlayer, void **lplpData, DWORD *lpdwDataSize, DWORD dwFlags)
Definition: dplaysp.c:171
#define IDirectPlaySP_QueryInterface(p, a, b)
Definition: dplaysp.h:95
BOOL(CALLBACK * LPENUMMRUCALLBACK)(LPCVOID lpData, DWORD dwDataSize, LPVOID lpContext)
Definition: dplaysp.h:35
#define IDirectPlaySP_Release(p)
Definition: dplaysp.h:97
#define IDirectPlaySP_AddRef(p)
Definition: dplaysp.h:96
LPCSTR DPLAYX_HresultToString(HRESULT hr)
#define DPMSGMAGIC_DPLAYMSG
BOOL(CALLBACK * LPDPENUMADDRESSCALLBACK)(REFGUID guidDataType, DWORD dwDataSize, LPCVOID lpData, LPVOID lpContext)
Definition: dplobby.h:352
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define CopyMemory
Definition: minwinbase.h:29
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define calloc
Definition: rosglue.h:14
#define TRACE(s)
Definition: solgame.cpp:4
IDirectPlayImpl * dplay
Definition: dplaysp.c:44
DWORD local_data_size
Definition: dplaysp.c:43
IDirectPlaySP IDirectPlaySP_iface
Definition: dplaysp.c:38
void * local_data
Definition: dplaysp.c:42
DWORD remote_data_size
Definition: dplaysp.c:41
void * remote_data
Definition: dplaysp.c:40
Definition: scsiwmi.h:51
Definition: send.c:48
DWORD dwPlayerRemoteDataSize
Definition: dplaysp.c:54
DWORD dwPlayerLocalDataSize
Definition: dplaysp.c:51
LPVOID lpPlayerRemoteData
Definition: dplaysp.c:53
LPVOID lpPlayerLocalData
Definition: dplaysp.c:50
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:669
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint32_t * LPDWORD
Definition: typedefs.h:59
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479