ReactOS 0.4.15-dev-5669-g09dde2c
dplayx_global.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "dplay.h"
Include dependency graph for dplayx_global.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BOOL DPLAYX_ConstructData (void) DECLSPEC_HIDDEN
 
BOOL DPLAYX_DestructData (void) DECLSPEC_HIDDEN
 
HRESULT DPLAYX_GetConnectionSettingsA (DWORD dwAppID, LPVOID lpData, LPDWORD lpdwDataSize) DECLSPEC_HIDDEN
 
HRESULT DPLAYX_GetConnectionSettingsW (DWORD dwAppID, LPVOID lpData, LPDWORD lpdwDataSize) DECLSPEC_HIDDEN
 
HRESULT DPLAYX_SetConnectionSettingsA (DWORD dwFlags, DWORD dwAppID, const DPLCONNECTION *lpConn) DECLSPEC_HIDDEN
 
HRESULT DPLAYX_SetConnectionSettingsW (DWORD dwFlags, DWORD dwAppID, const DPLCONNECTION *lpConn) DECLSPEC_HIDDEN
 
BOOL DPLAYX_CreateLobbyApplication (DWORD dwAppID) DECLSPEC_HIDDEN
 
BOOL DPLAYX_WaitForConnectionSettings (BOOL bWait) DECLSPEC_HIDDEN
 
BOOL DPLAYX_AnyLobbiesWaitingForConnSettings (void) DECLSPEC_HIDDEN
 
BOOL DPLAYX_SetLobbyHandles (DWORD dwAppID, HANDLE hStart, HANDLE hDeath, HANDLE hConnRead) DECLSPEC_HIDDEN
 
BOOL DPLAYX_SetLobbyMsgThreadId (DWORD dwAppId, DWORD dwThreadId) DECLSPEC_HIDDEN
 
LPCSTR DPLAYX_HresultToString (HRESULT hr) DECLSPEC_HIDDEN
 

Function Documentation

◆ DPLAYX_AnyLobbiesWaitingForConnSettings()

BOOL DPLAYX_AnyLobbiesWaitingForConnSettings ( void  )

Definition at line 1017 of file dplayx_global.c.

1018{
1019 UINT i;
1020 BOOL bFound = FALSE;
1021
1023
1024 for( i=0; i < numSupportedLobbies; i++ )
1025 {
1026 if( ( lobbyData[ i ].dwAppID != 0 ) && /* lobby initialized */
1027 ( lobbyData[ i ].bWaitForConnectionSettings ) /* Waiting */
1028 )
1029 {
1030 bFound = TRUE;
1031 break;
1032 }
1033 }
1034
1036
1037 return bFound;
1038}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
@ numSupportedLobbies
#define DPLAYX_ReleaseSemaphore()
Definition: dplayx_global.c:66
static DPLAYX_LOBBYDATA * lobbyData
#define DPLAYX_AcquireSemaphore()
Definition: dplayx_global.c:62
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50

Referenced by IDirectPlayLobby3AImpl_RunApplication().

◆ DPLAYX_ConstructData()

BOOL DPLAYX_ConstructData ( void  )

Definition at line 357 of file dplayx_global.c.

358{
359 SECURITY_ATTRIBUTES s_attrib;
360 BOOL bInitializeSharedMemory = FALSE;
361 LPVOID lpDesiredMemoryMapStart = (LPVOID)0x50000000;
362 HANDLE hInformOnStart;
363
364 TRACE( "DPLAYX dll loaded - construct called\n" );
365
366 /* Create a semaphore to block access to DPLAYX global data structs */
367
368 s_attrib.bInheritHandle = TRUE;
369 s_attrib.lpSecurityDescriptor = NULL;
370 s_attrib.nLength = sizeof(s_attrib);
371
372 hDplayxSema = CreateSemaphoreA( &s_attrib, 0, 1, lpszDplayxSemaName );
373
374 /* First instance creates the semaphore. Others just use it */
375 if( GetLastError() == ERROR_SUCCESS )
376 {
377 TRACE( "Semaphore %p created\n", hDplayxSema );
378
379 /* The semaphore creator will also build the shared memory */
380 bInitializeSharedMemory = TRUE;
381 }
382 else if ( GetLastError() == ERROR_ALREADY_EXISTS )
383 {
384 TRACE( "Found semaphore handle %p\n", hDplayxSema );
386 }
387 else
388 {
389 ERR( ": semaphore error %d\n", GetLastError() );
390 return FALSE;
391 }
392
394
396 &s_attrib,
398 0,
401
402 if( GetLastError() == ERROR_SUCCESS )
403 {
404 TRACE( "File mapped %p created\n", hDplayxSharedMem );
405 }
406 else if ( GetLastError() == ERROR_ALREADY_EXISTS )
407 {
408 TRACE( "Found FileMapping handle %p\n", hDplayxSharedMem );
409 }
410 else
411 {
412 ERR( ": unable to create shared memory (%d)\n", GetLastError() );
414 return FALSE;
415 }
416
419 0, 0, 0, lpDesiredMemoryMapStart );
420
421 if( lpSharedStaticData == NULL )
422 {
423 ERR( ": unable to map static data into process memory space (%d)\n",
424 GetLastError() );
426 return FALSE;
427 }
428 else
429 {
430 if( lpDesiredMemoryMapStart == lpSharedStaticData )
431 {
432 TRACE( "File mapped to %p\n", lpSharedStaticData );
433 }
434 else
435 {
436 /* Presently the shared data structures use pointers. If the
437 * files are not mapped into the same area, the pointers will no
438 * longer make any sense :(
439 * FIXME: In the future make the shared data structures have some
440 * sort of fixup to make them independent between data spaces.
441 * This will also require a rework of the session data stuff.
442 */
443 ERR( "File mapped to %p (not %p). Expect failure\n",
444 lpSharedStaticData, lpDesiredMemoryMapStart );
445 }
446 }
447
448 /* Dynamic area starts just after the static area */
450
451 /* FIXME: Crude hack */
454
455 /* Initialize shared data segments. */
456 if( bInitializeSharedMemory )
457 {
458 UINT i;
459
460 TRACE( "Initializing shared memory\n" );
461
462 /* Set all lobbies to be "empty" */
463 for( i=0; i < numSupportedLobbies; i++ )
464 {
466 }
467
468 /* Set all sessions to be "empty" */
469 for( i=0; i < numSupportedSessions; i++ )
470 {
471 sessionData[i].dwSize = 0;
472 }
473
474 /* Zero out the dynamic area */
476
477 /* Just for fun sync the whole data area */
479 }
480
482
483 /* Everything was created correctly. Signal the lobby client that
484 * we started up correctly
485 */
486 if( DPLAYX_GetThisLobbyHandles( &hInformOnStart, NULL, NULL, FALSE ) &&
487 hInformOnStart
488 )
489 {
491 bSuccess = SetEvent( hInformOnStart );
492 TRACE( "Signalling lobby app start event %p %s\n",
493 hInformOnStart, bSuccess ? "succeed" : "failed" );
494
495 /* Close out handle */
496 DPLAYX_GetThisLobbyHandles( &hInformOnStart, NULL, NULL, TRUE );
497 }
498
499 return TRUE;
500}
#define ERR(fmt,...)
Definition: debug.h:110
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
static const char lpszDplayxSemaName[]
Definition: dplayx_global.c:53
static BOOL DPLAYX_GetThisLobbyHandles(LPHANDLE lphStart, LPHANDLE lphDeath, LPHANDLE lphConnRead, BOOL bClearSetHandles)
static DPSESSIONDESC2 * sessionData
#define dwDynamicSharedSize
Definition: dplayx_global.c:72
static DPLAYX_MEM_SLICE * lpMemArea
Definition: dplayx_global.c:90
#define dwTotalSharedSize
Definition: dplayx_global.c:73
static void DPLAYX_InitializeLobbyDataEntry(LPDPLAYX_LOBBYDATA lpData)
static const char lpszDplayxFileMapping[]
Definition: dplayx_global.c:56
@ numSupportedSessions
static LPVOID lpSharedStaticData
Definition: dplayx_global.c:59
static HANDLE hDplayxSharedMem
Definition: dplayx_global.c:57
static HANDLE hDplayxSema
Definition: dplayx_global.c:54
#define dwStaticSharedSize
Definition: dplayx_global.c:71
static BOOLEAN bSuccess
Definition: drive.cpp:433
LPVOID NTAPI MapViewOfFileEx(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap, LPVOID lpBaseAddress)
Definition: filemap.c:162
BOOL NTAPI FlushViewOfFile(IN LPCVOID lpBaseAddress, IN SIZE_T dwNumberOfBytesToFlush)
Definition: filemap.c:352
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
Definition: filemap.c:23
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define SEC_COMMIT
Definition: mmtypes.h:99
#define PAGE_READWRITE
Definition: nt_native.h:1304
#define LPVOID
Definition: nt_native.h:45
#define TRACE(s)
Definition: solgame.cpp:4
LPVOID lpSecurityDescriptor
Definition: compat.h:193
DWORD dwSize
Definition: dplay.h:232
HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreA(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, IN LPCSTR lpName OPTIONAL)
Definition: synch.c:430
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define ZeroMemory
Definition: winbase.h:1670
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
#define FILE_MAP_WRITE
Definition: winbase.h:154
unsigned char BYTE
Definition: xxhash.c:193

Referenced by DllMain().

◆ DPLAYX_CreateLobbyApplication()

BOOL DPLAYX_CreateLobbyApplication ( DWORD  dwAppID)

Definition at line 214 of file dplayx_global.c.

215{
216 UINT i;
217
218 /* 0 is the marker for unused application data slots */
219 if( dwAppID == 0 )
220 {
221 return FALSE;
222 }
223
225
226 /* Find an empty space in the list and insert the data */
227 for( i=0; i < numSupportedLobbies; i++ )
228 {
229 if( lobbyData[ i ].dwAppID == 0 )
230 {
231 /* This process is now lobbied */
232 TRACE( "Setting lobbyData[%u] for (0x%08x,0x%08x)\n",
233 i, dwAppID, GetCurrentProcessId() );
234
235 lobbyData[ i ].dwAppID = dwAppID;
237
238 /* FIXME: Where is the best place for this? In interface or here? */
242
244 return TRUE;
245 }
246 }
247
248 ERR( "No empty lobbies\n" );
249
251 return FALSE;
252}
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158

Referenced by IDirectPlayLobby3AImpl_RunApplication(), IDirectPlayLobby3AImpl_SetConnectionSettings(), and IDirectPlayLobby3Impl_SetConnectionSettings().

◆ DPLAYX_DestructData()

BOOL DPLAYX_DestructData ( void  )

Definition at line 506 of file dplayx_global.c.

507{
508 HANDLE hInformOnDeath;
509
510 TRACE( "DPLAYX dll unloaded - destruct called\n" );
511
512 /* If required, inform that this app is dying */
513 if( DPLAYX_GetThisLobbyHandles( NULL, &hInformOnDeath, NULL, FALSE ) &&
514 hInformOnDeath
515 )
516 {
518 bSuccess = SetEvent( hInformOnDeath );
519 TRACE( "Signalling lobby app death event %p %s\n",
520 hInformOnDeath, bSuccess ? "succeed" : "failed" );
521
522 /* Close out handle */
523 DPLAYX_GetThisLobbyHandles( NULL, &hInformOnDeath, NULL, TRUE );
524 }
525
526 /* DO CLEAN UP (LAST) */
527
528 /* Delete the semaphore */
530
531 /* Delete shared memory file mapping */
534
535 return FALSE;
536}
#define CloseHandle
Definition: compat.h:739
#define UnmapViewOfFile
Definition: compat.h:746

Referenced by DllMain().

◆ DPLAYX_GetConnectionSettingsA()

HRESULT DPLAYX_GetConnectionSettingsA ( DWORD  dwAppID,
LPVOID  lpData,
LPDWORD  lpdwDataSize 
)

Definition at line 774 of file dplayx_global.c.

778{
779 LPDPLAYX_LOBBYDATA lpDplData;
780 DWORD dwRequiredDataSize = 0;
781 HANDLE hInformOnSettingRead;
782
784
785 if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
786 {
788
789 TRACE( "Application 0x%08x is not lobbied\n", dwAppID );
790 return DPERR_NOTLOBBIED;
791 }
792
793 dwRequiredDataSize = DPLAYX_SizeOfLobbyDataA( lpDplData->lpConn );
794
795 /* Do they want to know the required buffer size or is the provided buffer
796 * big enough?
797 */
798 if ( ( lpData == NULL ) ||
799 ( *lpdwDataSize < dwRequiredDataSize )
800 )
801 {
803
804 *lpdwDataSize = DPLAYX_SizeOfLobbyDataA( lpDplData->lpConn );
805
807 }
808
809 DPLAYX_CopyConnStructA( lpData, lpDplData->lpConn );
810
812
813 /* They have gotten the information - signal the event if required */
814 if( DPLAYX_GetThisLobbyHandles( NULL, NULL, &hInformOnSettingRead, FALSE ) &&
815 hInformOnSettingRead
816 )
817 {
819 bSuccess = SetEvent( hInformOnSettingRead );
820 TRACE( "Signalling setting read event %p %s\n",
821 hInformOnSettingRead, bSuccess ? "succeed" : "failed" );
822
823 /* Close out handle */
824 DPLAYX_GetThisLobbyHandles( NULL, NULL, &hInformOnSettingRead, TRUE );
825 }
826
827 return DP_OK;
828}
#define DPERR_BUFFERTOOSMALL
Definition: dplay.h:92
#define DP_OK
Definition: dplay.h:88
#define DPERR_NOTLOBBIED
Definition: dplay.h:142
static BOOL DPLAYX_IsAppIdLobbied(DWORD dwAppID, LPDPLAYX_LOBBYDATA *lplpDplData)
static DWORD DPLAYX_SizeOfLobbyDataA(const DPLCONNECTION *lpConn)
static void DPLAYX_CopyConnStructA(LPDPLCONNECTION dest, const DPLCONNECTION *src)
unsigned long DWORD
Definition: ntddk_ex.h:95
LPDPLCONNECTION lpConn

Referenced by IDirectPlayLobby3AImpl_GetConnectionSettings().

◆ DPLAYX_GetConnectionSettingsW()

HRESULT DPLAYX_GetConnectionSettingsW ( DWORD  dwAppID,
LPVOID  lpData,
LPDWORD  lpdwDataSize 
)

Definition at line 830 of file dplayx_global.c.

834{
835 LPDPLAYX_LOBBYDATA lpDplData;
836 DWORD dwRequiredDataSize = 0;
837 HANDLE hInformOnSettingRead;
838
840
841 if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
842 {
844 return DPERR_NOTLOBBIED;
845 }
846
847 dwRequiredDataSize = DPLAYX_SizeOfLobbyDataW( lpDplData->lpConn );
848
849 /* Do they want to know the required buffer size or is the provided buffer
850 * big enough?
851 */
852 if ( ( lpData == NULL ) ||
853 ( *lpdwDataSize < dwRequiredDataSize )
854 )
855 {
857
858 *lpdwDataSize = DPLAYX_SizeOfLobbyDataW( lpDplData->lpConn );
859
861 }
862
863 DPLAYX_CopyConnStructW( lpData, lpDplData->lpConn );
864
866
867 /* They have gotten the information - signal the event if required */
868 if( DPLAYX_GetThisLobbyHandles( NULL, NULL, &hInformOnSettingRead, FALSE ) &&
869 hInformOnSettingRead
870 )
871 {
873 bSuccess = SetEvent( hInformOnSettingRead );
874 TRACE( "Signalling setting read event %p %s\n",
875 hInformOnSettingRead, bSuccess ? "succeed" : "failed" );
876
877 /* Close out handle */
878 DPLAYX_GetThisLobbyHandles( NULL, NULL, &hInformOnSettingRead, TRUE );
879 }
880
881 return DP_OK;
882}
static DWORD DPLAYX_SizeOfLobbyDataW(const DPLCONNECTION *lpConn)
static void DPLAYX_CopyConnStructW(LPDPLCONNECTION dest, const DPLCONNECTION *src)

Referenced by IDirectPlayLobby3Impl_GetConnectionSettings().

◆ DPLAYX_HresultToString()

LPCSTR DPLAYX_HresultToString ( HRESULT  hr)

Definition at line 1063 of file dplayx_global.c.

