Commit 88d89f93 authored by Peter Hunnisett's avatar Peter Hunnisett Committed by Alexandre Julliard

- Added dplayx LibMain for initialization of all dplayx 'global' data

- Added start for global data manipulation - TODO list updated - Added some missing header file definitions - Added the ansi versions of dplay and dplobby - Fixed invalid macro for IDirectPlay4 - Cleaned up compiler warnings - More implementation, bug fixes and critical region protection
parent a69bc029
......@@ -9,7 +9,9 @@ SPEC_SRCS = dplay.spec dplayx.spec
C_SRCS = dplay.c \
dplobby.c \
dpclassfactory.c
dpclassfactory.c \
dplayx_main.c \
dplayx_global.c
all: $(MODULE).o
......
name dplayx
type win32
init DPLAYX_LibMain
1 stdcall DirectPlayCreate(ptr ptr ptr ptr) DirectPlayCreate
2 stdcall DirectPlayEnumerateA(ptr ptr) DirectPlayEnumerateA
......
#ifndef __WINE_DPLAYX_GLOBAL
#define __WINE_DPLAYX_GLOBAL
#include "dplay.h"
void DPLAYX_ConstructData(void);
void 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, LPDPLCONNECTION lpConn );
HRESULT DPLAYX_SetConnectionSettingsW ( DWORD dwFlags, DWORD dwAppID, LPDPLCONNECTION lpConn );
BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID, HANDLE hReceiveEvent );
/* This is a hack to ensure synchronization during application spawn */
#if !defined( WORKING_PROCESS_SUSPEND )
DWORD DPLAYX_AquireSemaphoreHack( void );
DWORD DPLAYX_ReleaseSemaphoreHack( void );
#endif
#endif /* __WINE_DPLAYX_GLOBAL */
/*
* DPLAYX.DLL LibMain
*
* Copyright 1999 - Peter Hunnisett
*
* contact <hunnise@nortelnetworks.com>
*/
#include "winbase.h"
#include "debugtools.h"
#include "dplayx_global.h"
DEFAULT_DEBUG_CHANNEL(dplay)
static DWORD DPLAYX_dwProcessesAttached = 0;
BOOL WINAPI DPLAYX_LibMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
switch ( fdwReason )
{
case DLL_PROCESS_ATTACH:
{
if ( DPLAYX_dwProcessesAttached == 0 )
{
/* First instance perform construction of global processor data */
DPLAYX_ConstructData();
}
DPLAYX_dwProcessesAttached++;
break;
}
case DLL_PROCESS_DETACH:
{
DPLAYX_dwProcessesAttached--;
if ( DPLAYX_dwProcessesAttached == 0 )
{
/* Last instance perform destruction of global processor data */
DPLAYX_DestructData();
}
break;
}
case DLL_THREAD_ATTACH: /* Do nothing */
case DLL_THREAD_DETACH: /* Do nothing */
break;
default:
break;
}
return TRUE;
}
......@@ -32,34 +32,42 @@ TODO:
- (done) Create and move to correct dll directories (dplay and dplayx)
- (done) Implement dplay in terms of dplayx
- (started) Need a better internal implementation for the objects which scales and
preferably doesn't involve casting structures
preferably doesn't involve casting structures (dplobby done)
- (started) More generic initialization and destruction helper methods based off
the chosen internal implementation
- How to deal with all the incorrect interfaces for IUnknown methods. The standard
wine macros are incorrect in that they always give IUnknown* rather than DirectPlayLobby2A
for instance. Are we forced to cast?
- Implement a lib main for the dplayx dll
the chosen internal implementation (dplobby done)
- Use only windows routines where an equivalent is available
- (done) Fix wine dplay.h and dplobby.h header files to allow apps to create the ansi versions
- (started) Port some WineLib test programs using sdk programs (both C and C++ progs)
- (done) Implement a lib main for the dplayx dll (required for RunApplication, etc.)
- Figure out how to share the global memory correctly
- Ensure that all dll stubs are present and the ordinals are correct
- Implementation of functionality
- (started)Implementation of functionality
- Addition of DirectX 7.0 functionality for direct play (try to catch that moving train)
- bug fixes ;)
- Implement some WineLib test programs using sdk programs as a skeleton
Programs to make work:
- lserver.exe (from sdk)
- override.exe (from sdk)
- dpchat.exe (from sdk)
- duel.exe (from sdk)
- dplaunch.exe (from sdk)
Next API to implement on a per program basis:
override.exe
- IDirectPlay3AImp_EnumConnections
- fixme:dplay:DirectPlayCreate Modem binding not supported yet
- DirectPlay3AImpl_InitializeConnection
- DirectPlay2AImpl_Open
- ?
dplaunch.exe
- IDirectPlayLobbyAImpl_EnumLocalApplications
- IDirectPlayLobby2AImpl_CreateCompoundAddress
- IDirectPlayLobbyAImpl_RunApplication
- ?
lserver.exe
- IDirectPlayLobby2WImpl_Connect
- fixme:dplay:DirectPlayCreate Modem binding not supported yet
- IDirectPlay3WImpl_CreatePlayer
- IDirectPlay3WImpl_CreateGroup
- IDirectPlay3WImpl_SetGroupData
......@@ -67,12 +75,19 @@ Next API to implement on a per program basis:
- ?
bellhop.exe
- DirectPlay3AImpl_EnumConnections
- DirectPlay3AImpl_EnumConnections (lobby applications)
- ?
dpslots.exe
- IDirectPlayLobbyAImpl_SetConnectionSettings
- IDirectPlayAImpl_EnumConnections
- IDirectPlayLobby3AImpl_ConnectEx
- ?
Other TODO:
- look at problem with parsing the resource file for dplaunch. wrc problem?
- I should be getting the dialog box to come up for dpchat when something is selected
Call OLE32.7: CoCreateInstance(010017f0,00000000,00000001,010017e0,010094b4) ret=01002f38 fs=0237
Call ADVAPI32.188: RegOpenKeyExA(80000002,5e08dd90 "Software\\Microsoft\\DirectPlay\\Compatibility",00000000,00020019,40e7f49c) ret=5e0b6e5a fs=0237
Peter Hunnisett - hunnise@nortelnetworks.com
......@@ -384,6 +384,8 @@ typedef BOOL (CALLBACK* LPDPENUMSESSIONSCALLBACK2)(
DWORD dwFlags,
LPVOID lpContext );
#define DPESC_TIMEDOUT 0x00000001
#include "poppack.h"
/*****************************************************************************
......@@ -449,7 +451,7 @@ ICOM_DEFINE(IDirectPlay,IUnknown)
/*****************************************************************************
* IDirectPlay2 interface
* IDirectPlay2 and IDirectPlay2A interface
*/
#define ICOM_INTERFACE IDirectPlay2
#define IDirectPlay2_METHODS \
......@@ -525,7 +527,7 @@ ICOM_DEFINE(IDirectPlay2,IUnknown)
/*****************************************************************************
* IDirectPlay3 interface
* IDirectPlay3 and IDirectPlay3A interface
*/
#define ICOM_INTERFACE IDirectPlay3
#define IDirectPlay3_METHODS \
......@@ -602,11 +604,7 @@ ICOM_DEFINE(IDirectPlay3,IDirectPlay2)
#define IDirectPlay3_GetPlayerFlags(p,a,b) ICOM_CALL2(GetPlayerFlags,p,a,b)
/*****************************************************************************
* IDirectPlay4 interface - this is also known as IDirectPlayX. Apparently people
* are realizing that declaring all the darn interfaces as IDirectPlay{2,3,...} is
* just plain dumb. It's now going to be just IDirectPlayX since they're just macros
* anyways. That's good because I'm tired of typing these entries :)
* The compiler should catch any problems with invocation of invalid method :)
* IDirectPlay4 and IDirectPlay4A interface
*/
#define ICOM_INTERFACE IDirectPlay4
#define IDirectPlay4_METHODS \
......@@ -617,11 +615,10 @@ ICOM_DEFINE(IDirectPlay3,IDirectPlay2)
ICOM_METHOD2( HRESULT, CancelMessage, DWORD,, DWORD, ) \
ICOM_METHOD3( HRESULT, CancelPriority, DWORD,, DWORD,, DWORD, )
#define IDirectPlay4_IMETHODS
#define IDirectPlay4_IMETHODS \
IDirectPlay3_IMETHODS \
IDirectPlay4_METHODS
ICOM_DEFINE(IDirectPlay4,IDirectPlay3)
#undef ICOM_INTERFACE
/*** IUnknown methods ***/
......@@ -682,6 +679,7 @@ ICOM_DEFINE(IDirectPlay4,IDirectPlay3)
#define IDirectPlayX_CancelMessage(p,a,b) ICOM_CALL2(CancelMessage,a,b)
#define IDirectPlayX_CancelPriority(p,a,b,c) ICOM_CALL3(CancelPriority,a,b,c)
/* For DirectPlay::EnumConnections */
#define DPCONNECTION_DIRECTPLAY 0x00000001
#define DPCONNECTION_DIRECTPLAYLOBBY 0x00000002
......
......@@ -34,7 +34,7 @@ DEFINE_GUID(IID_IDirectPlayLobby3, 0x2db72490, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0,
typedef struct IDirectPlayLobby3 IDirectPlayLobby3, *LPDIRECTPLAYLOBBY3;
DEFINE_GUID(IID_IDirectPlayLobby3A, 0x2db72491, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
typedef struct IDirectPlayLobby3A IDirectPlayLobby3A, *LPDIRECTPLAYLOBBY3A;
typedef struct IDirectPlayLobby3 IDirectPlayLobby3A, *LPDIRECTPLAYLOBBY3A;
/*****************************************************************************
......@@ -223,7 +223,7 @@ DEFINE_GUID(DPAID_INet, 0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9,
DEFINE_GUID(DPAID_INetW, 0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* DPAID_INetPort {E4524541-8EA5-11d1-8A96-006097B01411}
* Chunk purpose: Chunk is a port number used for creating TCP and UDP sockets.
* Chunk purpose: Chunk is a port number used for creating TCP and UDP sockets. (WORD)
*/
DEFINE_GUID(DPAID_INetPort, 0xe4524541, 0x8ea5, 0x11d1, 0x8a, 0x96, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
......@@ -331,8 +331,8 @@ typedef struct tagDPAPPLICATIONDESC
extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD );
extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD );
extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY*, IUnknown*, LPVOID, DWORD );
extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA*, IUnknown*, LPVOID, DWORD );
......@@ -355,7 +355,7 @@ typedef BOOL (CALLBACK* LPDPLENUMLOCALAPPLICATIONSCALLBACK)(
#include "poppack.h"
/*****************************************************************************
* IDirectPlayLobby interface
* IDirectPlayLobby and IDirectPlayLobbyA interface
*/
#define ICOM_INTERFACE IDirectPlayLobby
#define IDirectPlayLobby_METHODS \
......@@ -377,7 +377,7 @@ ICOM_DEFINE(IDirectPlayLobby,IUnknown)
#undef ICOM_INTERFACE
/*****************************************************************************
* IDirectPlayLobby2 interface
* IDirectPlayLobby2 and IDirectPlayLobby2A interface
*/
#define ICOM_INTERFACE IDirectPlayLobby2
#define IDirectPlayLobby2_METHODS \
......@@ -389,9 +389,8 @@ ICOM_DEFINE(IDirectPlayLobby2,IDirectPlayLobby)
#undef ICOM_INTERFACE
/*****************************************************************************
* IDirectPlayLobby3 interface
* IDirectPlayLobby3 and IDirectPlayLobby3A interface
*/
#define ICOM_INTERFACE IDirectPlayLobby3
#define IDirectPlayLobby3_METHODS \
ICOM_METHOD4( HRESULT, ConnectEx, DWORD,, REFIID,, LPVOID *,, IUnknown *,) \
......@@ -405,11 +404,9 @@ ICOM_DEFINE(IDirectPlayLobby2,IDirectPlayLobby)
ICOM_DEFINE(IDirectPlayLobby3,IDirectPlayLobby2)
#undef ICOM_INTERFACE
/*** IUnknown methods ***/
#define IDirectPlayLobby_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IDirectPlayLobby_AddRef(p) ICOM_CALL (AddRef,p)
#define IDirectPlayLobby_Release(p) ICOM_CALL (Release,p)
/*** IDirectPlayLobby methods ***/
#define IDirectPlayLobby_Connect(p,a,b,c) ICOM_CALL3(Connect,p,a,b,c)
#define IDirectPlayLobby_ConnectEx(p,a,b,c,d) ICOM_CALL4(ConnectEx,p,a,b,c,d)
#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) ICOM_CALL6(CreateAddress,p,a,b,c,d,e,f)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment