ReactOS 0.4.17-dev-966-gf06eace
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)
 
BOOL DPLAYX_DestructData (void)
 
HRESULT DPLAYX_GetConnectionSettingsA (DWORD dwAppID, LPVOID lpData, LPDWORD lpdwDataSize)
 
HRESULT DPLAYX_GetConnectionSettingsW (DWORD dwAppID, LPVOID lpData, LPDWORD lpdwDataSize)
 
HRESULT DPLAYX_SetConnectionSettingsA (DWORD dwFlags, DWORD dwAppID, const DPLCONNECTION *lpConn)
 
HRESULT DPLAYX_SetConnectionSettingsW (DWORD dwFlags, DWORD dwAppID, const DPLCONNECTION *lpConn)
 
BOOL DPLAYX_CreateLobbyApplication (DWORD dwAppID)
 
BOOL DPLAYX_WaitForConnectionSettings (BOOL bWait)
 
BOOL DPLAYX_AnyLobbiesWaitingForConnSettings (void)
 
BOOL DPLAYX_SetLobbyHandles (DWORD dwAppID, HANDLE hStart, HANDLE hDeath, HANDLE hConnRead)
 
BOOL DPLAYX_SetLobbyMsgThreadId (DWORD dwAppId, DWORD dwThreadId)
 
LPCSTR DPLAYX_HresultToString (HRESULT hr)
 

Function Documentation

◆ DPLAYX_AnyLobbiesWaitingForConnSettings()

BOOL DPLAYX_AnyLobbiesWaitingForConnSettings ( void  )

Definition at line 1024 of file dplayx_global.c.

1025{
1026 UINT i;
1027 BOOL bFound = FALSE;
1028
1030
1031 for( i=0; i < numSupportedLobbies; i++ )
1032 {
1033 if( ( lobbyData[ i ].dwAppID != 0 ) && /* lobby initialized */
1034 ( lobbyData[ i ].bWaitForConnectionSettings ) /* Waiting */
1035 )
1036 {
1037 bFound = TRUE;
1038 break;
1039 }
1040 }
1041
1043
1044 return bFound;
1045}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DPLAYX_ReleaseSemaphore()
Definition: dplayx_global.c:64
@ numSupportedLobbies
static DPLAYX_LOBBYDATA * lobbyData
#define DPLAYX_AcquireSemaphore()
Definition: dplayx_global.c:60
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: sysinfo.c:13

Referenced by IDirectPlayLobby3AImpl_RunApplication().

◆ DPLAYX_ConstructData()

BOOL DPLAYX_ConstructData ( void  )

Definition at line 355 of file dplayx_global.c.