1064{
1065 static char szTempStr[12];
1066
1067 switch (hr)
1068 {
1069 case DP_OK:
1070 return "DP_OK";
1072 return "DPERR_ALREADYINITIALIZED";
1073 case DPERR_ACCESSDENIED:
1074 return "DPERR_ACCESSDENIED";
1076 return "DPERR_ACTIVEPLAYERS";
1078 return "DPERR_BUFFERTOOSMALL";
1080 return "DPERR_CANTADDPLAYER";
1082 return "DPERR_CANTCREATEGROUP";
1084 return "DPERR_CANTCREATEPLAYER";
1086 return "DPERR_CANTCREATESESSION";
1088 return "DPERR_CAPSNOTAVAILABLEYET";
1089 case DPERR_EXCEPTION:
1090 return "DPERR_EXCEPTION";
1091 case DPERR_GENERIC:
1092 return "DPERR_GENERIC";
1093 case DPERR_INVALIDFLAGS:
1094 return "DPERR_INVALIDFLAGS";
1096 return "DPERR_INVALIDOBJECT";
1098 return "DPERR_INVALIDPARAMS";
1100 return "DPERR_INVALIDPLAYER";
1101 case DPERR_INVALIDGROUP:
1102 return "DPERR_INVALIDGROUP";
1103 case DPERR_NOCAPS:
1104 return "DPERR_NOCAPS";
1105 case DPERR_NOCONNECTION:
1106 return "DPERR_NOCONNECTION";
1107 case DPERR_OUTOFMEMORY:
1108 return "DPERR_OUTOFMEMORY";
1109 case DPERR_NOMESSAGES:
1110 return "DPERR_NOMESSAGES";
1112 return "DPERR_NONAMESERVERFOUND";
1113 case DPERR_NOPLAYERS:
1114 return "DPERR_NOPLAYERS";
1115 case DPERR_NOSESSIONS:
1116 return "DPERR_NOSESSIONS";
1117 case DPERR_PENDING:
1118 return "DPERR_PENDING";
1119 case DPERR_SENDTOOBIG:
1120 return "DPERR_SENDTOOBIG";
1121 case DPERR_TIMEOUT:
1122 return "DPERR_TIMEOUT";
1123 case DPERR_UNAVAILABLE:
1124 return "DPERR_UNAVAILABLE";
1125 case DPERR_UNSUPPORTED:
1126 return "DPERR_UNSUPPORTED";
1127 case DPERR_BUSY:
1128 return "DPERR_BUSY";
1129 case DPERR_USERCANCEL:
1130 return "DPERR_USERCANCEL";
1131 case DPERR_NOINTERFACE:
1132 return "DPERR_NOINTERFACE";
1134 return "DPERR_CANNOTCREATESERVER";
1135 case DPERR_PLAYERLOST:
1136 return "DPERR_PLAYERLOST";
1137 case DPERR_SESSIONLOST:
1138 return "DPERR_SESSIONLOST";
1140 return "DPERR_UNINITIALIZED";
1141 case DPERR_NONEWPLAYERS:
1142 return "DPERR_NONEWPLAYERS";
1144 return "DPERR_INVALIDPASSWORD";
1145 case DPERR_CONNECTING:
1146 return "DPERR_CONNECTING";
1148 return "DPERR_CONNECTIONLOST";
1150 return "DPERR_UNKNOWNMESSAGE";
1151 case DPERR_CANCELFAILED:
1152 return "DPERR_CANCELFAILED";
1154 return "DPERR_INVALIDPRIORITY";
1155 case DPERR_NOTHANDLED:
1156 return "DPERR_NOTHANDLED";
1157 case DPERR_CANCELLED:
1158 return "DPERR_CANCELLED";
1159 case DPERR_ABORTED:
1160 return "DPERR_ABORTED";
1162 return "DPERR_BUFFERTOOLARGE";
1164 return "DPERR_CANTCREATEPROCESS";
1166 return "DPERR_APPNOTSTARTED";
1168 return "DPERR_INVALIDINTERFACE";
1170 return "DPERR_NOSERVICEPROVIDER";
1172 return "DPERR_UNKNOWNAPPLICATION";
1173 case DPERR_NOTLOBBIED:
1174 return "DPERR_NOTLOBBIED";
1176 return "DPERR_SERVICEPROVIDERLOADED";
1178 return "DPERR_ALREADYREGISTERED";
1180 return "DPERR_NOTREGISTERED";
1182 return "DPERR_AUTHENTICATIONFAILED";
1183 case DPERR_CANTLOADSSPI:
1184 return "DPERR_CANTLOADSSPI";
1186 return "DPERR_ENCRYPTIONFAILED";
1187 case DPERR_SIGNFAILED:
1188 return "DPERR_SIGNFAILED";
1190 return "DPERR_CANTLOADSECURITYPACKAGE";
1192 return "DPERR_ENCRYPTIONNOTSUPPORTED";
1193 case DPERR_CANTLOADCAPI:
1194 return "DPERR_CANTLOADCAPI";
1195 case DPERR_NOTLOGGEDIN:
1196 return "DPERR_NOTLOGGEDIN";
1197 case DPERR_LOGONDENIED:
1198 return "DPERR_LOGONDENIED";
1199 default:
1200 /* For errors not in the list, return HRESULT as a string
1201 This part is not thread safe */
1202 WARN( "Unknown error 0x%08x\n", hr );
1203 wsprintfA( szTempStr, "0x%08x", hr );
1204 return szTempStr;
1205 }
1206}
#define WARN(fmt,...)
Definition: debug.h:112
#define DPERR_INVALIDOBJECT
Definition: dplay.h:101
#define DPERR_BUSY
Definition: dplay.h:119
#define DPERR_NOCAPS
Definition: dplay.h:106
#define DPERR_ACCESSDENIED
Definition: dplay.h:90
#define DPERR_UNKNOWNAPPLICATION
Definition: dplay.h:141
#define DPERR_GENERIC
Definition: dplay.h:99
#define DPERR_NOTLOGGEDIN
Definition: dplay.h:153
#define DPERR_NOSESSIONS
Definition: dplay.h:113
#define DPERR_LOGONDENIED
Definition: dplay.h:154
#define DPERR_NOTREGISTERED
Definition: dplay.h:145
#define DPERR_PENDING
Definition: dplay.h:114
#define DPERR_CANTADDPLAYER
Definition: dplay.h:93
#define DPERR_NOSERVICEPROVIDER
Definition: dplay.h:140
#define DPERR_BUFFERTOOLARGE
Definition: dplay.h:136
#define DPERR_SESSIONLOST
Definition: dplay.h:124
#define DPERR_NONEWPLAYERS
Definition: dplay.h:126
#define DPERR_UNINITIALIZED
Definition: dplay.h:125
#define DPERR_CANTCREATEPLAYER
Definition: dplay.h:95
#define DPERR_ALREADYREGISTERED
Definition: dplay.h:144
#define DPERR_INVALIDGROUP
Definition: dplay.h:105
#define DPERR_AUTHENTICATIONFAILED
Definition: dplay.h:146
#define DPERR_ENCRYPTIONFAILED
Definition: dplay.h:148
#define DPERR_INVALIDINTERFACE
Definition: dplay.h:139
#define DPERR_EXCEPTION
Definition: dplay.h:98
#define DPERR_NOINTERFACE
Definition: dplay.h:121
#define DPERR_ABORTED
Definition: dplay.h:135
#define DPERR_CANNOTCREATESERVER
Definition: dplay.h:122
#define DPERR_CANTLOADCAPI
Definition: dplay.h:152
#define DPERR_ENCRYPTIONNOTSUPPORTED
Definition: dplay.h:151
#define DPERR_CAPSNOTAVAILABLEYET
Definition: dplay.h:97
#define DPERR_CONNECTING
Definition: dplay.h:128
#define DPERR_CONNECTIONLOST
Definition: dplay.h:129
#define DPERR_ALREADYINITIALIZED
Definition: dplay.h:89
#define DPERR_INVALIDFLAGS
Definition: dplay.h:100
#define DPERR_CANTLOADSSPI
Definition: dplay.h:147
#define DPERR_TIMEOUT
Definition: dplay.h:116
#define DPERR_SERVICEPROVIDERLOADED
Definition: dplay.h:143
#define DPERR_UNSUPPORTED
Definition: dplay.h:118
#define DPERR_PLAYERLOST
Definition: dplay.h:123
#define DPERR_UNKNOWNMESSAGE
Definition: dplay.h:130
#define DPERR_CANTCREATEGROUP
Definition: dplay.h:94
#define DPERR_CANCELLED
Definition: dplay.h:134
#define DPERR_UNAVAILABLE
Definition: dplay.h:117
#define DPERR_NONAMESERVERFOUND
Definition: dplay.h:111
#define DPERR_CANCELFAILED
Definition: dplay.h:131
#define DPERR_APPNOTSTARTED
Definition: dplay.h:138
#define DPERR_SIGNFAILED
Definition: dplay.h:149
#define DPERR_INVALIDPLAYER
Definition: dplay.h:104
#define DPERR_USERCANCEL
Definition: dplay.h:120
#define DPERR_NOCONNECTION
Definition: dplay.h:107
#define DPERR_INVALIDPARAMS
Definition: dplay.h:103
#define DPERR_INVALIDPASSWORD
Definition: dplay.h:127
#define DPERR_ACTIVEPLAYERS
Definition: dplay.h:91
#define DPERR_OUTOFMEMORY
Definition: dplay.h:109
#define DPERR_CANTCREATEPROCESS
Definition: dplay.h:137
#define DPERR_INVALIDPRIORITY
Definition: dplay.h:132
#define DPERR_CANTCREATESESSION
Definition: dplay.h:96
#define DPERR_NOTHANDLED
Definition: dplay.h:133
#define DPERR_SENDTOOBIG
Definition: dplay.h:115
#define DPERR_NOMESSAGES
Definition: dplay.h:110
#define DPERR_NOPLAYERS
Definition: dplay.h:112
#define DPERR_CANTLOADSECURITYPACKAGE
Definition: dplay.h:150
HRESULT hr
Definition: shlfolder.c:183
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)

Referenced by DirectPlayCreate(), DP_BuildSPCompoundAddr(), DP_EnumSessionsSendAsyncRequestThread(), DP_IF_CreatePlayer(), DP_InitializeDPLSP(), DP_InitializeDPSP(), DP_MSG_ErrorReceived(), DP_MSG_ExpectReply(), DP_SecureOpen(), DPL_ConnectEx(), IDirectPlay4AImpl_EnumConnections(), IDirectPlayLobby3AImpl_RunApplication(), IDirectPlaySPImpl_GetSPPlayerData(), and IDirectPlaySPImpl_HandleMessage().

◆ DPLAYX_SetConnectionSettingsA()

HRESULT DPLAYX_SetConnectionSettingsA ( DWORD  dwFlags,
DWORD  dwAppID,
const DPLCONNECTION lpConn 
)

Definition at line 888 of file dplayx_global.c.

892{
893 LPDPLAYX_LOBBYDATA lpDplData;
894
895 /* Parameter check */
896 if( dwFlags || !lpConn )
897 {
898 ERR("invalid parameters.\n");
899 return DPERR_INVALIDPARAMS;
900 }
901
902 /* Store information */
903 if( lpConn->dwSize != sizeof(DPLCONNECTION) )
904 {
905 ERR(": old/new DPLCONNECTION type? Size=%08x\n", lpConn->dwSize );
906
907 return DPERR_INVALIDPARAMS;
908 }
909
911
912 if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
913 {
915
916 return DPERR_NOTLOBBIED;
917 }
918
919 if( (!lpConn->lpSessionDesc ) ||
920 ( lpConn->lpSessionDesc->dwSize != sizeof( DPSESSIONDESC2 ) )
921 )
922 {
924
925 ERR("DPSESSIONDESC passed in? Size=%u\n",
926 lpConn->lpSessionDesc?lpConn->lpSessionDesc->dwSize:0 );
927
928 return DPERR_INVALIDPARAMS;
929 }
930
931 /* Free the existing memory */
932 DPLAYX_PrivHeapFree( lpDplData->lpConn );
933
935 DPLAYX_SizeOfLobbyDataA( lpConn ) );
936
937 DPLAYX_CopyConnStructA( lpDplData->lpConn, lpConn );
938
939
941
942 /* FIXME: Send a message - I think */
943
944 return DP_OK;
945}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static void DPLAYX_PrivHeapFree(LPVOID addr)
Definition: dplayx_global.c:92
static LPVOID DPLAYX_PrivHeapAlloc(DWORD flags, DWORD size)
LPDPSESSIONDESC2 lpSessionDesc
Definition: dplay.h:286
DWORD dwSize
Definition: dplay.h:284
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by IDirectPlayLobby3AImpl_SetConnectionSettings().

