ReactOS 0.4.17-dev-966-gf06eace
dplobby.c
Go to the documentation of this file.
1/* Direct Play Lobby 2 & 3 Implementation
2 *
3 * Copyright 1998,1999,2000 - Peter Hunnisett
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#include <stdarg.h>
20#include <string.h>
21
22#define COBJMACROS
23#include "windef.h"
24#include "winbase.h"
25#include "winerror.h"
26#include "winreg.h"
27#include "winnls.h"
28#include "wine/debug.h"
29
30#include "dplayx_global.h"
31#include "dplayx_messages.h"
32#include "dplayx_queue.h"
33#include "dplobby.h"
34
36
37/* Forward declarations for this module helper methods */
39 LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface );
40
41static HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize,
42 LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface );
43
44
45/*****************************************************************************
46 * IDirectPlayLobby {1,2,3} implementation structure
47 *
48 * The philosophy behind this extra pointer dereference is that I wanted to
49 * have the same structure for all types of objects without having to do
50 * a lot of casting. I also only wanted to implement an interface in the
51 * object it was "released" with IUnknown interface being implemented in the 1 version.
52 * Of course, with these new interfaces comes the data required to keep the state required
53 * by these interfaces. So, basically, the pointers contain the data associated with
54 * a release. If you use the data associated with release 3 in a release 2 object, you'll
55 * get a run time trap, as that won't have any data.
56 *
57 */
58struct DPLMSG
59{
60 DPQ_ENTRY( DPLMSG ) msgs; /* Link to next queued message */
61};
62typedef struct DPLMSG* LPDPLMSG;
63
65{
66 IDirectPlayLobby3 IDirectPlayLobby3_iface;
72 DPQ_HEAD( DPLMSG ) msgs; /* List of messages received */
74
75static inline IDirectPlayLobbyImpl *impl_from_IDirectPlayLobby3( IDirectPlayLobby3 *iface )
76{
77 return CONTAINING_RECORD( iface, IDirectPlayLobbyImpl, IDirectPlayLobby3_iface );
78}
79
81{
82 return CONTAINING_RECORD( iface, IDirectPlayLobbyImpl, IDirectPlayLobby3A_iface );
83}
84
86{
87 if ( obj->msgtid )
88 FIXME( "Should kill the msg thread\n" );
89
90 DPQ_DELETEQ( obj->msgs, msgs, LPDPLMSG, cbDeleteElemFromHeap );
91 obj->lock.DebugInfo->Spare[0] = 0;
92 DeleteCriticalSection( &obj->lock );
93 free( obj );
94}
95
97 void **ppv )
98{
100 return IDirectPlayLobby_QueryInterface( &This->IDirectPlayLobby3_iface, riid, ppv );
101}
102
104 void **ppv )
105{
107
108 if ( IsEqualGUID( &IID_IUnknown, riid ) ||
109 IsEqualGUID( &IID_IDirectPlayLobby, riid ) ||
110 IsEqualGUID( &IID_IDirectPlayLobby2, riid ) ||
111 IsEqualGUID( &IID_IDirectPlayLobby3, riid ) )
112 {
113 TRACE( "(%p)->(IID_IDirectPlay3 %p)\n", This, ppv );
114 *ppv = &This->IDirectPlayLobby3_iface;
115 }
116 else if ( IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) ||
117 IsEqualGUID( &IID_IDirectPlayLobby2A, riid ) ||
118 IsEqualGUID( &IID_IDirectPlayLobby3A, riid ) )
119 {
120 TRACE( "(%p)->(IID_IDirectPlayLobby3A %p)\n", This, ppv );
121 *ppv = &This->IDirectPlayLobby3A_iface;
122 }
123 else
124 {
125 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
126 *ppv = NULL;
127 return E_NOINTERFACE;
128 }
129
130 IUnknown_AddRef((IUnknown*)*ppv);
131 return S_OK;
132}
133
135{
138
139 TRACE( "(%p) ref3=%ld\n", This, ref );
140
141 return ref;
142}
143
144static ULONG WINAPI IDirectPlayLobby3Impl_AddRef(IDirectPlayLobby3 *iface)
145{
148
149 TRACE( "(%p) ref3=%ld\n", This, ref );
150
151 return ref;
152}
153
155{
158
159 TRACE( "(%p) ref=%ld\n", This, ref );
160
161 if ( !ref )
163
164 return ref;
165}
166
167static ULONG WINAPI IDirectPlayLobby3Impl_Release(IDirectPlayLobby3 *iface)
168{
171
172 TRACE( "(%p) ref=%ld\n", This, ref );
173
174 if ( !ref )
176
177 return ref;
178}
179
180
181/********************************************************************
182 *
183 * Connects an application to the session specified by the DPLCONNECTION
184 * structure currently stored with the DirectPlayLobby object.
185 *
186 * Returns an IDirectPlay interface.
187 *
188 */
190 IUnknown* pUnk)
191{
192 HRESULT hr;
193 DWORD dwOpenFlags = 0;
194 DWORD dwConnSize = 0;
195 LPDPLCONNECTION lpConn;
196
197 FIXME("(%p)->(0x%08lx,%p,%p): semi stub\n", This, dwFlags, lplpDP, pUnk );
198
199 if( pUnk )
200 {
201 return DPERR_INVALIDPARAMS;
202 }
203
204 /* Backwards compatibility */
205 if( dwFlags == 0 )
206 {
208 }
209
210 if ( ( hr = dplay_create( riid, lplpDP ) ) != DP_OK )
211 {
212 ERR( "error creating interface for %s:%s.\n",
214 return hr;
215 }
216
217 /* FIXME: Is it safe/correct to use appID of 0? */
218 hr = IDirectPlayLobby_GetConnectionSettings( &This->IDirectPlayLobby3_iface,
219 0, NULL, &dwConnSize );
220 if( hr != DPERR_BUFFERTOOSMALL )
221 {
222 return hr;
223 }
224
225 lpConn = calloc( 1, dwConnSize );
226
227 if( lpConn == NULL )
228 {
229 return DPERR_NOMEMORY;
230 }
231
232 /* FIXME: Is it safe/correct to use appID of 0? */
233 hr = IDirectPlayLobby_GetConnectionSettings( &This->IDirectPlayLobby3_iface,
234 0, lpConn, &dwConnSize );
235 if( FAILED( hr ) )
236 {
237 free( lpConn );
238 return hr;
239 }
240
241#if 0
242 /* - Need to call IDirectPlay::EnumConnections with the service provider to get that good information
243 * - Need to call CreateAddress to create the lpConnection param for IDirectPlay::InitializeConnection
244 * - Call IDirectPlay::InitializeConnection
245 */
246
247 /* Now initialize the Service Provider */
249#endif
250
251
252 /* Setup flags to pass into DirectPlay::Open */
254 {
255 dwOpenFlags |= DPOPEN_RETURNSTATUS;
256 }
257 dwOpenFlags |= lpConn->dwFlags;
258
260 dwOpenFlags );
261
262 free( lpConn );
263
264 return hr;
265}
266
268 IDirectPlay2A **dp, IUnknown *unk)
269{
270 return IDirectPlayLobby_ConnectEx( iface, flags, &IID_IDirectPlay2A, (void**)dp, unk );
271}
272
273static HRESULT WINAPI IDirectPlayLobby3Impl_Connect( IDirectPlayLobby3 *iface, DWORD flags,
274 IDirectPlay2 **dp, IUnknown *unk)
275{
276 return IDirectPlayLobby_ConnectEx( iface, flags, &IID_IDirectPlay2A, (void**)dp, unk );
277}
278
279/********************************************************************
280 *
281 * Creates a DirectPlay Address, given a service provider-specific network
282 * address.
283 * Returns an address contains the globally unique identifier
284 * (GUID) of the service provider and data that the service provider can
285 * interpret as a network address.
286 *
287 * NOTE: It appears that this method is supposed to be really really stupid
288 * with no error checking on the contents.
289 */
290
292 REFGUID guidSP, REFGUID guidDataType, const void *lpData, DWORD dwDataSize, void *lpAddress,
293 DWORD *lpdwAddressSize )
294{
295 return DPL_CreateAddress( guidSP, guidDataType, lpData, dwDataSize,
296 lpAddress, lpdwAddressSize, TRUE );
297}
298
299static HRESULT WINAPI IDirectPlayLobby3Impl_CreateAddress( IDirectPlayLobby3 *iface, REFGUID guidSP,
300 REFGUID guidDataType, const void *lpData, DWORD dwDataSize, void *lpAddress,
301 DWORD *lpdwAddressSize )
302{
303 return DPL_CreateAddress( guidSP, guidDataType, lpData, dwDataSize,
304 lpAddress, lpdwAddressSize, FALSE );
305}
306
308 REFGUID guidSP,
309 REFGUID guidDataType,
310 LPCVOID lpData,
311 DWORD dwDataSize,
312 LPVOID lpAddress,
313 LPDWORD lpdwAddressSize,
314 BOOL bAnsiInterface )
315{
316 const DWORD dwNumAddElements = 2; /* Service Provide & address data type */
317 DPCOMPOUNDADDRESSELEMENT addressElements[ 2 /* dwNumAddElements */ ];
318
319 TRACE( "(%p)->(%p,%p,0x%08lx,%p,%p,%d)\n", guidSP, guidDataType, lpData, dwDataSize,
320 lpAddress, lpdwAddressSize, bAnsiInterface );
321
322 addressElements[ 0 ].guidDataType = DPAID_ServiceProvider;
323 addressElements[ 0 ].dwDataSize = sizeof( GUID );
324 addressElements[ 0 ].lpData = (LPVOID)guidSP;
325
326 addressElements[ 1 ].guidDataType = *guidDataType;
327 addressElements[ 1 ].dwDataSize = dwDataSize;
328 addressElements[ 1 ].lpData = (LPVOID)lpData;
329
330 /* Call CreateCompoundAddress to cut down on code.
331 NOTE: We can do this because we don't support DPL 1 interfaces! */
332 return DPL_CreateCompoundAddress( addressElements, dwNumAddElements,
333 lpAddress, lpdwAddressSize, bAnsiInterface );
334}
335
336
337
338/********************************************************************
339 *
340 * Parses out chunks from the DirectPlay Address buffer by calling the
341 * given callback function, with lpContext, for each of the chunks.
342 *
343 */
345 LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, const void *lpAddress, DWORD dwAddressSize,
346 void *lpContext )
347{
349
350 TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress,
351 dwAddressSize, lpContext );
352
353 return DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
354}
355
356static HRESULT WINAPI IDirectPlayLobby3Impl_EnumAddress( IDirectPlayLobby3 *iface,
357 LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, const void *lpAddress, DWORD dwAddressSize,
358 void *lpContext )
359{
361
362 TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress,
363 dwAddressSize, lpContext );
364
365 return DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
366}
367
368HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress,
369 DWORD dwAddressSize, LPVOID lpContext )
370{
371 DWORD dwTotalSizeEnumerated = 0;
372
373 /* FIXME: First chunk is always the total size chunk - Should we report it? */
374
375 while ( dwTotalSizeEnumerated < dwAddressSize )
376 {
377 const DPADDRESS* lpElements = lpAddress;
378 DWORD dwSizeThisEnumeration;
379
380 /* Invoke the enum method. If false is returned, stop enumeration */
381 if ( !lpEnumAddressCallback( &lpElements->guidDataType,
382 lpElements->dwDataSize,
383 (const BYTE *)lpElements + sizeof( DPADDRESS ),
384 lpContext ) )
385 {
386 break;
387 }
388
389 dwSizeThisEnumeration = sizeof( DPADDRESS ) + lpElements->dwDataSize;
390 lpAddress = (const BYTE*) lpAddress + dwSizeThisEnumeration;
391 dwTotalSizeEnumerated += dwSizeThisEnumeration;
392 }
393
394 return DP_OK;
395}
396
397/********************************************************************
398 *
399 * Enumerates all the address types that a given service provider needs to
400 * build the DirectPlay Address.
401 *
402 */
404 LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback, REFGUID guidSP, void *lpContext,
405 DWORD dwFlags )
406{
408
409 HKEY hkResult;
410 LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers";
411 DWORD dwIndex, sizeOfSubKeyName=50;
412 char subKeyName[51];
413 FILETIME filetime;
414
415 TRACE(" (%p)->(%p,%p,%p,0x%08lx)\n", This, lpEnumAddressTypeCallback, guidSP, lpContext, dwFlags );
416
417 if( dwFlags != 0 )
418 {
419 return DPERR_INVALIDPARAMS;
420 }
421
422 if( !lpEnumAddressTypeCallback )
423 {
424 return DPERR_INVALIDPARAMS;
425 }
426
427 if( guidSP == NULL )
428 {
429 return DPERR_INVALIDOBJECT;
430 }
431
432 /* Need to loop over the service providers in the registry */
433 if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey,
434 0, KEY_READ, &hkResult ) != ERROR_SUCCESS )
435 {
436 /* Hmmm. Does this mean that there are no service providers? */
437 ERR(": no service providers?\n");
438 return DP_OK;
439 }
440
441 /* Traverse all the service providers we have available */
442 for( dwIndex=0;
443 RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName,
444 NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS;
445 ++dwIndex, sizeOfSubKeyName=50 )
446 {
447
448 HKEY hkServiceProvider, hkServiceProviderAt;
449 GUID serviceProviderGUID;
450 DWORD returnTypeGUID, sizeOfReturnBuffer = 50;
451 char atSubKey[51];
452 char returnBuffer[51];
453 WCHAR buff[51];
454 DWORD dwAtIndex;
455 LPCSTR atKey = "Address Types";
456 LPCSTR guidDataSubKey = "Guid";
457
458 TRACE(" this time through: %s\n", subKeyName );
459
460 /* Get a handle for this particular service provider */
461 if( RegOpenKeyExA( hkResult, subKeyName, 0, KEY_READ,
462 &hkServiceProvider ) != ERROR_SUCCESS )
463 {
464 ERR(": what the heck is going on?\n" );
465 continue;
466 }
467
468 if( RegQueryValueExA( hkServiceProvider, guidDataSubKey,
469 NULL, &returnTypeGUID, (LPBYTE)returnBuffer,
470 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
471 {
472 ERR(": missing GUID registry data members\n" );
473 continue;
474 }
475
476 /* FIXME: Check return types to ensure we're interpreting data right */
477 MultiByteToWideChar( CP_ACP, 0, returnBuffer, -1, buff, ARRAY_SIZE( buff ));
478 CLSIDFromString( buff, &serviceProviderGUID );
479 /* FIXME: Have I got a memory leak on the serviceProviderGUID? */
480
481 /* Determine if this is the Service Provider that the user asked for */
482 if( !IsEqualGUID( &serviceProviderGUID, guidSP ) )
483 {
484 continue;
485 }
486
487 /* Get a handle for this particular service provider */
488 if( RegOpenKeyExA( hkServiceProvider, atKey, 0, KEY_READ,
489 &hkServiceProviderAt ) != ERROR_SUCCESS )
490 {
491 TRACE(": No Address Types registry data sub key/members\n" );
492 break;
493 }
494
495 /* Traverse all the address type we have available */
496 for( dwAtIndex=0;
497 RegEnumKeyExA( hkServiceProviderAt, dwAtIndex, atSubKey, &sizeOfSubKeyName,
498 NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS;
499 ++dwAtIndex, sizeOfSubKeyName=50 )
500 {
501 TRACE( "Found Address Type GUID %s\n", atSubKey );
502
503 /* FIXME: Check return types to ensure we're interpreting data right */
504 MultiByteToWideChar( CP_ACP, 0, atSubKey, -1, buff, ARRAY_SIZE( buff ));
505 CLSIDFromString( buff, &serviceProviderGUID );
506 /* FIXME: Have I got a memory leak on the serviceProviderGUID? */
507
508 /* The enumeration will return FALSE if we are not to continue */
509 if( !lpEnumAddressTypeCallback( &serviceProviderGUID, lpContext, 0 ) )
510 {
511 WARN("lpEnumCallback returning FALSE\n" );
512 break; /* FIXME: This most likely has to break from the procedure...*/
513 }
514
515 }
516
517 /* We only enumerate address types for 1 GUID. We've found it, so quit looking */
518 break;
519 }
520
521 return DP_OK;
522}
523
526{
528 return IDirectPlayLobby_EnumAddressTypes( &This->IDirectPlayLobby3A_iface, enumaddrtypecb, sp,
529 context, flags );
530}
531
532/********************************************************************
533 *
534 * Enumerates what applications are registered with DirectPlay by
535 * invoking the callback function with lpContext.
536 *
537 */
539 LPDPLENUMLOCALAPPLICATIONSCALLBACK lpEnumLocalAppCallback, void *lpContext, DWORD dwFlags )
540{
542
543 FIXME("(%p)->(%p,%p,0x%08lx):stub\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
544
545 return DPERR_OUTOFMEMORY;
546}
547
549 LPDPLENUMLOCALAPPLICATIONSCALLBACK lpEnumLocalAppCallback, void *lpContext, DWORD dwFlags )
550{
552
553 HKEY hkResult;
554 LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Applications";
555 LPCSTR guidDataSubKey = "Guid";
556 DWORD dwIndex, sizeOfSubKeyName=50;
557 char subKeyName[51];
558 FILETIME filetime;
559
560 TRACE("(%p)->(%p,%p,0x%08lx)\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
561
562 if( dwFlags != 0 )
563 {
564 return DPERR_INVALIDPARAMS;
565 }
566
567 if( !lpEnumLocalAppCallback )
568 {
569 return DPERR_INVALIDPARAMS;
570 }
571
572 /* Need to loop over the service providers in the registry */
573 if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey,
574 0, KEY_READ, &hkResult ) != ERROR_SUCCESS )
575 {
576 /* Hmmm. Does this mean that there are no service providers? */
577 ERR(": no service providers?\n");
578 return DP_OK;
579 }
580
581 /* Traverse all registered applications */
582 for( dwIndex=0;
583 RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName, NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS;
584 ++dwIndex, sizeOfSubKeyName=50 )
585 {
586
587 HKEY hkServiceProvider;
588 GUID serviceProviderGUID;
589 DWORD returnTypeGUID, sizeOfReturnBuffer = 50;
590 char returnBuffer[51];
591 WCHAR buff[51];
592 DPLAPPINFO dplAppInfo;
593
594 TRACE(" this time through: %s\n", subKeyName );
595
596 /* Get a handle for this particular service provider */
597 if( RegOpenKeyExA( hkResult, subKeyName, 0, KEY_READ,
598 &hkServiceProvider ) != ERROR_SUCCESS )
599 {
600 ERR(": what the heck is going on?\n" );
601 continue;
602 }
603
604 if( RegQueryValueExA( hkServiceProvider, guidDataSubKey,
605 NULL, &returnTypeGUID, (LPBYTE)returnBuffer,
606 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
607 {
608 ERR(": missing GUID registry data members\n" );
609 continue;
610 }
611
612 /* FIXME: Check return types to ensure we're interpreting data right */
613 MultiByteToWideChar( CP_ACP, 0, returnBuffer, -1, buff, ARRAY_SIZE( buff ));
614 CLSIDFromString( buff, &serviceProviderGUID );
615 /* FIXME: Have I got a memory leak on the serviceProviderGUID? */
616
617 dplAppInfo.dwSize = sizeof( dplAppInfo );
618 dplAppInfo.guidApplication = serviceProviderGUID;
619 dplAppInfo.lpszAppNameA = subKeyName;
620
621 EnterCriticalSection( &This->lock );
622
623 memcpy( &This->cbkeyhack, &hkServiceProvider, sizeof( hkServiceProvider ) );
624
625 if( !lpEnumLocalAppCallback( &dplAppInfo, lpContext, dwFlags ) )
626 {
627 LeaveCriticalSection( &This->lock );
628 break;
629 }
630
631 LeaveCriticalSection( &This->lock );
632 }
633
634 return DP_OK;
635}
636
637/********************************************************************
638 *
639 * Retrieves the DPLCONNECTION structure that contains all the information
640 * needed to start and connect an application. This was generated using
641 * either the RunApplication or SetConnectionSettings methods.
642 *
643 * NOTES: If lpData is NULL then just return lpdwDataSize. This allows
644 * the data structure to be allocated by our caller which can then
645 * call this procedure/method again with a valid data pointer.
646 */
647
649 DWORD dwAppID, void *lpData, DWORD *lpdwDataSize )
650{
652 HRESULT hr;
653
654 TRACE("(%p)->(0x%08lx,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
655
656 EnterCriticalSection( &This->lock );
657
659 lpData,
660 lpdwDataSize
661 );
662
663 LeaveCriticalSection( &This->lock );
664
665 return hr;
666}
667
669 DWORD dwAppID, void *lpData, DWORD *lpdwDataSize )
670{
672 HRESULT hr;
673
674 TRACE("(%p)->(0x%08lx,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
675
676 EnterCriticalSection( &This->lock );
677
679 lpData,
680 lpdwDataSize
681 );
682
683 LeaveCriticalSection( &This->lock );
684
685 return hr;
686}
687
688/********************************************************************
689 *
690 * Retrieves the message sent between a lobby client and a DirectPlay
691 * application. All messages are queued until received.
692 *
693 */
694
696 DWORD dwFlags, DWORD dwAppID, DWORD *lpdwMessageFlags, void *lpData,
697 DWORD *lpdwDataSize )
698{
700 FIXME(":stub %p %08lx %08lx %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
701 lpdwDataSize );
702 return DPERR_OUTOFMEMORY;
703}
704
706 DWORD dwFlags, DWORD dwAppID, DWORD *lpdwMessageFlags, void *lpData,
707 DWORD *lpdwDataSize )
708{
710 FIXME(":stub %p %08lx %08lx %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
711 lpdwDataSize );
712 return DPERR_OUTOFMEMORY;
713}
714
716{
718
725
726/* To be called by RunApplication to find how to invoke the function */
728( LPCDPLAPPINFO lpAppInfo,
729 LPVOID lpContext,
730 DWORD dwFlags )
731{
733
734 if( IsEqualGUID( &lpAppInfo->guidApplication, &lpData->appGUID ) )
735 {
736 char returnBuffer[200];
737 DWORD returnType, sizeOfReturnBuffer;
738 LPCSTR clSubKey = "CommandLine";
739 LPCSTR cdSubKey = "CurrentDirectory";
740 LPCSTR fileSubKey = "File";
741 LPCSTR pathSubKey = "Path";
742
743 /* FIXME: Lazy man hack - dplay struct has the present reg key saved */
744
745 sizeOfReturnBuffer = 200;
746
747 /* Get all the appropriate data from the registry */
748 if( RegQueryValueExA( lpData->This->cbkeyhack, clSubKey,
749 NULL, &returnType, (LPBYTE)returnBuffer,
750 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
751 {
752 ERR( ": missing CommandLine registry data member\n" );
753 }
754 else
755 {
756 lpData->lpszCommandLine = strdup( returnBuffer );
757 }
758
759 sizeOfReturnBuffer = 200;
760
761 if( RegQueryValueExA( lpData->This->cbkeyhack, cdSubKey,
762 NULL, &returnType, (LPBYTE)returnBuffer,
763 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
764 {
765 ERR( ": missing CurrentDirectory registry data member\n" );
766 }
767 else
768 {
769 lpData->lpszCurrentDirectory = strdup( returnBuffer );
770 }
771
772 sizeOfReturnBuffer = 200;
773
774 if( RegQueryValueExA( lpData->This->cbkeyhack, fileSubKey,
775 NULL, &returnType, (LPBYTE)returnBuffer,
776 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
777 {
778 ERR( ": missing File registry data member\n" );
779 }
780 else
781 {
782 lpData->lpszFileName = strdup( returnBuffer );
783 }
784
785 sizeOfReturnBuffer = 200;
786
787 if( RegQueryValueExA( lpData->This->cbkeyhack, pathSubKey,
788 NULL, &returnType, (LPBYTE)returnBuffer,
789 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
790 {
791 ERR( ": missing Path registry data member\n" );
792 }
793 else
794 {
795 lpData->lpszPath = strdup( returnBuffer );
796 }
797
798 return FALSE; /* No need to keep going as we found what we wanted */
799 }
800
801 return TRUE; /* Keep enumerating, haven't found the application yet */
802}
803
804static BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess,
805 LPHANDLE lphStart, LPHANDLE lphDeath,
806 LPHANDLE lphRead )
807{
808 /* These are the handles for the created process */
809 HANDLE hAppStart = 0, hAppDeath = 0, hAppRead = 0;
810 SECURITY_ATTRIBUTES s_attrib;
811
812 s_attrib.nLength = sizeof( s_attrib );
813 s_attrib.lpSecurityDescriptor = NULL;
814 s_attrib.bInheritHandle = TRUE;
815
816 *lphStart = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
817 *lphDeath = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
818 *lphRead = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
819
820 if( ( !DuplicateHandle( GetCurrentProcess(), *lphStart,
821 hDestProcess, &hAppStart,
823 ( !DuplicateHandle( GetCurrentProcess(), *lphDeath,
824 hDestProcess, &hAppDeath,
826 ( !DuplicateHandle( GetCurrentProcess(), *lphRead,
827 hDestProcess, &hAppRead,
829 )
830 {
831 if (*lphStart) { CloseHandle(*lphStart); *lphStart = 0; }
832 if (*lphDeath) { CloseHandle(*lphDeath); *lphDeath = 0; }
833 if (*lphRead) { CloseHandle(*lphRead); *lphRead = 0; }
834 /* FIXME: Handle leak... */
835 ERR( "Unable to dup handles\n" );
836 return FALSE;
837 }
838
839 if( !DPLAYX_SetLobbyHandles( dwDestProcessId,
840 hAppStart, hAppDeath, hAppRead ) )
841 {
842 /* FIXME: Handle leak... */
843 return FALSE;
844 }
845
846 return TRUE;
847}
848
849
850/********************************************************************
851 *
852 * Starts an application and passes to it all the information to
853 * connect to a session.
854 *
855 */
857 DWORD dwFlags, DWORD *lpdwAppID, DPLCONNECTION *lpConn, HANDLE hReceiveEvent )
858{
860 HRESULT hr;
862 char temp[200];
863 STARTUPINFOA startupInfo;
864 PROCESS_INFORMATION newProcessInfo;
866 DWORD dwSuspendCount;
867 HANDLE hStart, hDeath, hSettingRead;
868
869 TRACE( "(%p)->(0x%08lx,%p,%p,%p)\n",
870 This, dwFlags, lpdwAppID, lpConn, hReceiveEvent );
871
872 if( dwFlags != 0 )
873 {
874 return DPERR_INVALIDPARAMS;
875 }
876
878 {
879 FIXME( "Waiting lobby not being handled correctly\n" );
880 }
881
882 EnterCriticalSection( &This->lock );
883
884 ZeroMemory( &enumData, sizeof( enumData ) );
885 enumData.This = This;
886 enumData.appGUID = lpConn->lpSessionDesc->guidApplication;
887
888 /* Our callback function will fill up the enumData structure with all the information
889 required to start a new process */
891 (&enumData), 0 );
892
893 /* First the application name */
894 strcpy( temp, enumData.lpszPath );
895 strcat( temp, "\\" );
896 strcat( temp, enumData.lpszFileName );
897 free( enumData.lpszPath );
898 free( enumData.lpszFileName );
899 appName = strdup( temp );
900
901 /* Now the command line */
902 strcat( temp, " " );
903 strcat( temp, enumData.lpszCommandLine );
904 free( enumData.lpszCommandLine );
905 enumData.lpszCommandLine = strdup( temp );
906
907 ZeroMemory( &startupInfo, sizeof( startupInfo ) );
908 startupInfo.cb = sizeof( startupInfo );
909 /* FIXME: Should any fields be filled in? */
910
911 ZeroMemory( &newProcessInfo, sizeof( newProcessInfo ) );
912
914 enumData.lpszCommandLine,
915 NULL,
916 NULL,
917 FALSE,
919 NULL,
920 enumData.lpszCurrentDirectory,
921 &startupInfo,
922 &newProcessInfo
923 )
924 )
925 {
926 ERR( "Failed to create process for app %s\n", appName );
927
928 free( appName );
929 free( enumData.lpszCommandLine );
930 free( enumData.lpszCurrentDirectory );
931
932 LeaveCriticalSection( &This->lock );
934 }
935
936 free( appName );
937 free( enumData.lpszCommandLine );
938 free( enumData.lpszCurrentDirectory );
939
940 /* Reserve this global application id! */
941 if( !DPLAYX_CreateLobbyApplication( newProcessInfo.dwProcessId ) )
942 {
943 ERR( "Unable to create global application data for 0x%08lx\n",
944 newProcessInfo.dwProcessId );
945 }
946
947 hr = IDirectPlayLobby_SetConnectionSettings( iface, 0, newProcessInfo.dwProcessId, lpConn );
948
949 if( hr != DP_OK )
950 {
951 ERR( "SetConnectionSettings failure %s\n", DPLAYX_HresultToString( hr ) );
952 LeaveCriticalSection( &This->lock );
953 return hr;
954 }
955
956 /* Setup the handles for application notification */
958 newProcessInfo.hProcess,
959 &hStart, &hDeath, &hSettingRead );
960
961 /* Setup the message thread ID */
962 This->msgtid = CreateLobbyMessageReceptionThread( hReceiveEvent, hStart, hDeath, hSettingRead );
963
964 DPLAYX_SetLobbyMsgThreadId( newProcessInfo.dwProcessId, This->msgtid );
965
966 LeaveCriticalSection( &This->lock );
967
968 /* Everything seems to have been set correctly, update the dwAppID */
969 *lpdwAppID = newProcessInfo.dwProcessId;
970
971 /* Unsuspend the process - should return the prev suspension count */
972 if( ( dwSuspendCount = ResumeThread( newProcessInfo.hThread ) ) != 1 )
973 {
974 ERR( "ResumeThread failed with 0x%08lx\n", dwSuspendCount );
975 }
976
977 return DP_OK;
978}
979
981 DWORD *lpdwAppID, DPLCONNECTION *lpConn, HANDLE hReceiveEvent )
982{
984 FIXME( "(%p)->(0x%08lx,%p,%p,%p):stub\n", This, dwFlags, lpdwAppID, lpConn, hReceiveEvent );
985 return DPERR_OUTOFMEMORY;
986}
987
988/********************************************************************
989 *
990 * Sends a message between the application and the lobby client.
991 * All messages are queued until received.
992 *
993 */
994
996 DWORD flags, DWORD appid, void *data, DWORD size )
997{
998 FIXME(":stub\n");
999 return DPERR_OUTOFMEMORY;
1000}
1001
1003 DWORD flags, DWORD appid, void *data, DWORD size )
1004{
1005 FIXME(":stub\n");
1006 return DPERR_OUTOFMEMORY;
1007}
1008
1009/********************************************************************
1010 *
1011 * Modifies the DPLCONNECTION structure to contain all information
1012 * needed to start and connect an application.
1013 *
1014 */
1016 DWORD dwFlags, DWORD dwAppID, DPLCONNECTION *lpConn )
1017{
1019 HRESULT hr;
1020
1021 TRACE("(%p)->(0x%08lx,0x%08lx,%p)\n", This, dwFlags, dwAppID, lpConn );
1022
1023 EnterCriticalSection( &This->lock );
1024
1025 hr = DPLAYX_SetConnectionSettingsW( dwFlags, dwAppID, lpConn );
1026
1027 /* FIXME: Don't think that this is supposed to fail, but the documentation
1028 is somewhat sketchy. I'll try creating a lobby application
1029 for this... */
1030 if( hr == DPERR_NOTLOBBIED )
1031 {
1032 FIXME( "Unlobbied app setting connections. Is this correct behavior?\n" );
1033 if( dwAppID == 0 )
1034 {
1035 dwAppID = GetCurrentProcessId();
1036 }
1038 hr = DPLAYX_SetConnectionSettingsW( dwFlags, dwAppID, lpConn );
1039 }
1040
1041 LeaveCriticalSection( &This->lock );
1042
1043 return hr;
1044}
1045
1046
1048 DWORD dwFlags, DWORD dwAppID, DPLCONNECTION *lpConn )
1049{
1051 HRESULT hr;
1052
1053 TRACE("(%p)->(0x%08lx,0x%08lx,%p)\n", This, dwFlags, dwAppID, lpConn );
1054
1055 EnterCriticalSection( &This->lock );
1056
1057 hr = DPLAYX_SetConnectionSettingsA( dwFlags, dwAppID, lpConn );
1058
1059 /* FIXME: Don't think that this is supposed to fail, but the documentation
1060 is somewhat sketchy. I'll try creating a lobby application
1061 for this... */
1062 if( hr == DPERR_NOTLOBBIED )
1063 {
1064 FIXME( "Unlobbied app setting connections. Is this correct behavior?\n" );
1065 dwAppID = GetCurrentProcessId();
1067 hr = DPLAYX_SetConnectionSettingsA( dwFlags, dwAppID, lpConn );
1068 }
1069
1070 LeaveCriticalSection( &This->lock );
1071
1072 return hr;
1073}
1074
1075/********************************************************************
1076 *
1077 * Registers an event that will be set when a lobby message is received.
1078 *
1079 */
1082{
1083 FIXME(":stub\n");
1084 return DPERR_OUTOFMEMORY;
1085}
1086
1089{
1090 FIXME(":stub\n");
1091 return DPERR_OUTOFMEMORY;
1092}
1093
1095 const DPCOMPOUNDADDRESSELEMENT *lpElements, DWORD dwElementCount, void *lpAddress,
1096 DWORD *lpdwAddressSize )
1097{
1098 return DPL_CreateCompoundAddress( lpElements, dwElementCount, lpAddress, lpdwAddressSize, FALSE );
1099}
1100
1102 const DPCOMPOUNDADDRESSELEMENT *lpElements, DWORD dwElementCount, void *lpAddress,
1103 DWORD *lpdwAddressSize )
1104{
1105 return DPL_CreateCompoundAddress( lpElements, dwElementCount, lpAddress, lpdwAddressSize, TRUE );
1106}
1107
1109( LPCDPCOMPOUNDADDRESSELEMENT lpElements,
1110 DWORD dwElementCount,
1111 LPVOID lpAddress,
1112 LPDWORD lpdwAddressSize,
1113 BOOL bAnsiInterface )
1114{
1115 DWORD dwSizeRequired = 0;
1116 DWORD dwElements;
1117 LPCDPCOMPOUNDADDRESSELEMENT lpOrigElements = lpElements;
1118
1119 TRACE("(%p,0x%08lx,%p,%p)\n", lpElements, dwElementCount, lpAddress, lpdwAddressSize );
1120
1121 /* Parameter check */
1122 if( ( lpElements == NULL ) ||
1123 ( dwElementCount == 0 ) /* FIXME: Not sure if this is a failure case */
1124 )
1125 {
1126 return DPERR_INVALIDPARAMS;
1127 }
1128
1129 /* Add the total size chunk */
1130 dwSizeRequired += sizeof( DPADDRESS ) + sizeof( DWORD );
1131
1132 /* Calculate the size of the buffer required */
1133 for ( dwElements = dwElementCount; dwElements > 0; --dwElements, ++lpElements )
1134 {
1135 if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ServiceProvider ) ) ||
1136 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_LobbyProvider ) )
1137 )
1138 {
1139 dwSizeRequired += sizeof( DPADDRESS ) + sizeof( GUID );
1140 }
1141 else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Phone ) ) ||
1142 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Modem ) ) ||
1143 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INet ) )
1144 )
1145 {
1146 if( !bAnsiInterface )
1147 {
1148 ERR( "Ansi GUIDs used for unicode interface\n" );
1149 return DPERR_INVALIDFLAGS;
1150 }
1151
1152 dwSizeRequired += sizeof( DPADDRESS ) + lpElements->dwDataSize;
1153 }
1154 else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_PhoneW ) ) ||
1155 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ModemW ) ) ||
1156 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INetW ) )
1157 )
1158 {
1159 if( bAnsiInterface )
1160 {
1161 ERR( "Unicode GUIDs used for ansi interface\n" );
1162 return DPERR_INVALIDFLAGS;
1163 }
1164
1165 FIXME( "Right size for unicode interface?\n" );
1166 dwSizeRequired += sizeof( DPADDRESS ) + lpElements->dwDataSize * sizeof( WCHAR );
1167 }
1168 else if ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INetPort ) )
1169 {
1170 dwSizeRequired += sizeof( DPADDRESS ) + sizeof( WORD );
1171 }
1172 else if ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ComPort ) )
1173 {
1174 FIXME( "Right size for unicode interface?\n" );
1175 dwSizeRequired += sizeof( DPADDRESS ) + sizeof( DPCOMPORTADDRESS ); /* FIXME: Right size? */
1176 }
1177 else
1178 {
1179 WARN( "Skipping Unknown GUID %s\n", debugstr_guid(&lpElements->guidDataType) );
1180 }
1181 }
1182
1183 /* The user wants to know how big a buffer to allocate for us */
1184 if( ( lpAddress == NULL ) ||
1185 ( *lpdwAddressSize < dwSizeRequired )
1186 )
1187 {
1188 *lpdwAddressSize = dwSizeRequired;
1189 return DPERR_BUFFERTOOSMALL;
1190 }
1191
1192 /* Add the total size chunk */
1193 {
1194 LPDPADDRESS lpdpAddress = lpAddress;
1195
1196 lpdpAddress->guidDataType = DPAID_TotalSize;
1197 lpdpAddress->dwDataSize = sizeof( DWORD );
1198 lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
1199
1200 *(LPDWORD)lpAddress = dwSizeRequired;
1201 lpAddress = (char *) lpAddress + sizeof( DWORD );
1202 }
1203
1204 /* Calculate the size of the buffer required */
1205 for( dwElements = dwElementCount, lpElements = lpOrigElements;
1206 dwElements > 0;
1207 --dwElements, ++lpElements )
1208 {
1209 if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ServiceProvider ) ) ||
1210 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_LobbyProvider ) )
1211 )
1212 {
1213 LPDPADDRESS lpdpAddress = lpAddress;
1214
1215 lpdpAddress->guidDataType = lpElements->guidDataType;
1216 lpdpAddress->dwDataSize = sizeof( GUID );
1217 lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
1218
1219 CopyMemory( lpAddress, lpElements->lpData, sizeof( GUID ) );
1220 lpAddress = (char *) lpAddress + sizeof( GUID );
1221 }
1222 else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Phone ) ) ||
1223 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Modem ) ) ||
1224 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INet ) )
1225 )
1226 {
1227 LPDPADDRESS lpdpAddress = lpAddress;
1228
1229 lpdpAddress->guidDataType = lpElements->guidDataType;
1230 lpdpAddress->dwDataSize = lpElements->dwDataSize;
1231 lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
1232
1233 lstrcpynA( lpAddress, lpElements->lpData, lpElements->dwDataSize );
1234 lpAddress = (char *) lpAddress + lpElements->dwDataSize;
1235 }
1236 else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_PhoneW ) ) ||
1237 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ModemW ) ) ||
1238 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INetW ) )
1239 )
1240 {
1241 LPDPADDRESS lpdpAddress = lpAddress;
1242
1243 lpdpAddress->guidDataType = lpElements->guidDataType;
1244 lpdpAddress->dwDataSize = lpElements->dwDataSize;
1245 lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
1246
1247 lstrcpynW( lpAddress, lpElements->lpData, lpElements->dwDataSize );
1248 lpAddress = (char *) lpAddress + lpElements->dwDataSize * sizeof( WCHAR );
1249 }
1250 else if ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INetPort ) )
1251 {
1252 LPDPADDRESS lpdpAddress = lpAddress;
1253
1254 lpdpAddress->guidDataType = lpElements->guidDataType;
1255 lpdpAddress->dwDataSize = lpElements->dwDataSize;
1256 lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
1257
1258 *((LPWORD)lpAddress) = *((LPWORD)lpElements->lpData);
1259 lpAddress = (char *) lpAddress + sizeof( WORD );
1260 }
1261 else if ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ComPort ) )
1262 {
1263 LPDPADDRESS lpdpAddress = lpAddress;
1264
1265 lpdpAddress->guidDataType = lpElements->guidDataType;
1266 lpdpAddress->dwDataSize = lpElements->dwDataSize;
1267 lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
1268
1269 CopyMemory( lpAddress, lpElements->lpData, sizeof( DPADDRESS ) );
1270 lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
1271 }
1272 }
1273
1274 return DP_OK;
1275}
1276
1277/* DPL 3 methods */
1278
1281{
1283 return DPL_ConnectEx( This, dwFlags, riid, lplpDP, pUnk );
1284}
1285
1287 REFIID riid, void **lplpDP, IUnknown *pUnk )
1288{
1290 return DPL_ConnectEx( This, dwFlags, riid, lplpDP, pUnk );
1291}
1292
1294 DWORD flags, DPAPPLICATIONDESC *appdesc )
1295{
1296 FIXME(":stub\n");
1297 return DP_OK;
1298}
1299
1301 DWORD flags, DPAPPLICATIONDESC *appdesc )
1302{
1303 FIXME(":stub\n");
1304 return DP_OK;
1305}
1306
1308 DWORD flags, REFGUID appdesc )
1309{
1310 FIXME(":stub\n");
1311 return DP_OK;
1312}
1313
1315 DWORD flags, REFGUID appdesc )
1316{
1317 FIXME(":stub\n");
1318 return DP_OK;
1319}
1320
1322 DWORD dwFlags )
1323{
1324 HRESULT hr = DP_OK;
1325 BOOL bStartWait = !(dwFlags & DPLWAIT_CANCEL);
1326
1327 TRACE( "(%p)->(0x%08lx)\n", iface, dwFlags );
1328
1329 if( DPLAYX_WaitForConnectionSettings( bStartWait ) )
1330 {
1331 /* FIXME: What is the correct error return code? */
1333 }
1334
1335 return hr;
1336}
1337
1339 DWORD dwFlags )
1340{
1341 HRESULT hr = DP_OK;
1342 BOOL bStartWait = !(dwFlags & DPLWAIT_CANCEL);
1343
1344 TRACE( "(%p)->(0x%08lx)\n", iface, dwFlags );
1345
1346 if( DPLAYX_WaitForConnectionSettings( bStartWait ) )
1347 {
1348 /* FIXME: What is the correct error return code? */
1350 }
1351
1352 return hr;
1353}
1354
1355static const IDirectPlayLobby3Vtbl dpl3A_vt =
1356{
1376};
1377
1378static const IDirectPlayLobby3Vtbl dpl3_vt =
1379{
1399};
1400
1402{
1404 HRESULT hr;
1405
1406 TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
1407
1408 *ppv = NULL;
1409 obj = malloc( sizeof( *obj ) );
1410 if ( !obj )
1411 return DPERR_OUTOFMEMORY;
1412
1413 obj->IDirectPlayLobby3_iface.lpVtbl = &dpl3_vt;
1414 obj->IDirectPlayLobby3A_iface.lpVtbl = &dpl3A_vt;
1415 obj->msgtid = 0;
1416 obj->ref = 1;
1417
1419 obj->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlayLobbyImpl.lock");
1420 DPQ_INIT( obj->msgs );
1421
1422 hr = IDirectPlayLobby_QueryInterface( &obj->IDirectPlayLobby3_iface, riid, ppv );
1423 IDirectPlayLobby_Release( &obj->IDirectPlayLobby3_iface );
1424
1425 return hr;
1426}
1427
1428
1429
1430/***************************************************************************
1431 * DirectPlayLobbyCreateA (DPLAYX.4)
1432 *
1433 */
1435 IUnknown *lpUnk, void *lpData, DWORD dwDataSize )
1436{
1437 TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
1438 lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize);
1439
1440 /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
1441 * equal 0. These fields are mostly for future expansion.
1442 */
1443 if ( lpGUIDDSP || lpData || dwDataSize )
1444 {
1445 *lplpDPL = NULL;
1446 return DPERR_INVALIDPARAMS;
1447 }
1448
1449 if( lpUnk )
1450 {
1451 *lplpDPL = NULL;
1452 ERR("Bad parameters!\n" );
1453 return CLASS_E_NOAGGREGATION;
1454 }
1455
1456 return dplobby_create( &IID_IDirectPlayLobbyA, (void**)lplpDPL );
1457}
1458
1459/***************************************************************************
1460 * DirectPlayLobbyCreateW (DPLAYX.5)
1461 *
1462 */
1463HRESULT WINAPI DirectPlayLobbyCreateW( GUID *lpGUIDDSP, IDirectPlayLobby **lplpDPL,
1464 IUnknown *lpUnk, void *lpData, DWORD dwDataSize )
1465{
1466 TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
1467 lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize);
1468
1469 /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
1470 * equal 0. These fields are mostly for future expansion.
1471 */
1472 if ( lpGUIDDSP || lpData || dwDataSize )
1473 {
1474 *lplpDPL = NULL;
1475 ERR("Bad parameters!\n" );
1476 return DPERR_INVALIDPARAMS;
1477 }
1478
1479 if( lpUnk )
1480 {
1481 *lplpDPL = NULL;
1482 ERR("Bad parameters!\n" );
1483 return CLASS_E_NOAGGREGATION;
1484 }
1485
1486 return dplobby_create( &IID_IDirectPlayLobby, (void**)lplpDPL );
1487}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
LONG WINAPI RegEnumKeyExA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2419
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
Definition: combase.c:1470
#define CloseHandle
Definition: compat.h:739
#define CP_ACP
Definition: compat.h:109
#define lstrcpynA
Definition: compat.h:751
#define GetCurrentProcess()
Definition: compat.h:759
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define CALLBACK
Definition: compat.h:35
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrcpynW
Definition: compat.h:738
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
Definition: handle.c:149
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:567
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(const char *app_name, char *cmd_line, SECURITY_ATTRIBUTES *process_attr, SECURITY_ATTRIBUTES *thread_attr, BOOL inherit, DWORD flags, void *env, const char *cur_dir, STARTUPINFOA *startup_info, PROCESS_INFORMATION *info)
Definition: process.c:686
static char * strdup(const char *buf)
Definition: string.h:83
HRESULT dplay_create(REFIID riid, void **ppv)
Definition: dplay.c:6428
#define DPERR_INVALIDOBJECT
Definition: dplay.h:101
#define IDirectPlayX_Open(p, a, b)
Definition: dplay.h:889
#define DPERR_NOMEMORY
Definition: dplay.h:108
#define DPERR_BUFFERTOOSMALL
Definition: dplay.h:92
#define DPOPEN_RETURNSTATUS
Definition: dplay.h:265
#define DPERR_INVALIDFLAGS
Definition: dplay.h:100
struct IDirectPlay2 * LPDIRECTPLAY2
Definition: dplay.h:44
#define DPCONNECT_RETURNSTATUS
Definition: dplay.h:1065
#define DP_OK
Definition: dplay.h:88
#define IDirectPlayX_InitializeConnection(p, a, b)
Definition: dplay.h:904
#define DPERR_NOTLOBBIED
Definition: dplay.h:142
#define DPERR_INVALIDPARAMS
Definition: dplay.h:103
#define DPERR_OUTOFMEMORY
Definition: dplay.h:109
struct IDirectPlay2 IDirectPlay2A
Definition: dplay.h:47
#define DPERR_CANTCREATEPROCESS
Definition: dplay.h:137
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:41
static void *static void *static LPDIRECTPLAY * lplpDP
Definition: dplayx.c:41
HRESULT DPLAYX_GetConnectionSettingsA(DWORD dwAppID, LPVOID lpData, LPDWORD lpdwDataSize)
BOOL DPLAYX_SetLobbyHandles(DWORD dwAppID, HANDLE hStart, HANDLE hDeath, HANDLE hConnRead)
BOOL DPLAYX_AnyLobbiesWaitingForConnSettings(void)
HRESULT DPLAYX_SetConnectionSettingsA(DWORD dwFlags, DWORD dwAppID, const DPLCONNECTION *lpConn)
BOOL DPLAYX_SetLobbyMsgThreadId(DWORD dwAppId, DWORD dwThreadId)
BOOL DPLAYX_CreateLobbyApplication(DWORD dwAppID)
BOOL DPLAYX_WaitForConnectionSettings(BOOL bWait)
HRESULT DPLAYX_SetConnectionSettingsW(DWORD dwFlags, DWORD dwAppID, const DPLCONNECTION *lpConn)
LPCSTR DPLAYX_HresultToString(HRESULT hr)
HRESULT DPLAYX_GetConnectionSettingsW(DWORD dwAppID, LPVOID lpData, LPDWORD lpdwDataSize)
DWORD CreateLobbyMessageReceptionThread(HANDLE hNotifyEvent, HANDLE hStart, HANDLE hDeath, HANDLE hConnRead)
#define DPQ_INIT(head)
Definition: dplayx_queue.h:54
#define DPQ_ENTRY(type)
Definition: dplayx_queue.h:45
#define DPQ_HEAD(type)
Definition: dplayx_queue.h:39
#define DPQ_DELETEQ(head, field, type, df)
Definition: dplayx_queue.h:199
static HRESULT DPL_ConnectEx(IDirectPlayLobbyImpl *This, DWORD dwFlags, REFIID riid, void **lplpDP, IUnknown *pUnk)
Definition: dplobby.c:189
static HRESULT WINAPI IDirectPlayLobby3Impl_QueryInterface(IDirectPlayLobby3 *iface, REFIID riid, void **ppv)
Definition: dplobby.c:103
static ULONG WINAPI IDirectPlayLobby3AImpl_Release(IDirectPlayLobby3A *iface)
Definition: dplobby.c:154
static const IDirectPlayLobby3Vtbl dpl3_vt
Definition: dplobby.c:1378
static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumAddressTypes(IDirectPlayLobby3A *iface, LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback, REFGUID guidSP, void *lpContext, DWORD dwFlags)
Definition: dplobby.c:403
HRESULT WINAPI DirectPlayLobbyCreateW(GUID *lpGUIDDSP, IDirectPlayLobby **lplpDPL, IUnknown *lpUnk, void *lpData, DWORD dwDataSize)
Definition: dplobby.c:1463
static HRESULT WINAPI IDirectPlayLobby3AImpl_QueryInterface(IDirectPlayLobby3A *iface, REFIID riid, void **ppv)
Definition: dplobby.c:96
static HRESULT WINAPI IDirectPlayLobby3Impl_EnumAddress(IDirectPlayLobby3 *iface, LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, const void *lpAddress, DWORD dwAddressSize, void *lpContext)
Definition: dplobby.c:356
struct tagRunApplicationEnumStruct RunApplicationEnumStruct
static HRESULT WINAPI IDirectPlayLobby3AImpl_CreateAddress(IDirectPlayLobby3A *iface, REFGUID guidSP, REFGUID guidDataType, const void *lpData, DWORD dwDataSize, void *lpAddress, DWORD *lpdwAddressSize)
Definition: dplobby.c:291
static HRESULT WINAPI IDirectPlayLobby3AImpl_RegisterApplication(IDirectPlayLobby3A *iface, DWORD flags, DPAPPLICATIONDESC *appdesc)
Definition: dplobby.c:1300
static HRESULT WINAPI IDirectPlayLobby3Impl_SetConnectionSettings(IDirectPlayLobby3 *iface, DWORD dwFlags, DWORD dwAppID, DPLCONNECTION *lpConn)
Definition: dplobby.c:1015
static HRESULT WINAPI IDirectPlayLobby3Impl_Connect(IDirectPlayLobby3 *iface, DWORD flags, IDirectPlay2 **dp, IUnknown *unk)
Definition: dplobby.c:273
static HRESULT WINAPI IDirectPlayLobby3Impl_GetConnectionSettings(IDirectPlayLobby3 *iface, DWORD dwAppID, void *lpData, DWORD *lpdwDataSize)
Definition: dplobby.c:668
static HRESULT WINAPI IDirectPlayLobby3AImpl_ConnectEx(IDirectPlayLobby3A *iface, DWORD dwFlags, REFIID riid, void **lplpDP, IUnknown *pUnk)
Definition: dplobby.c:1286
static HRESULT WINAPI IDirectPlayLobby3Impl_EnumAddressTypes(IDirectPlayLobby3 *iface, LPDPLENUMADDRESSTYPESCALLBACK enumaddrtypecb, REFGUID sp, void *context, DWORD flags)
Definition: dplobby.c:524
static HRESULT WINAPI IDirectPlayLobby3AImpl_UnregisterApplication(IDirectPlayLobby3A *iface, DWORD flags, REFGUID appdesc)
Definition: dplobby.c:1314
static HRESULT WINAPI IDirectPlayLobby3Impl_ConnectEx(IDirectPlayLobby3 *iface, DWORD dwFlags, REFIID riid, LPVOID *lplpDP, IUnknown *pUnk)
Definition: dplobby.c:1279
static HRESULT WINAPI IDirectPlayLobby3Impl_CreateAddress(IDirectPlayLobby3 *iface, REFGUID guidSP, REFGUID guidDataType, const void *lpData, DWORD dwDataSize, void *lpAddress, DWORD *lpdwAddressSize)
Definition: dplobby.c:299
static ULONG WINAPI IDirectPlayLobby3Impl_AddRef(IDirectPlayLobby3 *iface)
Definition: dplobby.c:144
static HRESULT WINAPI IDirectPlayLobby3AImpl_ReceiveLobbyMessage(IDirectPlayLobby3A *iface, DWORD dwFlags, DWORD dwAppID, DWORD *lpdwMessageFlags, void *lpData, DWORD *lpdwDataSize)
Definition: dplobby.c:695
static HRESULT WINAPI IDirectPlayLobby3AImpl_SetLobbyMessageEvent(IDirectPlayLobby3A *iface, DWORD flags, DWORD appid, HANDLE event)
Definition: dplobby.c:1080
static ULONG WINAPI IDirectPlayLobby3AImpl_AddRef(IDirectPlayLobby3A *iface)
Definition: dplobby.c:134
static BOOL CALLBACK RunApplicationA_EnumLocalApplications(LPCDPLAPPINFO lpAppInfo, LPVOID lpContext, DWORD dwFlags)
Definition: dplobby.c:728
static HRESULT WINAPI IDirectPlayLobby3Impl_WaitForConnectionSettings(IDirectPlayLobby3 *iface, DWORD dwFlags)
Definition: dplobby.c:1321
static HRESULT WINAPI IDirectPlayLobby3AImpl_SetConnectionSettings(IDirectPlayLobby3A *iface, DWORD dwFlags, DWORD dwAppID, DPLCONNECTION *lpConn)
Definition: dplobby.c:1047
static HRESULT WINAPI IDirectPlayLobby3AImpl_CreateCompoundAddress(IDirectPlayLobby3A *iface, const DPCOMPOUNDADDRESSELEMENT *lpElements, DWORD dwElementCount, void *lpAddress, DWORD *lpdwAddressSize)
Definition: dplobby.c:1101
static IDirectPlayLobbyImpl * impl_from_IDirectPlayLobby3A(IDirectPlayLobby3A *iface)
Definition: dplobby.c:80
HRESULT DPL_CreateCompoundAddress(LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount, LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface)
Definition: dplobby.c:1109
static HRESULT WINAPI IDirectPlayLobby3Impl_EnumLocalApplications(IDirectPlayLobby3 *iface, LPDPLENUMLOCALAPPLICATIONSCALLBACK lpEnumLocalAppCallback, void *lpContext, DWORD dwFlags)
Definition: dplobby.c:538
HRESULT DPL_EnumAddress(LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext)
Definition: dplobby.c:368
static HRESULT WINAPI IDirectPlayLobby3Impl_ReceiveLobbyMessage(IDirectPlayLobby3 *iface, DWORD dwFlags, DWORD dwAppID, DWORD *lpdwMessageFlags, void *lpData, DWORD *lpdwDataSize)
Definition: dplobby.c:705
static HRESULT WINAPI IDirectPlayLobby3AImpl_GetConnectionSettings(IDirectPlayLobby3A *iface, DWORD dwAppID, void *lpData, DWORD *lpdwDataSize)
Definition: dplobby.c:648
static HRESULT DPL_CreateAddress(REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize, LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface)
Definition: dplobby.c:307
static HRESULT WINAPI IDirectPlayLobby3Impl_UnregisterApplication(IDirectPlayLobby3 *iface, DWORD flags, REFGUID appdesc)
Definition: dplobby.c:1307
static HRESULT WINAPI IDirectPlayLobby3Impl_CreateCompoundAddress(IDirectPlayLobby3 *iface, const DPCOMPOUNDADDRESSELEMENT *lpElements, DWORD dwElementCount, void *lpAddress, DWORD *lpdwAddressSize)
Definition: dplobby.c:1094
static HRESULT WINAPI IDirectPlayLobby3AImpl_RunApplication(IDirectPlayLobby3A *iface, DWORD dwFlags, DWORD *lpdwAppID, DPLCONNECTION *lpConn, HANDLE hReceiveEvent)
Definition: dplobby.c:856
static IDirectPlayLobbyImpl * impl_from_IDirectPlayLobby3(IDirectPlayLobby3 *iface)
Definition: dplobby.c:75
static HRESULT WINAPI IDirectPlayLobby3AImpl_Connect(IDirectPlayLobby3A *iface, DWORD flags, IDirectPlay2A **dp, IUnknown *unk)
Definition: dplobby.c:267
static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumAddress(IDirectPlayLobby3A *iface, LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, const void *lpAddress, DWORD dwAddressSize, void *lpContext)
Definition: dplobby.c:344
static HRESULT WINAPI IDirectPlayLobby3Impl_SendLobbyMessage(IDirectPlayLobby3 *iface, DWORD flags, DWORD appid, void *data, DWORD size)
Definition: dplobby.c:1002
HRESULT WINAPI DirectPlayLobbyCreateA(GUID *lpGUIDDSP, IDirectPlayLobbyA **lplpDPL, IUnknown *lpUnk, void *lpData, DWORD dwDataSize)
Definition: dplobby.c:1434
struct DPLMSG * LPDPLMSG
Definition: dplobby.c:62
static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumLocalApplications(IDirectPlayLobby3A *iface, LPDPLENUMLOCALAPPLICATIONSCALLBACK lpEnumLocalAppCallback, void *lpContext, DWORD dwFlags)
Definition: dplobby.c:548
static const IDirectPlayLobby3Vtbl dpl3A_vt
Definition: dplobby.c:1355
static HRESULT WINAPI IDirectPlayLobby3Impl_RegisterApplication(IDirectPlayLobby3 *iface, DWORD flags, DPAPPLICATIONDESC *appdesc)
Definition: dplobby.c:1293
static HRESULT WINAPI IDirectPlayLobby3AImpl_WaitForConnectionSettings(IDirectPlayLobby3A *iface, DWORD dwFlags)
Definition: dplobby.c:1338
static void dplobby_destroy(IDirectPlayLobbyImpl *obj)
Definition: dplobby.c:85
static BOOL DPL_CreateAndSetLobbyHandles(DWORD dwDestProcessId, HANDLE hDestProcess, LPHANDLE lphStart, LPHANDLE lphDeath, LPHANDLE lphRead)
Definition: dplobby.c:804
static HRESULT WINAPI IDirectPlayLobby3Impl_SetLobbyMessageEvent(IDirectPlayLobby3 *iface, DWORD flags, DWORD appid, HANDLE event)
Definition: dplobby.c:1087
struct tagRunApplicationEnumStruct * lpRunApplicationEnumStruct
static HRESULT WINAPI IDirectPlayLobby3Impl_RunApplication(IDirectPlayLobby3 *iface, DWORD dwFlags, DWORD *lpdwAppID, DPLCONNECTION *lpConn, HANDLE hReceiveEvent)
Definition: dplobby.c:980
static ULONG WINAPI IDirectPlayLobby3Impl_Release(IDirectPlayLobby3 *iface)
Definition: dplobby.c:167
static HRESULT WINAPI IDirectPlayLobby3AImpl_SendLobbyMessage(IDirectPlayLobby3A *iface, DWORD flags, DWORD appid, void *data, DWORD size)
Definition: dplobby.c:995
HRESULT dplobby_create(REFIID riid, void **ppv)
Definition: dplobby.c:1401
struct tagDPADDRESS DPADDRESS
#define IDirectPlayLobby_Release(p)
Definition: dplobby.h:456
BOOL(CALLBACK * LPDPLENUMADDRESSTYPESCALLBACK)(REFGUID guidDataType, LPVOID lpContext, DWORD dwFlags)
Definition: dplobby.h:358
#define IDirectPlayLobby_QueryInterface(p, a, b)
Definition: dplobby.h:454
#define IDirectPlayLobby_GetConnectionSettings(p, a, b, c)
Definition: dplobby.h:463
BOOL(CALLBACK * LPDPLENUMLOCALAPPLICATIONSCALLBACK)(LPCDPLAPPINFO lpAppInfo, LPVOID lpContext, DWORD dwFlags)
Definition: dplobby.h:363
BOOL(CALLBACK * LPDPENUMADDRESSCALLBACK)(REFGUID guidDataType, DWORD dwDataSize, LPCVOID lpData, LPVOID lpContext)
Definition: dplobby.h:352
#define IDirectPlayLobby_EnumLocalApplications(p, a, b, c)
Definition: dplobby.h:462
struct IDirectPlayLobby3 IDirectPlayLobby3A
Definition: dplobby.h:50
#define IDirectPlayLobby_SetConnectionSettings(p, a, b, c)
Definition: dplobby.h:467
#define IDirectPlayLobby_EnumAddressTypes(p, a, b, c, d)
Definition: dplobby.h:461
#define IDirectPlayLobby_ConnectEx(p, a, b, c, d)
Definition: dplobby.h:472
struct IDirectPlayLobby IDirectPlayLobbyA
Definition: dplobby.h:38
#define DPLWAIT_CANCEL
Definition: dplobby.h:503
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161
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
const char * appName(const char *argv0)
Definition: loadlib.c:89
#define ZeroMemory
Definition: minwinbase.h:31
#define CopyMemory
Definition: minwinbase.h:29
CONST void * LPCVOID
Definition: minwindef.h:164
char * appid
Definition: mkisofs.c:161
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const WCHAR sp[]
Definition: suminfo.c:433
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
#define KEY_READ
Definition: nt_native.h:1026
#define LPDWORD
Definition: nt_native.h:46
#define LPVOID
Definition: nt_native.h:45
#define DWORD
Definition: nt_native.h:44
short WCHAR
Definition: pedump.c:58
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
static calc_node_t temp
Definition: rpn_ieee.c:38
strcat
Definition: string.h:92
strcpy
Definition: string.h:131
static const char *static const char const char DWORD void DWORD *static const char const char DWORD void DWORD *static const char DWORD DWORD void * buff
Definition: shcore.c:41
#define TRACE(s)
Definition: solgame.cpp:4
Definition: dplobby.c:59
CRITICAL_SECTION lock
Definition: dplobby.c:69
IDirectPlayLobby3 IDirectPlayLobby3_iface
Definition: dplobby.c:66
IDirectPlayLobby3A IDirectPlayLobby3A_iface
Definition: dplobby.c:67
Definition: scsiwmi.h:51
LPVOID lpSecurityDescriptor
Definition: compat.h:193
Definition: http.c:7252
Definition: filter.c:185
Definition: send.c:48
GUID guidDataType
Definition: dplobby.h:252
DWORD dwDataSize
Definition: dplobby.h:253
GUID guidApplication
Definition: dplobby.h:284
LPSTR lpszAppNameA
Definition: dplobby.h:288
DWORD dwSize
Definition: dplobby.h:283
LPDPSESSIONDESC2 lpSessionDesc
Definition: dplay.h:286
DWORD dwFlags
Definition: dplay.h:285
GUID guidApplication
Definition: dplay.h:235
IDirectPlayLobbyImpl * This
Definition: dplobby.c:717
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:587
#define DWORD_PTR
Definition: treelist.c:76
const char * LPCSTR
Definition: typedefs.h:52
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWORD
Definition: typedefs.h:56
uint32_t * LPDWORD
Definition: typedefs.h:59
char * LPSTR
Definition: typedefs.h:51
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1205
#define CREATE_DEFAULT_ERROR_MODE
Definition: winbase.h:216
#define CREATE_SUSPENDED
Definition: winbase.h:183
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define CREATE_NEW_CONSOLE
Definition: winbase.h:185
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1156
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define DUPLICATE_SAME_ACCESS
unsigned char BYTE
Definition: xxhash.c:193