356{
357 SECURITY_ATTRIBUTES s_attrib;
358 BOOL bInitializeSharedMemory = FALSE;
359 LPVOID lpDesiredMemoryMapStart = (LPVOID)0x50000000;
360 HANDLE hInformOnStart;
361
362 TRACE( "DPLAYX dll loaded - construct called\n" );
363
364 /* Create a semaphore to block access to DPLAYX global data structs */
365
366 s_attrib.bInheritHandle = TRUE;
367 s_attrib.lpSecurityDescriptor = NULL;
368 s_attrib.nLength = sizeof(s_attrib);
369
370 hDplayxSema = CreateSemaphoreA( &s_attrib, 0, 1, lpszDplayxSemaName );
371
372 /* First instance creates the semaphore. Others just use it */
373 if( GetLastError() == ERROR_SUCCESS )
374 {
375 TRACE( "Semaphore %p created\n", hDplayxSema );
376
377 /* The semaphore creator will also build the shared memory */
378 bInitializeSharedMemory = TRUE;
379 }
380 else if ( GetLastError() == ERROR_ALREADY_EXISTS )
381 {
382 TRACE( "Found semaphore handle %p\n", hDplayxSema );
384 }
385 else
386 {
387 ERR( ": semaphore error %ld\n", GetLastError() );
388 return FALSE;
389 }
390
392
394 &s_attrib,
396 0,
399
400 if( GetLastError() == ERROR_SUCCESS )
401 {
402 TRACE( "File mapped %p created\n", hDplayxSharedMem );
403 }
404 else if ( GetLastError() == ERROR_ALREADY_EXISTS )
405 {
406 TRACE( "Found FileMapping handle %p\n", hDplayxSharedMem );
407 }
408 else
409 {
410 ERR( ": unable to create shared memory (%ld)\n", GetLastError() );
412 return FALSE;
413 }
414
417 0, 0, 0, lpDesiredMemoryMapStart );
418
420 {
421 /* We couldn't map the data where we wanted. Try again, allowing any
422 * location. */
425 0, 0, 0 );
426 }
427
428 if( lpSharedStaticData == NULL )
429 {
430 ERR( ": unable to map static data into process memory space (%ld)\n",
431 GetLastError() );
433 return FALSE;
434 }
435 else
436 {
437 if( lpDesiredMemoryMapStart == lpSharedStaticData )
438 {
439 TRACE( "File mapped to %p\n", lpSharedStaticData );
440 }
441 else
442 {
443 /* Presently the shared data structures use pointers. If the
444 * files are not mapped into the same area, the pointers will no
445 * longer make any sense :(
446 * FIXME: In the future make the shared data structures have some
447 * sort of fixup to make them independent between data spaces.
448 * This will also require a rework of the session data stuff.
449 */
450 ERR( "File mapped to %p (not %p). Expect failure\n",
451 lpSharedStaticData, lpDesiredMemoryMapStart );
452 }
453 }
454
455 /* Dynamic area starts just after the static area */
457
458 /* FIXME: Crude hack */
461
462 /* Initialize shared data segments. */
463 if( bInitializeSharedMemory )
464 {
465 UINT i;
466
467 TRACE( "Initializing shared memory\n" );
468
469 /* Set all lobbies to be "empty" */
470 for( i=0; i < numSupportedLobbies; i++ )
471 {
473 }
474
475 /* Set all sessions to be "empty" */
476 for( i=0; i < numSupportedSessions; i++ )
477 {
478 sessionData[i].dwSize = 0;
479 }
480
481 /* Zero out the dynamic area */
483
484 /* Just for fun sync the whole data area */
486 }
487
489
490 /* Everything was created correctly. Signal the lobby client that
491 * we started up correctly
492 */
493 if( DPLAYX_GetThisLobbyHandles( &hInformOnStart, NULL, NULL, FALSE ) &&
494 hInformOnStart
495 )
496 {
497 BOOL bSuccess;
498 bSuccess = SetEvent( hInformOnStart );
499 TRACE( "Signalling lobby app start event %p %s\n",
500 hInformOnStart, bSuccess ? "succeed" : "failed" );
501
502 /* Close out handle */
503 DPLAYX_GetThisLobbyHandles( &hInformOnStart, NULL, NULL, TRUE );
504 }
505
506 return TRUE;
507}
#define ERR(fmt,...)
Definition: precomp.h:57
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define ERROR_INVALID_ADDRESS
Definition: compat.h:106
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MapViewOfFile
Definition: compat.h:745
static const char lpszDplayxSemaName[]
Definition: dplayx_global.c:51
static BOOL DPLAYX_GetThisLobbyHandles(LPHANDLE lphStart, LPHANDLE lphDeath, LPHANDLE lphConnRead, BOOL bClearSetHandles)
static DPSESSIONDESC2 * sessionData
#define dwDynamicSharedSize
Definition: dplayx_global.c:70
static DPLAYX_MEM_SLICE * lpMemArea
Definition: dplayx_global.c:88
#define dwTotalSharedSize
Definition: dplayx_global.c:71
static void DPLAYX_InitializeLobbyDataEntry(LPDPLAYX_LOBBYDATA lpData)
static const char lpszDplayxFileMapping[]
Definition: dplayx_global.c:54
static LPVOID lpSharedStaticData
Definition: dplayx_global.c:57
@ numSupportedSessions
static HANDLE hDplayxSharedMem
Definition: dplayx_global.c:55
static HANDLE hDplayxSema
Definition: dplayx_global.c:52
#define dwStaticSharedSize
Definition: dplayx_global.c:69
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 ZeroMemory
Definition: minwinbase.h:31
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define SEC_COMMIT
Definition: mmtypes.h:100
#define PAGE_READWRITE
Definition: nt_native.h:1307
#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
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:669
HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreA(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, IN LPCSTR lpName OPTIONAL)
Definition: synchansi.c:44
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FILE_MAP_WRITE
Definition: winbase.h:157
unsigned char BYTE
Definition: xxhash.c:193

Referenced by DllMain().

◆ DPLAYX_CreateLobbyApplication()

BOOL DPLAYX_CreateLobbyApplication ( DWORD  dwAppID)

Definition at line 212 of file dplayx_global.c.

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

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

◆ DPLAYX_DestructData()

BOOL DPLAYX_DestructData ( void  )

Definition at line 513 of file dplayx_global.c.

514{
515 HANDLE hInformOnDeath;
516
517 TRACE( "DPLAYX dll unloaded - destruct called\n" );
518
519 /* If required, inform that this app is dying */
520 if( DPLAYX_GetThisLobbyHandles( NULL, &hInformOnDeath, NULL, FALSE ) &&
521 hInformOnDeath
522 )
523 {
524 BOOL bSuccess;
525 bSuccess = SetEvent( hInformOnDeath );
526 TRACE( "Signalling lobby app death event %p %s\n",
527 hInformOnDeath, bSuccess ? "succeed" : "failed" );
528
529 /* Close out handle */
530 DPLAYX_GetThisLobbyHandles( NULL, &hInformOnDeath, NULL, TRUE );
531 }
532
533 /* DO CLEAN UP (LAST) */
534
535 /* Delete the semaphore */
537
538 /* Delete shared memory file mapping */
541
542 return FALSE;
543}
#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 781 of file dplayx_global.c.

785{
786 LPDPLAYX_LOBBYDATA lpDplData;
787 DWORD dwRequiredDataSize = 0;
788 HANDLE hInformOnSettingRead;
789
791
792 if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
793 {
795
796 TRACE( "Application 0x%08lx is not lobbied\n", dwAppID );
797 return DPERR_NOTLOBBIED;
798 }
799
800 dwRequiredDataSize = DPLAYX_SizeOfLobbyDataA( lpDplData->lpConn );
801
802 /* Do they want to know the required buffer size or is the provided buffer
803 * big enough?
804 */
805 if ( ( lpData == NULL ) ||
806 ( *lpdwDataSize < dwRequiredDataSize )
807 )
808 {
810
811 *lpdwDataSize = DPLAYX_SizeOfLobbyDataA( lpDplData->lpConn );
812
814 }
815
816 DPLAYX_CopyConnStructA( lpData, lpDplData->lpConn );
817
819
820 /* They have gotten the information - signal the event if required */
821 if( DPLAYX_GetThisLobbyHandles( NULL, NULL, &hInformOnSettingRead, FALSE ) &&
822 hInformOnSettingRead
823 )
824 {
825 BOOL bSuccess;
826 bSuccess = SetEvent( hInformOnSettingRead );
827 TRACE( "Signalling setting read event %p %s\n",
828 hInformOnSettingRead, bSuccess ? "succeed" : "failed" );
829
830 /* Close out handle */
831 DPLAYX_GetThisLobbyHandles( NULL, NULL, &hInformOnSettingRead, TRUE );
832 }
833
834 return DP_OK;
835}
#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 837 of file dplayx_global.c.

841{
842 LPDPLAYX_LOBBYDATA lpDplData;
843 DWORD dwRequiredDataSize = 0;
844 HANDLE hInformOnSettingRead;
845
847
848 if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
849 {
851 return DPERR_NOTLOBBIED;
852 }
853
854 dwRequiredDataSize = DPLAYX_SizeOfLobbyDataW( lpDplData->lpConn );
855
856 /* Do they want to know the required buffer size or is the provided buffer
857 * big enough?
858 */
859 if ( ( lpData == NULL ) ||
860 ( *lpdwDataSize < dwRequiredDataSize )
861 )
862 {
864
865 *lpdwDataSize = DPLAYX_SizeOfLobbyDataW( lpDplData->lpConn );
866
868 }
869
870 DPLAYX_CopyConnStructW( lpData, lpDplData->lpConn );
871
873
874 /* They have gotten the information - signal the event if required */
875 if( DPLAYX_GetThisLobbyHandles( NULL, NULL, &hInformOnSettingRead, FALSE ) &&
876 hInformOnSettingRead
877 )
878 {
879 BOOL bSuccess;
880 bSuccess = SetEvent( hInformOnSettingRead );
881 TRACE( "Signalling setting read event %p %s\n",
882 hInformOnSettingRead, bSuccess ? "succeed" : "failed" );
883
884 /* Close out handle */
885 DPLAYX_GetThisLobbyHandles( NULL, NULL, &hInformOnSettingRead, TRUE );
886 }
887
888 return DP_OK;
889}
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 1070 of file dplayx_global.c.

1071{
1072 static char szTempStr[12];
1073
1074 switch (hr)
1075 {
1076 case DP_OK:
1077 return "DP_OK";
1079 return "DPERR_ALREADYINITIALIZED";
1080 case DPERR_ACCESSDENIED:
1081 return "DPERR_ACCESSDENIED";
1083 return "DPERR_ACTIVEPLAYERS";
1085 return "DPERR_BUFFERTOOSMALL";
1087 return "DPERR_CANTADDPLAYER";
1089 return "DPERR_CANTCREATEGROUP";
1091 return "DPERR_CANTCREATEPLAYER";
1093 return "DPERR_CANTCREATESESSION";
1095 return "DPERR_CAPSNOTAVAILABLEYET";
1096 case DPERR_EXCEPTION:
1097 return "DPERR_EXCEPTION";
1098 case DPERR_GENERIC:
1099 return "DPERR_GENERIC";
1100 case DPERR_INVALIDFLAGS:
1101 return "DPERR_INVALIDFLAGS";
1103 return "DPERR_INVALIDOBJECT";
1105 return "DPERR_INVALIDPARAMS";
1107 return "DPERR_INVALIDPLAYER";
1108 case DPERR_INVALIDGROUP:
1109 return "DPERR_INVALIDGROUP";
1110 case DPERR_NOCAPS:
1111 return "DPERR_NOCAPS";
1112 case DPERR_NOCONNECTION:
1113 return "DPERR_NOCONNECTION";
1114 case DPERR_OUTOFMEMORY:
1115 return "DPERR_OUTOFMEMORY";
1116 case DPERR_NOMESSAGES:
1117 return "DPERR_NOMESSAGES";
1119 return "DPERR_NONAMESERVERFOUND";
1120 case DPERR_NOPLAYERS:
1121 return "DPERR_NOPLAYERS";
1122 case DPERR_NOSESSIONS:
1123 return "DPERR_NOSESSIONS";
1124 case DPERR_PENDING:
1125 return "DPERR_PENDING";
1126 case DPERR_SENDTOOBIG:
1127 return "DPERR_SENDTOOBIG";
1128 case DPERR_TIMEOUT:
1129 return "DPERR_TIMEOUT";
1130 case DPERR_UNAVAILABLE:
1131 return "DPERR_UNAVAILABLE";
1132 case DPERR_UNSUPPORTED:
1133 return "DPERR_UNSUPPORTED";
1134 case DPERR_BUSY:
1135 return "DPERR_BUSY";
1136 case DPERR_USERCANCEL:
1137 return "DPERR_USERCANCEL";
1138 case DPERR_NOINTERFACE:
1139 return "DPERR_NOINTERFACE";
1141 return "DPERR_CANNOTCREATESERVER";
1142 case DPERR_PLAYERLOST:
1143 return "DPERR_PLAYERLOST";
1144 case DPERR_SESSIONLOST:
1145 return "DPERR_SESSIONLOST";
1147 return "DPERR_UNINITIALIZED";
1148 case DPERR_NONEWPLAYERS:
1149 return "DPERR_NONEWPLAYERS";
1151 return "DPERR_INVALIDPASSWORD";
1152 case DPERR_CONNECTING:
1153 return "DPERR_CONNECTING";
1155 return "DPERR_CONNECTIONLOST";
1157 return "DPERR_UNKNOWNMESSAGE";
1158 case DPERR_CANCELFAILED:
1159 return "DPERR_CANCELFAILED";
1161 return "DPERR_INVALIDPRIORITY";
1162 case DPERR_NOTHANDLED:
1163 return "DPERR_NOTHANDLED";
1164 case DPERR_CANCELLED:
1165 return "DPERR_CANCELLED";
1166 case DPERR_ABORTED:
1167 return "DPERR_ABORTED";
1169 return "DPERR_BUFFERTOOLARGE";
1171 return "DPERR_CANTCREATEPROCESS";
1173 return "DPERR_APPNOTSTARTED";
1175 return "DPERR_INVALIDINTERFACE";
1177 return "DPERR_NOSERVICEPROVIDER";
1179 return "DPERR_UNKNOWNAPPLICATION";
1180 case DPERR_NOTLOBBIED:
1181 return "DPERR_NOTLOBBIED";
1183 return "DPERR_SERVICEPROVIDERLOADED";
1185 return "DPERR_ALREADYREGISTERED";
1187 return "DPERR_NOTREGISTERED";
1189 return "DPERR_AUTHENTICATIONFAILED";
1190 case DPERR_CANTLOADSSPI:
1191 return "DPERR_CANTLOADSSPI";
1193 return "DPERR_ENCRYPTIONFAILED";
1194 case DPERR_SIGNFAILED:
1195 return "DPERR_SIGNFAILED";
1197 return "DPERR_CANTLOADSECURITYPACKAGE";
1199 return "DPERR_ENCRYPTIONNOTSUPPORTED";
1200 case DPERR_CANTLOADCAPI:
1201 return "DPERR_CANTLOADCAPI";
1202 case DPERR_NOTLOGGEDIN:
1203 return "DPERR_NOTLOGGEDIN";
1204 case DPERR_LOGONDENIED:
1205 return "DPERR_LOGONDENIED";
1206 default:
1207 /* For errors not in the list, return HRESULT as a string
1208 This part is not thread safe */
1209 WARN( "Unknown error 0x%08lx\n", hr );
1210 wsprintfA( szTempStr, "0x%08x", hr );
1211 return szTempStr;
1212 }
1213}
#define WARN(fmt,...)
Definition: precomp.h:61
HRESULT hr
Definition: delayimp.cpp:582
#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
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)

Referenced by DirectPlayCreate(), DP_BuildSPCompoundAddr(), DP_CreateSPPlayer(), DP_EnumSessionsSendAsyncRequestThread(), DP_IF_CreatePlayer(), DP_InitializeDPLSP(), DP_InitializeDPSP(), DP_MSG_ExpectReply(), DP_MSG_SendAddForwardAck(), DP_MSG_SendAddPlayerToGroup(), DP_MSG_SendCreatePlayer(), DP_MSG_SendPingReply(), DP_ReadConnections(), DP_SecureOpen(), DPL_ConnectEx(), IDirectPlayLobby3AImpl_RunApplication(), IDirectPlaySPImpl_GetSPPlayerData(), and IDirectPlaySPImpl_HandleMessage().

◆ DPLAYX_SetConnectionSettingsA()

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

Definition at line 895 of file dplayx_global.c.

899{
900 LPDPLAYX_LOBBYDATA lpDplData;
901
902 /* Parameter check */
903 if( dwFlags || !lpConn )
904 {
905 ERR("invalid parameters.\n");
906 return DPERR_INVALIDPARAMS;
907 }
908
909 /* Store information */
910 if( lpConn->dwSize != sizeof(DPLCONNECTION) )
911 {
912 ERR(": old/new DPLCONNECTION type? Size=%08lx\n", lpConn->dwSize );
913
914 return DPERR_INVALIDPARAMS;
915 }
916
918
919 if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
920 {
922
923 return DPERR_NOTLOBBIED;
924 }
925
926 if( (!lpConn->lpSessionDesc ) ||
927 ( lpConn->lpSessionDesc->dwSize != sizeof( DPSESSIONDESC2 ) )
928 )
929 {
931
932 ERR("DPSESSIONDESC passed in? Size=%lu\n",
933 lpConn->lpSessionDesc?lpConn->lpSessionDesc->dwSize:0 );
934
935 return DPERR_INVALIDPARAMS;
936 }
937
938 /* Free the existing memory */
939 DPLAYX_PrivHeapFree( lpDplData->lpConn );
940
942 DPLAYX_SizeOfLobbyDataA( lpConn ) );
943
944 DPLAYX_CopyConnStructA( lpDplData->lpConn, lpConn );
945
946
948
949 /* FIXME: Send a message - I think */
950
951 return DP_OK;
952}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static void DPLAYX_PrivHeapFree(LPVOID addr)
Definition: dplayx_global.c:90
static LPVOID DPLAYX_PrivHeapAlloc(DWORD flags, DWORD size)
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
LPDPSESSIONDESC2 lpSessionDesc
Definition: dplay.h:286
DWORD dwSize
Definition: dplay.h:284