◆ DPLAYX_SetConnectionSettingsW()

HRESULT DPLAYX_SetConnectionSettingsW ( DWORD  dwFlags,
DWORD  dwAppID,
const DPLCONNECTION lpConn 
)

Definition at line 951 of file dplayx_global.c.

955{
956 LPDPLAYX_LOBBYDATA lpDplData;
957
958 /* Parameter check */
959 if( dwFlags || !lpConn )
960 {
961 ERR("invalid parameters.\n");
962 return DPERR_INVALIDPARAMS;
963 }
964
965 /* Store information */
966 if( lpConn->dwSize != sizeof(DPLCONNECTION) )
967 {
968 ERR(": old/new DPLCONNECTION type? Size=%u\n", lpConn->dwSize );
969
970 return DPERR_INVALIDPARAMS;
971 }
972
974
975 if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
976 {
978
979 return DPERR_NOTLOBBIED;
980 }
981
982 /* Free the existing memory */
983 DPLAYX_PrivHeapFree( lpDplData->lpConn );
984
986 DPLAYX_SizeOfLobbyDataW( lpConn ) );
987
988 DPLAYX_CopyConnStructW( lpDplData->lpConn, lpConn );
989
990
992
993 /* FIXME: Send a message - I think */
994
995 return DP_OK;
996}

