Commit 22b861c1 authored by Peter Hunnisett's avatar Peter Hunnisett Committed by Alexandre Julliard

- Moved dplay and dplayx to a proper home in the dlls directory.

- Implemented new DirectPlay4 and DirectPlayLobby3 interfaces. - Implemented a class factory for dplay and dplobby. COM interfaces now work for dp and dpl. - Added a few more entries to dplayx.spec files. How do you find the ordinals? I just guessed :( - Seperated DirectPlay and DirectPlayLobby implementation into separate files. - Included some missing header file definitions. - Implemented the dplay dll in terms of the dplayx dll. I haven't tested it so it may not work... - A few bug fixes and a little new implementatioe.n - Updated document with a more detailed implementation plan.
parent a018d850
......@@ -36,6 +36,7 @@ LIBSUBDIRS = \
dlls/commdlg \
dlls/crtdll \
dlls/dciman32 \
dlls/dplayx \
dlls/imagehlp \
dlls/imm32 \
dlls/lzexpand \
......@@ -135,6 +136,7 @@ LIBOBJS = \
dlls/commdlg/commdlg.o \
dlls/crtdll/crtdll.o \
dlls/dciman32/dciman32.o \
dlls/dplayx/dplayx.o \
dlls/imagehlp/imagehlp.o \
dlls/imm32/imm32.o \
dlls/lzexpand/lzexpand.o \
......
......@@ -5624,6 +5624,7 @@ dlls/comctl32/Makefile
dlls/commdlg/Makefile
dlls/crtdll/Makefile
dlls/dciman32/Makefile
dlls/dplayx/Makefile
dlls/imagehlp/Makefile
dlls/imm32/Makefile
dlls/lzexpand/Makefile
......@@ -5819,6 +5820,7 @@ dlls/comctl32/Makefile
dlls/commdlg/Makefile
dlls/crtdll/Makefile
dlls/dciman32/Makefile
dlls/dplayx/Makefile
dlls/imagehlp/Makefile
dlls/imm32/Makefile
dlls/lzexpand/Makefile
......
......@@ -831,6 +831,7 @@ dlls/comctl32/Makefile
dlls/commdlg/Makefile
dlls/crtdll/Makefile
dlls/dciman32/Makefile
dlls/dplayx/Makefile
dlls/imagehlp/Makefile
dlls/imm32/Makefile
dlls/lzexpand/Makefile
......
......@@ -5,6 +5,7 @@ SUBDIRS = \
commdlg \
crtdll \
dciman32 \
dplayx \
imagehlp \
imm32 \
lzexpand \
......
Makefile
dplay.spec.c
dplayx.spec.c
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = dplayx
SPEC_SRCS = dplay.spec dplayx.spec
C_SRCS = dplay.c \
dplobby.c \
dpclassfactory.c
all: $(MODULE).o
@MAKE_RULES@
### Dependencies:
#include "wine/obj_base.h"
#include "winerror.h"
#include "debugtools.h"
#include "dpinit.h"
DEFAULT_DEBUG_CHANNEL(dplay)
/*******************************************************************************
* DirectPlayLobby ClassFactory
*/
typedef struct
{
/* IUnknown fields */
ICOM_VTABLE(IClassFactory)* lpvtbl;
DWORD ref;
} IClassFactoryImpl;
static HRESULT WINAPI
DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
char buf[80];
if (HIWORD(riid))
WINE_StringFromCLSID(riid,buf);
else
sprintf(buf,"<guid-0x%04x>",LOWORD(riid));
FIXME("(%p)->(%s,%p),stub!\n",This,buf,ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI
DP_and_DPL_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class (reference starts @ 1), won't ever be freed */
return --(This->ref);
}
/* Not the most efficient implementation, but it's simple */
static HRESULT WINAPI DP_and_DPL_CreateInstance(
LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
) {
ICOM_THIS(IClassFactoryImpl,iface);
char buf[80];
WINE_StringFromCLSID(riid,buf);
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,buf,ppobj);
/* FIXME: reuse already created DP/DPL object if present? */
if ( directPlayLobby_QueryInterface( riid, ppobj ) == S_OK )
{
return S_OK;
}
else if ( directPlay_QueryInterface( riid, ppobj ) == S_OK )
{
return S_OK;
}
return E_NOINTERFACE;
}
static HRESULT WINAPI DP_and_DPL_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n",This,dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) DP_and_DPL_Vtbl = {
DP_and_DPL_QueryInterface,
DP_and_DPL_AddRef,
DP_and_DPL_Release,
DP_and_DPL_CreateInstance,
DP_and_DPL_LockServer
};
static IClassFactoryImpl DP_and_DPL_CF = {&DP_and_DPL_Vtbl, 1 };
/*******************************************************************************
* DllGetClassObject [DPLAYX.?]
* Retrieves DP or DPL class object from a DLL object
*
* NOTES
* Docs say returns STDAPI
*
* PARAMS
* rclsid [I] CLSID for the class object
* riid [I] Reference to identifier of interface for class object
* ppv [O] Address of variable to receive interface pointer for riid
*
* RETURNS
* Success: S_OK
* Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG,
* E_UNEXPECTED
*/
DWORD WINAPI DP_and_DPL_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv)
{
char buf[80],xbuf[80];
if (HIWORD(rclsid))
WINE_StringFromCLSID(rclsid,xbuf);
else
sprintf(xbuf,"<guid-0x%04x>",LOWORD(rclsid));
if (HIWORD(riid))
WINE_StringFromCLSID(riid,buf);
else
sprintf(buf,"<guid-0x%04x>",LOWORD(riid));
WINE_StringFromCLSID(riid,xbuf);
TRACE("(%p,%p,%p)\n", xbuf, buf, ppv);
if ( IsEqualCLSID( riid, &IID_IClassFactory ) )
{
*ppv = (LPVOID)&DP_and_DPL_CF;
IClassFactory_AddRef( (IClassFactory*)*ppv );
return S_OK;
}
ERR("(%p,%p,%p): no interface found.\n", xbuf, buf, ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}
#ifndef __WINE_DPINIT_H
#define __WINE_DPINIT_H
extern HRESULT directPlay_QueryInterface( REFIID riid, LPVOID* ppvObj );
extern HRESULT directPlayLobby_QueryInterface( REFIID riid, LPVOID* ppvObj );
#endif
# First DirectPlay dll. Replaced by dplayx.dll.
name dplay
type win32
import dplayx.dll
1 forward DirectPlayCreate DPLAYX.DirectPlayCreate
2 forward DirectPlayEnumerate DPLAYX.DirectPlayEnumerate
......@@ -6,4 +6,6 @@ type win32
3 stdcall DirectPlayEnumerateW(ptr ptr) DirectPlayEnumerateW
4 stdcall DirectPlayLobbyCreateA(ptr ptr ptr ptr long) DirectPlayLobbyCreateA
5 stdcall DirectPlayLobbyCreateW(ptr ptr ptr ptr long) DirectPlayLobbyCreateW
9 stub DirectPlayEnumerate
6 stub DllCanUnloadNow
7 stdcall DllGetClassObject(ptr ptr ptr) DP_and_DPL_DllGetClassObject
9 stdcall DirectPlayEnumerate(ptr ptr) DirectPlayEnumerateA
......@@ -5,18 +5,74 @@ Most methods and APIs are not implemented at this point. Examine the code
to see what has been implemented. Stay tuned for some information here once
there is more implementation (and I figure out what the heck I'm doing).
The files are include/dplay.h and multimedia/dplay.c. They're getting a
little cumbersome at present perhaps they will be broken out in a later
version.
The files are include/dplay.h, include/dplobby.h, multimedia/dplobby.c and multimedia/dplay.c.
The .c files will be moved to appropriate dll directories at some later time.
I think I can safely say that any application which requires direct play
or direct play lobby will not work at this point. Priority will be to get
lserver.exe from the sdk running.
examples from the sdk running. Once they're at least partially working, I can
get down to trying to get some of the games working.
A small issue will be the fact that DirectX 6.1(ie. DirectPlay4) introduces a layer of functionality
inside the DP objects which provide guaranteed protocol delivery. This is
even if the native protocol, IPX or modem for instance, doesn't guarantee it. I'm going to leave
this kind of implementation to as close to the end as possible. However, I
will implement an abstraction layer, where possible, for this functionality.
It will do nothing to start, but will require only the implementation of the
guaranteness to give final implementation.
TODO:
- Just about everything
- (done) Header files for DP4 and DPL3
- (done) Add stub functions for all DP4 and DPL3 interfaces
- (done) Correct naming of the parameters for DP3 and DPL2
- (done) Seperate out DP and DPL into multiple .c files
- (done) Allow CoCreateInstance to create the new interfaces
- (started)Implement mutual exclusion on object data for existing functions
- (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
- (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
- Ensure that all dll stubs are present and the ordinals are correct
- Implementation of functionality
- bug fixes ;)
Programs to make work:
- lserver.exe (from sdk)
- override.exe (from sdk)
- dpchat.exe (from sdk)
- duel.exe (from sdk)
Peter Hunnisett - hunnise@nortel.ca
Next API to implement on a per program basis:
override.exe
- IDirectPlay3AImp_EnumConnections
- ?
dplaunch.exe
- IDirectPlayLobbyAImpl_EnumLocalApplications
- ?
lserver.exe
- IDirectPlayLobby2WImpl_Connect
- IDirectPlay3WImpl_CreatePlayer
- IDirectPlay3WImpl_CreateGroup
- IDirectPlay3WImpl_SetGroupData
- IDirectPlay3WImpl_Send
- ?
bellhop.exe
- DirectPlay3AImpl_EnumConnections
- ?
dpslots.exe
- IDirectPlayLobbyAImpl_SetConnectionSettings
- IDirectPlayAImpl_EnumConnections
- ?
Peter Hunnisett - hunnise@nortelnetworks.com
......@@ -8,7 +8,6 @@ WRCEXTRA = -s -pwinmm
C_SRCS = \
audio.c \
dplay.c \
dsound.c \
joystick.c \
lolvldrv.c \
......
......@@ -2,8 +2,6 @@ Makefile
call32.s
ddraw.spec.c
dinput.spec.c
dplay.spec.c
dplayx.spec.c
dsound.spec.c
gdi32.spec.c
kernel32.spec.c
......
......@@ -8,8 +8,6 @@ MODULE = relay32
SPEC_SRCS = \
ddraw.spec \
dinput.spec \
dplay.spec \
dplayx.spec \
dsound.spec \
gdi32.spec \
kernel32.spec \
......
name dplay
type win32
1 stdcall DirectPlayCreate(ptr ptr ptr ptr) DirectPlayCreate
2 stdcall DirectPlayEnumerate(ptr ptr) DirectPlayEnumerateA
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