Referenced by IDirectPlayLobby3AImpl_SetConnectionSettings().

◆ DPLAYX_SetConnectionSettingsW()

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

Definition at line 958 of file dplayx_global.c.

962{
963 LPDPLAYX_LOBBYDATA lpDplData;
964
965 /* Parameter check */
966 if( dwFlags || !lpConn )
967 {
968 ERR("invalid parameters.\n");
969 return DPERR_INVALIDPARAMS;
970 }
971
972 /* Store information */
973 if( lpConn->dwSize != sizeof(DPLCONNECTION) )
974 {
975 ERR(": old/new DPLCONNECTION type? Size=%lu\n", lpConn->dwSize );
976
977 return DPERR_INVALIDPARAMS;
978 }
979
981
982 if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
983 {
985
986 return DPERR_NOTLOBBIED;
987 }
988
989 /* Free the existing memory */
990 DPLAYX_PrivHeapFree( lpDplData->lpConn );
991
993 DPLAYX_SizeOfLobbyDataW( lpConn ) );
994
995 DPLAYX_CopyConnStructW( lpDplData->lpConn, lpConn );
996
997
999
1000 /* FIXME: Send a message - I think */
1001
1002 return DP_OK;
1003}

Referenced by IDirectPlayLobby3Impl_SetConnectionSettings().

◆ DPLAYX_SetLobbyHandles()

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

Definition at line 252 of file dplayx_global.c.

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

Referenced by DPL_CreateAndSetLobbyHandles().

◆ DPLAYX_SetLobbyMsgThreadId()

BOOL DPLAYX_SetLobbyMsgThreadId ( DWORD  dwAppId,
DWORD  dwThreadId 
)

Definition at line 1047 of file dplayx_global.c.

1048{
1049 LPDPLAYX_LOBBYDATA lpLobbyData;
1050
1052
1053 if( !DPLAYX_IsAppIdLobbied( dwAppId, &lpLobbyData ) )
1054 {
1056 return FALSE;
1057 }
1058
1059 lpLobbyData->dwLobbyMsgThreadId = dwThreadId;
1060
1062
1063 return TRUE;
1064}
DWORD dwThreadId
Definition: fdebug.c:31

Referenced by IDirectPlayLobby3AImpl_RunApplication().

◆ DPLAYX_WaitForConnectionSettings()

BOOL DPLAYX_WaitForConnectionSettings ( BOOL  bWait)

Definition at line 1005 of file dplayx_global.c.

1006{
1007 LPDPLAYX_LOBBYDATA lpLobbyData;
1008
1010
1011 if( !DPLAYX_IsAppIdLobbied( 0, &lpLobbyData ) )
1012 {
1014 return FALSE;
1015 }
1016
1017 lpLobbyData->bWaitForConnectionSettings = bWait;
1018
1020
1021 return TRUE;
1022}

Referenced by IDirectPlayLobby3AImpl_WaitForConnectionSettings(), and IDirectPlayLobby3Impl_WaitForConnectionSettings().