Referenced by IDirectPlayLobby3Impl_SetConnectionSettings().

◆ DPLAYX_SetLobbyHandles()

BOOL DPLAYX_SetLobbyHandles ( DWORD  dwAppID,
HANDLE  hStart,
HANDLE  hDeath,
HANDLE  hConnRead 
)

Definition at line 254 of file dplayx_global.c.

256{
257 LPDPLAYX_LOBBYDATA lpLData;
258
259 /* Need to explicitly give lobby application. Can't set for yourself */
260 if( dwAppID == 0 )
261 {
262 return FALSE;
263 }
264
266
267 if( !DPLAYX_IsAppIdLobbied( dwAppID, &lpLData ) )
268 {
270 return FALSE;
271 }
272
273 lpLData->hInformOnAppStart = hStart;
274 lpLData->hInformOnAppDeath = hDeath;
275 lpLData->hInformOnSettingRead = hConnRead;
276
278
279 return TRUE;
280}

Referenced by DPL_CreateAndSetLobbyHandles().

◆ DPLAYX_SetLobbyMsgThreadId()

BOOL DPLAYX_SetLobbyMsgThreadId ( DWORD  dwAppId,
DWORD  dwThreadId 
)

Definition at line 1040 of file dplayx_global.c.

1041{
1042 LPDPLAYX_LOBBYDATA lpLobbyData;
1043
1045
1046 if( !DPLAYX_IsAppIdLobbied( dwAppId, &lpLobbyData ) )
1047 {
1049 return FALSE;
1050 }
1051
1052 lpLobbyData->dwLobbyMsgThreadId = dwThreadId;
1053
1055
1056 return TRUE;
1057}
DWORD dwThreadId
Definition: fdebug.c:31

Referenced by IDirectPlayLobby3AImpl_RunApplication().

◆ DPLAYX_WaitForConnectionSettings()

BOOL DPLAYX_WaitForConnectionSettings ( BOOL  bWait)

Definition at line 998 of file dplayx_global.c.

999{
1000 LPDPLAYX_LOBBYDATA lpLobbyData;
1001
1003
1004 if( !DPLAYX_IsAppIdLobbied( 0, &lpLobbyData ) )
1005 {
1007 return FALSE;
1008 }
1009
1010 lpLobbyData->bWaitForConnectionSettings = bWait;
1011
1013
1014 return TRUE;
1015}

Referenced by IDirectPlayLobby3AImpl_WaitForConnectionSettings(), and IDirectPlayLobby3Impl_WaitForConnectionSettings().