[DPLAY][DPLAYX]

* Sync with Wine 1.5.26.

svn path=/trunk/; revision=58736
This commit is contained in:
Amine Khaldi 2013-04-13 13:08:11 +00:00
parent 30d5c755b7
commit ffa7a81ee3
26 changed files with 1250 additions and 1903 deletions

View file

@ -1,5 +1,4 @@
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
spec2def(dplay.dll dplay.spec)
@ -10,23 +9,6 @@ add_library(dplay SHARED
${CMAKE_CURRENT_BINARY_DIR}/dplay.def)
set_module_type(dplay win32dll UNICODE)
target_link_libraries(dplay
uuid
wine)
add_importlibs(dplay
msvcrt
user32
advapi32
ole32
winmm
dinput
dplayx
kernel32
ntdll)
add_importlibs(dplay dplayx msvcrt kernel32 ntdll)
add_dependencies(dplay psdk)
add_cd_file(TARGET dplay DESTINATION reactos/system32 FOR all)

View file

@ -13,15 +13,15 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define WINE_OLESELFREGISTER
#define WINE_FILEDESCRIPTION_STR "Wine DirectPlay"
#define WINE_FILENAME_STR "dplay.dll"
#define WINE_FILEVERSION 5,3,0,900
#define WINE_FILEVERSION_STR "5.3.0.900"
#define WINE_PRODUCTVERSION 5,3,0,900
#define WINE_PRODUCTVERSION_STR "5.3"
#define WINE_EXTRAVALUES VALUE "OLESelfRegister",""
#include "wine/wine_common_ver.rc"
#include <wine/wine_common_ver.rc>

View file

@ -1,4 +1,10 @@
add_definitions(
-DCOM_NO_WINDOWS_H
-D__WINESRC__)
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
spec2def(dplayx.dll dplayx.spec ADD_IMPORTLIB)
list(APPEND SOURCE
@ -11,23 +17,10 @@ list(APPEND SOURCE
dplobby.c
lobbysp.c
name_server.c
regsvr.c
version.rc
${CMAKE_CURRENT_BINARY_DIR}/dplayx.def)
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
add_library(dplayx SHARED ${SOURCE})
add_library(dplayx SHARED ${SOURCE} version.rc)
set_module_type(dplayx win32dll)
target_link_libraries(dplayx wine uuid dxguid)
add_importlibs(dplayx
advapi32
ole32
user32
winmm
msvcrt
kernel32
ntdll)
target_link_libraries(dplayx dxguid uuid wine)
add_importlibs(dplayx winmm ole32 user32 advapi32 msvcrt kernel32 ntdll)
add_cd_file(TARGET dplayx DESTINATION reactos/system32 FOR all)

View file

@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
//#include <stdarg.h>
@ -27,6 +27,9 @@
//#include "objbase.h"
//#include "winerror.h"
#include <wine/debug.h>
//#include "dplay.h"
//#include "dplobby.h"
//#include "initguid.h"
#include "dpinit.h"
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
@ -39,13 +42,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(dplay);
typedef struct
{
/* IUnknown fields */
const IClassFactoryVtbl *lpVtbl;
LONG ref;
IClassFactory IClassFactory_iface;
LONG ref;
} IClassFactoryImpl;
static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
{
return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
}
static HRESULT WINAPI
DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
@ -54,12 +62,12 @@ DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
static ULONG WINAPI
DP_and_DPL_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
/* static class (reference starts @ 1), won't ever be freed */
return InterlockedDecrement(&This->ref);
}
@ -67,7 +75,7 @@ static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) {
static HRESULT WINAPI DP_and_DPL_CreateInstance(
LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
@ -84,7 +92,7 @@ static HRESULT WINAPI DP_and_DPL_CreateInstance(
}
static HRESULT WINAPI DP_and_DPL_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
FIXME("(%p)->(%d),stub!\n",This,dolock);
return S_OK;
}
@ -97,7 +105,7 @@ static const IClassFactoryVtbl DP_and_DPL_Vtbl = {
DP_and_DPL_LockServer
};
static IClassFactoryImpl DP_and_DPL_CF = {&DP_and_DPL_Vtbl, 1 };
static IClassFactoryImpl DP_and_DPL_CF = {{&DP_and_DPL_Vtbl}, 1 };
/*******************************************************************************
@ -119,16 +127,16 @@ static IClassFactoryImpl DP_and_DPL_CF = {&DP_and_DPL_Vtbl, 1 };
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if ( IsEqualCLSID( riid, &IID_IClassFactory ) )
{
*ppv = (LPVOID)&DP_and_DPL_CF;
*ppv = &DP_and_DPL_CF;
IClassFactory_AddRef( (IClassFactory*)*ppv );
return S_OK;
}
ERR("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
ERR("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}

View file

@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPINIT_H
@ -26,12 +26,12 @@
//#include "wtypes.h"
#include "dplay_global.h"
extern HRESULT DP_CreateInterface( REFIID riid, LPVOID* ppvObj );
extern HRESULT DPL_CreateInterface( REFIID riid, LPVOID* ppvObj );
extern HRESULT DP_CreateInterface( REFIID riid, LPVOID* ppvObj ) DECLSPEC_HIDDEN;
extern HRESULT DPL_CreateInterface( REFIID riid, LPVOID* ppvObj ) DECLSPEC_HIDDEN;
extern HRESULT DPSP_CreateInterface( REFIID riid, LPVOID* ppvObj,
IDirectPlay2Impl* dp );
IDirectPlay2Impl* dp ) DECLSPEC_HIDDEN;
extern HRESULT DPLSP_CreateInterface( REFIID riid, LPVOID* ppvObj,
IDirectPlay2Impl* dp );
IDirectPlay2Impl* dp ) DECLSPEC_HIDDEN;
#endif

File diff suppressed because it is too large Load diff

View file

@ -13,12 +13,15 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPLAY_GLOBAL_INCLUDED
#define __WINE_DPLAY_GLOBAL_INCLUDED
#define WIN32_NO_STATUS
#define _INC_WINDOWS
//#include <stdarg.h>
//#include "windef.h"
@ -29,9 +32,7 @@
extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
LPCVOID lpAddress, DWORD dwAddressSize,
LPVOID lpContext );
extern DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi );
LPVOID lpContext ) DECLSPEC_HIDDEN;
/*****************************************************************************
* Predeclare the interface implementation structures
@ -69,7 +70,7 @@ typedef struct tagDP_MSG_REPLY_STRUCT
typedef struct tagDP_MSG_REPLY_STRUCT_LIST
{
DPQ_ENTRY(tagDP_MSG_REPLY_STRUCT_LIST) replysExpected;
DPQ_ENTRY(tagDP_MSG_REPLY_STRUCT_LIST) repliesExpected;
DP_MSG_REPLY_STRUCT replyExpected;
} DP_MSG_REPLY_STRUCT_LIST, *LPDP_MSG_REPLY_STRUCT_LIST;
@ -164,6 +165,7 @@ typedef struct tagDirectPlay2Data
/* For async EnumSessions requests */
HANDLE hEnumSessionThread;
HANDLE hKillEnumSessionThreadEvent;
DWORD dwEnumSessionLock;
LPVOID lpNameServerData; /* DPlay interface doesn't know contents */
@ -194,7 +196,7 @@ typedef struct tagDirectPlay2Data
enum SPSTATE connectionInitialized;
/* Expected messages queue */
DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) replysExpected;
DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) repliesExpected;
} DirectPlay2Data;
typedef struct tagDirectPlay3Data
@ -234,13 +236,13 @@ struct IDirectPlay4Impl
HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpMessageBody,
DWORD dwMessageBodySize, LPCVOID lpMessageHeader,
WORD wCommandId, WORD wVersion,
LPVOID* lplpReply, LPDWORD lpdwMsgSize );
LPVOID* lplpReply, LPDWORD lpdwMsgSize ) DECLSPEC_HIDDEN;
/* DP SP external interfaces into DirectPlay */
extern HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID* lplpData );
extern HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID lpData );
extern HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID* lplpData ) DECLSPEC_HIDDEN;
extern HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID lpData ) DECLSPEC_HIDDEN;
/* DP external interfaces to call into DPSP interface */
extern LPVOID DPSP_CreateSPPlayerData(void);
extern LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN;
#endif /* __WINE_DPLAY_GLOBAL_INCLUDED */

View file

@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
//#include <string.h>
@ -86,7 +86,6 @@ typedef struct tagDP_SPPLAYERDATA
} DP_SPPLAYERDATA, *LPDP_SPPLAYERDATA;
/* Create the SP interface */
extern
HRESULT DPSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp )
{
TRACE( " for %s\n", debugstr_guid( riid ) );
@ -101,7 +100,7 @@ HRESULT DPSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp
if( IsEqualGUID( &IID_IDirectPlaySP, riid ) )
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)*ppvObj;
IDirectPlaySPImpl *This = *ppvObj;
This->lpVtbl = &directPlaySPVT;
}
else
@ -134,7 +133,7 @@ HRESULT DPSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp
static BOOL DPSP_CreateIUnknown( LPVOID lpSP )
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)lpSP;
IDirectPlaySPImpl *This = lpSP;
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
@ -144,14 +143,16 @@ static BOOL DPSP_CreateIUnknown( LPVOID lpSP )
}
InitializeCriticalSection( &This->unk->DPSP_lock );
This->unk->DPSP_lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlaySPImpl*->DirectPlaySPIUnknownData*->DPSP_lock");
return TRUE;
}
static BOOL DPSP_DestroyIUnknown( LPVOID lpSP )
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)lpSP;
IDirectPlaySPImpl *This = lpSP;
This->unk->DPSP_lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &This->unk->DPSP_lock );
HeapFree( GetProcessHeap(), 0, This->unk );
@ -161,7 +162,7 @@ static BOOL DPSP_DestroyIUnknown( LPVOID lpSP )
static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* dp )
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)lpSP;
IDirectPlaySPImpl *This = lpSP;
This->sp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->sp) ) );
@ -192,7 +193,7 @@ static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* dp )
static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP )
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)lpSP;
IDirectPlaySPImpl *This = lpSP;
/* Normally we should be keeping a reference, but since only the dplay
* interface that created us can destroy us, we do not keep a reference
@ -234,7 +235,7 @@ static HRESULT WINAPI DPSP_QueryInterface
if( IsEqualGUID( &IID_IDirectPlaySP, riid ) )
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)*ppvObj;
IDirectPlaySPImpl *This = *ppvObj;
This->lpVtbl = &directPlaySPVT;
}
else
@ -260,7 +261,7 @@ static ULONG WINAPI DPSP_AddRef
ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef );
TRACE( "ref count incremented to %lu:%lu for %p\n",
TRACE( "ref count incremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
return ulObjRefCount;
@ -275,7 +276,7 @@ static ULONG WINAPI DPSP_Release
ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef );
TRACE( "ref count decremented to %lu:%lu for %p\n",
TRACE( "ref count decremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
/* Deallocate if this is the last reference to the object */
@ -306,7 +307,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry
/* Should be able to call the comctl32 undocumented MRU routines.
I suspect that the interface works appropriately */
FIXME( "(%p)->(%p,%p%p,0x%08lx,0x%08lx): stub\n",
FIXME( "(%p)->(%p,%p%p,0x%08x,0x%08x): stub\n",
This, lpSection, lpKey, lpData, dwDataSize, dwMaxEntries );
return DP_OK;
@ -324,7 +325,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_CreateAddress
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
FIXME( "(%p)->(%s,%s,%p,0x%08lx,%p,%p): stub\n",
FIXME( "(%p)->(%s,%s,%p,0x%08x,%p,%p): stub\n",
This, debugstr_guid(guidSP), debugstr_guid(guidDataType),
lpData, dwDataSize, lpAddress, lpdwAddressSize );
@ -341,7 +342,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_EnumAddress
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
TRACE( "(%p)->(%p,%p,0x%08lx,%p)\n",
TRACE( "(%p)->(%p,%p,0x%08x,%p)\n",
This, lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
@ -375,7 +376,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetPlayerFlags
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
FIXME( "(%p)->(0x%08lx,%p): stub\n",
FIXME( "(%p)->(0x%08x,%p): stub\n",
This, idPlayer, lpdwPlayerFlags );
return DP_OK;
@ -393,7 +394,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData
LPDP_SPPLAYERDATA lpPlayerData;
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx)\n",
TRACE( "(%p)->(0x%08x,%p,%p,0x%08x)\n",
This, idPlayer, lplpData, lpdwDataSize, dwFlags );
hr = DP_GetSPPlayerData( This->sp->dplay, idPlayer, (LPVOID*)&lpPlayerData );
@ -433,7 +434,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
LPVOID lpMessageHeader
)
{
LPDPMSG_SENDENVELOPE lpMsg = (LPDPMSG_SENDENVELOPE)lpMessageBody;
LPDPMSG_SENDENVELOPE lpMsg = lpMessageBody;
HRESULT hr = DPERR_GENERIC;
WORD wCommandId;
WORD wVersion;
@ -441,24 +442,24 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
FIXME( "(%p)->(%p,0x%08lx,%p): mostly stub\n",
FIXME( "(%p)->(%p,0x%08x,%p): mostly stub\n",
This, lpMessageBody, dwMessageBodySize, lpMessageHeader );
wCommandId = lpMsg->wCommandId;
wVersion = lpMsg->wVersion;
TRACE( "Incoming message has envelope of 0x%08lx, %u, %u\n",
TRACE( "Incoming message has envelope of 0x%08x, %u, %u\n",
lpMsg->dwMagic, wCommandId, wVersion );
if( lpMsg->dwMagic != DPMSGMAGIC_DPLAYMSG )
{
ERR( "Unknown magic 0x%08lx!\n", lpMsg->dwMagic );
ERR( "Unknown magic 0x%08x!\n", lpMsg->dwMagic );
return DPERR_GENERIC;
}
#if 0
{
const LPDWORD lpcHeader = (LPDWORD)lpMessageHeader;
const LPDWORD lpcHeader = lpMessageHeader;
TRACE( "lpMessageHeader = [0x%08lx] [0x%08lx] [0x%08lx] [0x%08lx] [0x%08lx]\n",
lpcHeader[0], lpcHeader[1], lpcHeader[2], lpcHeader[3], lpcHeader[4] );
@ -499,7 +500,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
#if 0
HRESULT hr = DP_OK;
HANDLE hReceiveEvent = 0;
/* FIXME: Aquire some sort of interface lock */
/* FIXME: Acquire some sort of interface lock */
/* FIXME: Need some sort of context for this callback. Need to determine
* how this is actually done with the SP
*/
@ -508,7 +509,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
{
case DPSYS_CREATEPLAYERORGROUP:
{
LPDPMSG_CREATEPLAYERORGROUP msg = (LPDPMSG_CREATEPLAYERORGROUP)lpMsg;
LPDPMSG_CREATEPLAYERORGROUP msg = lpMsg;
if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
{
@ -543,7 +544,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_DESTROYPLAYERORGROUP:
{
LPDPMSG_DESTROYPLAYERORGROUP msg = (LPDPMSG_DESTROYPLAYERORGROUP)lpMsg;
LPDPMSG_DESTROYPLAYERORGROUP msg = lpMsg;
if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
{
@ -564,7 +565,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_ADDPLAYERTOGROUP:
{
LPDPMSG_ADDPLAYERTOGROUP msg = (LPDPMSG_ADDPLAYERTOGROUP)lpMsg;
LPDPMSG_ADDPLAYERTOGROUP msg = lpMsg;
hr = DP_IF_AddPlayerToGroup( This, msg->dpIdGroup, msg->dpIdPlayer, ... );
break;
@ -572,7 +573,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_DELETEPLAYERFROMGROUP:
{
LPDPMSG_DELETEPLAYERFROMGROUP msg = (LPDPMSG_DELETEPLAYERFROMGROUP)lpMsg;
LPDPMSG_DELETEPLAYERFROMGROUP msg = lpMsg;
hr = DP_IF_DeletePlayerFromGroup( This, msg->dpIdGroup, msg->dpIdPlayer,
... );
@ -582,7 +583,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_SESSIONLOST:
{
LPDPMSG_SESSIONLOST msg = (LPDPMSG_SESSIONLOST)lpMsg;
LPDPMSG_SESSIONLOST msg = lpMsg;
FIXME( "DPSYS_SESSIONLOST not handled\n" );
@ -591,7 +592,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_HOST:
{
LPDPMSG_HOST msg = (LPDPMSG_HOST)lpMsg;
LPDPMSG_HOST msg = lpMsg;
FIXME( "DPSYS_HOST not handled\n" );
@ -600,7 +601,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_SETPLAYERORGROUPDATA:
{
LPDPMSG_SETPLAYERORGROUPDATA msg = (LPDPMSG_SETPLAYERORGROUPDATA)lpMsg;
LPDPMSG_SETPLAYERORGROUPDATA msg = lpMsg;
if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
{
@ -622,7 +623,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_SETPLAYERORGROUPNAME:
{
LPDPMSG_SETPLAYERORGROUPNAME msg = (LPDPMSG_SETPLAYERORGROUPNAME)lpMsg;
LPDPMSG_SETPLAYERORGROUPNAME msg = lpMsg;
if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
{
@ -643,7 +644,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_SETSESSIONDESC;
{
LPDPMSG_SETSESSIONDESC msg = (LPDPMSG_SETSESSIONDESC)lpMsg;
LPDPMSG_SETSESSIONDESC msg = lpMsg;
hr = DP_IF_SetSessionDesc( This, &msg->dpDesc );
@ -652,7 +653,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_ADDGROUPTOGROUP:
{
LPDPMSG_ADDGROUPTOGROUP msg = (LPDPMSG_ADDGROUPTOGROUP)lpMsg;
LPDPMSG_ADDGROUPTOGROUP msg = lpMsg;
hr = DP_IF_AddGroupToGroup( This, msg->dpIdParentGroup, msg->dpIdGroup,
... );
@ -662,7 +663,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_DELETEGROUPFROMGROUP:
{
LPDPMSG_DELETEGROUPFROMGROUP msg = (LPDPMSG_DELETEGROUPFROMGROUP)lpMsg;
LPDPMSG_DELETEGROUPFROMGROUP msg = lpMsg;
hr = DP_IF_DeleteGroupFromGroup( This, msg->dpIdParentGroup,
msg->dpIdGroup, ... );
@ -672,7 +673,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_SECUREMESSAGE:
{
LPDPMSG_SECUREMESSAGE msg = (LPDPMSG_SECUREMESSAGE)lpMsg;
LPDPMSG_SECUREMESSAGE msg = lpMsg;
FIXME( "DPSYS_SECUREMESSAGE not implemented\n" );
@ -681,7 +682,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_STARTSESSION:
{
LPDPMSG_STARTSESSION msg = (LPDPMSG_STARTSESSION)lpMsg;
LPDPMSG_STARTSESSION msg = lpMsg;
FIXME( "DPSYS_STARTSESSION not implemented\n" );
@ -690,7 +691,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_CHAT:
{
LPDPMSG_CHAT msg = (LPDPMSG_CHAT)lpMsg;
LPDPMSG_CHAT msg = lpMsg;
FIXME( "DPSYS_CHAT not implemeneted\n" );
@ -699,7 +700,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_SETGROUPOWNER:
{
LPDPMSG_SETGROUPOWNER msg = (LPDPMSG_SETGROUPOWNER)lpMsg;
LPDPMSG_SETGROUPOWNER msg = lpMsg;
FIXME( "DPSYS_SETGROUPOWNER not implemented\n" );
@ -708,7 +709,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
case DPSYS_SENDCOMPLETE:
{
LPDPMSG_SENDCOMPLETE msg = (LPDPMSG_SENDCOMPLETE)lpMsg;
LPDPMSG_SENDCOMPLETE msg = lpMsg;
FIXME( "DPSYS_SENDCOMPLETE not implemented\n" );
@ -755,7 +756,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */
TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx)\n",
TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x)\n",
This, idPlayer, lpData, dwDataSize, dwFlags );
hr = DP_GetSPPlayerData( This->sp->dplay, idPlayer, (LPVOID*)&lpPlayerEntry );
@ -794,7 +795,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_CreateCompoundAddress
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
FIXME( "(%p)->(%p,0x%08lx,%p,%p): stub\n",
FIXME( "(%p)->(%p,0x%08x,%p,%p): stub\n",
This, lpElements, dwElementCount, lpAddress, lpdwAddressSize );
return DP_OK;
@ -811,7 +812,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPData
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */
TRACE( "(%p)->(%p,%p,0x%08lx)\n",
TRACE( "(%p)->(%p,%p,0x%08x)\n",
This, lplpData, lpdwDataSize, dwFlags );
#if 0
@ -827,7 +828,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPData
*/
if( dwFlags != DPSET_REMOTE )
{
TRACE( "Undocumented dwFlags 0x%08lx used\n", dwFlags );
TRACE( "Undocumented dwFlags 0x%08x used\n", dwFlags );
}
#endif
@ -870,7 +871,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPData
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */
TRACE( "(%p)->(%p,0x%08lx,0x%08lx)\n",
TRACE( "(%p)->(%p,0x%08x,0x%08x)\n",
This, lpData, dwDataSize, dwFlags );
#if 0
@ -886,7 +887,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPData
*/
if( dwFlags != DPSET_REMOTE )
{
TRACE( "Undocumented dwFlags 0x%08lx used\n", dwFlags );
TRACE( "Undocumented dwFlags 0x%08x used\n", dwFlags );
}
#endif
@ -918,7 +919,7 @@ static VOID WINAPI IDirectPlaySPImpl_SendComplete
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
FIXME( "(%p)->(%p,0x%08lx): stub\n",
FIXME( "(%p)->(%p,0x%08x): stub\n",
This, unknownA, unknownB );
}
@ -947,7 +948,7 @@ static const IDirectPlaySPVtbl directPlaySPVT =
/* DP external interfaces to call into DPSP interface */
/* Allocate the structure */
extern LPVOID DPSP_CreateSPPlayerData(void)
LPVOID DPSP_CreateSPPlayerData(void)
{
TRACE( "Creating SPPlayer data struct\n" );
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,

View file

@ -0,0 +1,33 @@
/*
* COM Classes for dplayx
*
* Copyright 2010 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
[
helpstring("DirectPlay Object"),
threading(both),
uuid(d1eb6d20-8923-11d0-9d97-00a0c90a43cb)
]
coclass DirectPlay { interface IDirectPlay; }
[
helpstring("DirectPlayLobby Object"),
threading(both),
uuid(2fe8f810-b2a5-11d0-a787-0000f803abfc)
]
coclass DirectPlayLobby { interface IDirectPlayLobby; }

View file

@ -0,0 +1,17 @@
HKCR
{
NoRemove Interface
{
}
NoRemove CLSID
{
'{D1EB6D20-8923-11D0-9D97-00A0C90A43CB}' = s 'DirectPlay Object'
{
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
}
'{2FE8F810-B2A5-11D0-A787-0000F803ABFC}' = s 'DirectPlayLobby Object'
{
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPLAYX_GLOBAL
@ -21,7 +21,6 @@
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <stdarg.h>
@ -30,51 +29,35 @@
//#include "winuser.h"
#include <dplay.h>
BOOL DPLAYX_ConstructData(void);
BOOL DPLAYX_DestructData(void);
BOOL DPLAYX_ConstructData(void) DECLSPEC_HIDDEN;
BOOL DPLAYX_DestructData(void) DECLSPEC_HIDDEN;
HRESULT DPLAYX_GetConnectionSettingsA ( DWORD dwAppID,
LPVOID lpData,
LPDWORD lpdwDataSize );
LPDWORD lpdwDataSize ) DECLSPEC_HIDDEN;
HRESULT DPLAYX_GetConnectionSettingsW ( DWORD dwAppID,
LPVOID lpData,
LPDWORD lpdwDataSize );
LPDWORD lpdwDataSize ) DECLSPEC_HIDDEN;
HRESULT DPLAYX_SetConnectionSettingsA ( DWORD dwFlags,
DWORD dwAppID,
LPDPLCONNECTION lpConn );
const DPLCONNECTION *lpConn ) DECLSPEC_HIDDEN;
HRESULT DPLAYX_SetConnectionSettingsW ( DWORD dwFlags,
DWORD dwAppID,
LPDPLCONNECTION lpConn );
const DPLCONNECTION *lpConn ) DECLSPEC_HIDDEN;
BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID );
BOOL DPLAYX_DestroyLobbyApplication( DWORD dwAppID );
BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID ) DECLSPEC_HIDDEN;
BOOL DPLAYX_WaitForConnectionSettings( BOOL bWait );
BOOL DPLAYX_AnyLobbiesWaitingForConnSettings(void);
BOOL DPLAYX_WaitForConnectionSettings( BOOL bWait ) DECLSPEC_HIDDEN;
BOOL DPLAYX_AnyLobbiesWaitingForConnSettings(void) DECLSPEC_HIDDEN;
BOOL DPLAYX_SetLobbyHandles( DWORD dwAppID,
HANDLE hStart, HANDLE hDeath, HANDLE hConnRead );
BOOL DPLAYX_GetThisLobbyHandles( LPHANDLE lphStart,
LPHANDLE lphDeath,
LPHANDLE lphConnRead, BOOL bClearSetHandles );
HANDLE hStart, HANDLE hDeath, HANDLE hConnRead ) DECLSPEC_HIDDEN;
LPDPSESSIONDESC2 DPLAYX_CopyAndAllocateLocalSession( UINT* index );
BOOL DPLAYX_CopyLocalSession( UINT* index, LPDPSESSIONDESC2 lpsd );
void DPLAYX_SetLocalSession( LPCDPSESSIONDESC2 lpsd );
BOOL DPLAYX_SetLobbyMsgThreadId( DWORD dwAppId, DWORD dwThreadId );
/* FIXME: This should not be here */
LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size );
void DPLAYX_PrivHeapFree( LPVOID addr );
LPSTR DPLAYX_strdupA( DWORD flags, LPCSTR str );
LPWSTR DPLAYX_strdupW( DWORD flags, LPCWSTR str );
/* FIXME: End shared data alloc which should be local */
BOOL DPLAYX_SetLobbyMsgThreadId( DWORD dwAppId, DWORD dwThreadId ) DECLSPEC_HIDDEN;
/* Convert a DP or DPL HRESULT code into a string for human consumption */
LPCSTR DPLAYX_HresultToString( HRESULT hr );
LPCSTR DPLAYX_HresultToString( HRESULT hr ) DECLSPEC_HIDDEN;
#endif /* __WINE_DPLAYX_GLOBAL */

View file

@ -16,21 +16,21 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTES
* o DPMSGCMD_ENUMSESSIONSREPLY & DPMSGCMD_ENUMSESSIONSREQUEST
* Have most fields understood, but not all. Everything seems to work.
* o DPMSGCMD_REQUESTNEWPLAYERID & DPMSGCMD_NEWPLAYERIDREPLY
* Barely work. This needs to be completed for sessions to start.
* Barely works. This needs to be completed for sessions to start.
* o A small issue will be the fact that DirectX 6.1(ie. DirectPlay4)
* introduces a layer of functionality inside the DP objects which
* 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
* 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 guarantee to give
* final implementation.
*
* TODO:
@ -41,31 +41,39 @@
* - Change RegEnumKeyEx enumeration pattern to allow error handling and to
* share registry implementation (or at least simplify).
* - Add in appropriate RegCloseKey calls for all the opening we're doing...
* - Fix all the buffer sizes for registry calls. They're off by one -
* - Fix all the buffer sizes for registry calls. They're off by one -
* but in a safe direction.
* - Fix race condition on interface destruction
* - Handles need to be correctly reference counted
* - Check if we need to deallocate any list objects when destroying
* - Check if we need to deallocate any list objects when destroying
* a dplay interface
* - RunApplication process spawning needs to have correct syncronization.
* - RunApplication process spawning needs to have correct synchronization.
* - Need to get inter lobby messages working.
* - Decypher dplay messages between applications and implement...
* - Decipher dplay messages between applications and implement...
* - Need to implement lobby session spawning.
* - Improve footprint and realtime blocking by setting up a separate data share
* between lobby application and client since there can be multiple apps per
* client. Also get rid of offset dependency by making data offset independent
* somehow.
*/
//#include <stdarg.h>
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#include <stdarg.h>
//#include "winerror.h"
//#include "windef.h"
//#include "winbase.h"
#include <windef.h>
#include <winbase.h>
#include <objbase.h>
#include <rpcproxy.h>
#include <wine/debug.h>
#include "dplayx_global.h"
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
static HINSTANCE instance;
/* This is a globally exported variable at ordinal 6 of DPLAYX.DLL */
DWORD gdwDPlaySPRefCount = 0; /* FIXME: Should it be initialized here? */
@ -73,11 +81,12 @@ DWORD gdwDPlaySPRefCount = 0; /* FIXME: Should it be initialized here? */
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
TRACE( "(%p,%ld,%p)\n", hinstDLL, fdwReason, lpvReserved );
TRACE( "(%p,%d,%p)\n", hinstDLL, fdwReason, lpvReserved );
switch ( fdwReason )
{
case DLL_PROCESS_ATTACH:
instance = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
/* First instance perform construction of global processor data */
return DPLAYX_ConstructData();
@ -102,10 +111,26 @@ HRESULT WINAPI DllCanUnloadNow(void)
HRESULT hr = ( gdwDPlaySPRefCount > 0 ) ? S_FALSE : S_OK;
/* FIXME: Should I be putting a check in for class factory objects
* as well
* as well?
*/
TRACE( ": returning 0x%08lx\n", hr );
TRACE( ": returning 0x%08x\n", hr );
return hr;
}
/***********************************************************************
* DllRegisterServer (DPLAYX.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
return __wine_register_resources( instance );
}
/***********************************************************************
* DllUnregisterServer (DPLAYX.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
return __wine_unregister_resources( instance );
}

View file

@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTES
* o Messaging interface required for both DirectPlay and DirectPlayLobby.
@ -110,7 +110,7 @@ error:
static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext )
{
LPMSGTHREADINFO lpThreadInfo = (LPMSGTHREADINFO)lpContext;
LPMSGTHREADINFO lpThreadInfo = lpContext;
DWORD dwWaitResult;
TRACE( "Msg thread created. Waiting on app startup\n" );
@ -119,7 +119,7 @@ static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext )
dwWaitResult = WaitForSingleObject( lpThreadInfo->hStart, 10000 /* 10 sec */ );
if( dwWaitResult == WAIT_TIMEOUT )
{
FIXME( "Should signal app/wait creation failure (0x%08lx)\n", dwWaitResult );
FIXME( "Should signal app/wait creation failure (0x%08x)\n", dwWaitResult );
goto end_of_thread;
}
@ -131,14 +131,14 @@ static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext )
dwWaitResult = WaitForSingleObject( lpThreadInfo->hSettingRead, INFINITE );
if( dwWaitResult == WAIT_TIMEOUT )
{
ERR( "App Read connection setting timeout fail (0x%08lx)\n", dwWaitResult );
ERR( "App Read connection setting timeout fail (0x%08x)\n", dwWaitResult );
}
/* Close this handle as it's not needed anymore */
CloseHandle( lpThreadInfo->hSettingRead );
lpThreadInfo->hSettingRead = 0;
TRACE( "App created && intialized starting main message reception loop\n" );
TRACE( "App created && initialized starting main message reception loop\n" );
for ( ;; )
{
@ -153,7 +153,7 @@ end_of_thread:
return 0;
}
/* DP messageing stuff */
/* DP messaging stuff */
static HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This,
LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList,
WORD wReplyCommandId );
@ -172,7 +172,7 @@ HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This,
/* Insert into the message queue while locked */
EnterCriticalSection( &This->unk->DP_lock );
DPQ_INSERT( This->dp2->replysExpected, lpReplyStructList, replysExpected );
DPQ_INSERT( This->dp2->repliesExpected, lpReplyStructList, repliesExpected );
LeaveCriticalSection( &This->unk->DP_lock );
return lpReplyStructList->replyExpected.hReceipt;
@ -225,7 +225,7 @@ HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
data.bSystemMessage = TRUE; /* Allow reply to be sent */
data.lpISP = This->dp2->spData.lpISP;
TRACE( "Asking for player id w/ dwFlags 0x%08lx\n",
TRACE( "Asking for player id w/ dwFlags 0x%08x\n",
lpMsgBody->dwFlags );
DP_MSG_ExpectReply( This, &data, DPMSG_DEFAULT_WAIT_TIME, DPMSGCMD_NEWPLAYERIDREPLY,
@ -233,20 +233,20 @@ HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
}
/* Need to examine the data and extract the new player id */
if( !FAILED(hr) )
if( SUCCEEDED(hr) )
{
LPCDPMSG_NEWPLAYERIDREPLY lpcReply;
lpcReply = (LPCDPMSG_NEWPLAYERIDREPLY)lpMsg;
lpcReply = lpMsg;
*lpdpidAllocatedId = lpcReply->dpidNewPlayerId;
TRACE( "Received reply for id = 0x%08lx\n", lpcReply->dpidNewPlayerId );
TRACE( "Received reply for id = 0x%08x\n", lpcReply->dpidNewPlayerId );
/* FIXME: I think that the rest of the message has something to do
* with remote data for the player that perhaps I need to setup.
* However, with the information that is passed, all that it could
* be used for is a standardized intialization value, which I'm
* be used for is a standardized initialization value, which I'm
* guessing we can do without. Unless the message content is the same
* for several different messages?
*/
@ -282,7 +282,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer )
DWORD dwDataSize;
/* SP Player remote data needs to be propagated at some point - is this the point? */
IDirectPlaySP_GetSPPlayerData( This->dp2->spData.lpISP, 0, (LPVOID*)&lpPData, &dwDataSize, DPSET_REMOTE );
IDirectPlaySP_GetSPPlayerData( This->dp2->spData.lpISP, 0, &lpPData, &dwDataSize, DPSET_REMOTE );
ERR( "Player Data size is 0x%08lx\n"
"[%02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x]\n"
@ -323,18 +323,14 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer )
lpMsgBody->unknown4[3] = NS_GetNsMagic( This->dp2->lpNameServerData ) -
0x02000000;
TRACE( "Setting first magic to 0x%08lx\n", lpMsgBody->unknown4[3] );
TRACE( "Setting first magic to 0x%08x\n", lpMsgBody->unknown4[3] );
lpMsgBody->unknown4[4] = 0x0;
lpMsgBody->unknown4[5] = 0x0;
lpMsgBody->unknown4[6] = 0x0;
#if 0
lpMsgBody->unknown4[7] = NS_GetOtherMagic( This->dp2->lpNameServerData )
#else
lpMsgBody->unknown4[7] = NS_GetNsMagic( This->dp2->lpNameServerData );
#endif
TRACE( "Setting second magic to 0x%08lx\n", lpMsgBody->unknown4[7] );
TRACE( "Setting second magic to 0x%08x\n", lpMsgBody->unknown4[7] );
lpMsgBody->unknown4[8] = 0x0;
lpMsgBody->unknown4[9] = 0x0;
@ -356,7 +352,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer )
data.bSystemMessage = TRUE; /* Allow reply to be sent */
data.lpISP = This->dp2->spData.lpISP;
TRACE( "Sending forward player request with 0x%08lx\n", dpidServer );
TRACE( "Sending forward player request with 0x%08x\n", dpidServer );
lpMsg = DP_MSG_ExpectReply( This, &data,
DPMSG_WAIT_60_SECS,
@ -393,7 +389,7 @@ LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA lpData,
hMsgReceipt = DP_MSG_BuildAndLinkReplyStruct( This, &replyStructList,
wReplyCommandId );
TRACE( "Sending msg and expecting cmd %u in reply within %lu ticks\n",
TRACE( "Sending msg and expecting cmd %u in reply within %u ticks\n",
wReplyCommandId, dwWaitTime );
hr = (*This->dp2->spData.lpCB->Send)( lpData );
@ -409,7 +405,7 @@ LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA lpData,
dwWaitReturn = WaitForSingleObject( hMsgReceipt, dwWaitTime );
if( dwWaitReturn != WAIT_OBJECT_0 )
{
ERR( "Wait failed 0x%08lx\n", dwWaitReturn );
ERR( "Wait failed 0x%08x\n", dwWaitReturn );
return NULL;
}
@ -437,7 +433,7 @@ void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
* avoid problems.
*/
EnterCriticalSection( &This->unk->DP_lock );
DPQ_REMOVE_ENTRY( This->dp2->replysExpected, replysExpected, replyExpected.wExpectedReply,\
DPQ_REMOVE_ENTRY( This->dp2->repliesExpected, repliesExpected, replyExpected.wExpectedReply,
==, wCommandId, lpReplyList );
LeaveCriticalSection( &This->unk->DP_lock );
@ -502,7 +498,7 @@ void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId,
{
LPCDPMSG_FORWARDADDPLAYERNACK lpcErrorMsg;
lpcErrorMsg = (LPCDPMSG_FORWARDADDPLAYERNACK)lpMsgBody;
lpcErrorMsg = lpMsgBody;
ERR( "Received error message %u. Error is %s\n",
wCommandId, DPLAYX_HresultToString( lpcErrorMsg->errorCode) );

View file

@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPLAYX_MESSAGES__
@ -29,17 +29,17 @@
#include "dplay_global.h"
DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart,
HANDLE hDeath, HANDLE hConnRead );
HANDLE hDeath, HANDLE hConnRead ) DECLSPEC_HIDDEN;
HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
LPDPID lpdipidAllocatedId );
HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer );
LPDPID lpdipidAllocatedId ) DECLSPEC_HIDDEN;
HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer ) DECLSPEC_HIDDEN;
void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
LPCVOID lpMsgBody, DWORD dwMsgBodySize );
LPCVOID lpMsgBody, DWORD dwMsgBodySize ) DECLSPEC_HIDDEN;
void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId,
LPCVOID lpMsgBody, DWORD dwMsgBodySize );
void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf );
LPCVOID lpMsgBody, DWORD dwMsgBodySize ) DECLSPEC_HIDDEN;
void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf ) DECLSPEC_HIDDEN;
/* Timings -> 1000 ticks/sec */
#define DPMSG_WAIT_5_SECS 5000

View file

@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTES
* o Linked list implementation for dplay/dplobby. Based off of the BSD
@ -122,7 +122,7 @@ do { \
* elm - how to find the next element
* field - to be concatenated to rc to compare with fieldToCompare
* fieldToCompare - The value that we're comparing against
* compare_cb - Callback to invoke to determine if comparision should continue.
* compare_cb - Callback to invoke to determine if comparison should continue.
* Callback must be defined with DPQ_DECL_COMPARECB.
* rc - Variable to put the return code. Same type as (head).lpQHFirst
*/
@ -174,7 +174,7 @@ do { \
* elm - how to find the next element
* field - to be concatenated to rc to compare with fieldToCompare
* fieldToCompare - The value that we're comparing against
* compare_cb - Callback to invoke to determine if comparision should continue.
* compare_cb - Callback to invoke to determine if comparison should continue.
* Callback must be defined with DPQ_DECL_COMPARECB.
* rc - Variable to put the return code. Same type as (head).lpQHFirst
*/
@ -211,6 +211,6 @@ do \
#define DPQ_DECL_DELETECB( name, type ) void name( type elem )
/* Prototype of a method which just performs a HeapFree on the elem */
DPQ_DECL_DELETECB( cbDeleteElemFromHeap, LPVOID );
DPQ_DECL_DELETECB( cbDeleteElemFromHeap, LPVOID ) DECLSPEC_HIDDEN;
#endif /* __WINE_DPLAYX_QUEUE_H */

View file

@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
//#include <string.h>
@ -48,9 +48,9 @@ typedef struct IDirectPlayLobby3Impl IDirectPlayLobby3WImpl;
/* Forward declarations for this module helper methods */
HRESULT DPL_CreateCompoundAddress ( LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount,
LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface );
LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface )DECLSPEC_HIDDEN;
HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize,
static HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize,
LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface );
@ -58,11 +58,11 @@ HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData,
extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress,
DWORD dwAddressSize, LPVOID lpContext );
static HRESULT WINAPI DPL_ConnectEx( IDirectPlayLobbyAImpl* This,
DWORD dwFlags, REFIID riid,
LPVOID* lplpDP, IUnknown* pUnk );
static HRESULT DPL_ConnectEx( IDirectPlayLobbyAImpl* This,
DWORD dwFlags, REFIID riid,
LPVOID* lplpDP, IUnknown* pUnk );
BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess,
static BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess,
LPHANDLE lphStart, LPHANDLE lphDeath,
LPHANDLE lphRead );
@ -145,7 +145,7 @@ static const IDirectPlayLobby3Vtbl directPlayLobby3AVT;
static BOOL DPL_CreateIUnknown( LPVOID lpDPL )
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)lpDPL;
IDirectPlayLobbyAImpl *This = lpDPL;
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
if ( This->unk == NULL )
@ -154,14 +154,16 @@ static BOOL DPL_CreateIUnknown( LPVOID lpDPL )
}
InitializeCriticalSection( &This->unk->DPL_lock );
This->unk->DPL_lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlayLobbyAImpl*->DirectPlayLobbyIUnknownData*->DPL_lock");
return TRUE;
}
static BOOL DPL_DestroyIUnknown( LPVOID lpDPL )
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)lpDPL;
IDirectPlayLobbyAImpl *This = lpDPL;
This->unk->DPL_lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &This->unk->DPL_lock );
HeapFree( GetProcessHeap(), 0, This->unk );
@ -170,7 +172,7 @@ static BOOL DPL_DestroyIUnknown( LPVOID lpDPL )
static BOOL DPL_CreateLobby1( LPVOID lpDPL )
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)lpDPL;
IDirectPlayLobbyAImpl *This = lpDPL;
This->dpl = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dpl) ) );
if ( This->dpl == NULL )
@ -185,7 +187,7 @@ static BOOL DPL_CreateLobby1( LPVOID lpDPL )
static BOOL DPL_DestroyLobby1( LPVOID lpDPL )
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)lpDPL;
IDirectPlayLobbyAImpl *This = lpDPL;
if( This->dpl->dwMsgThread )
{
@ -202,7 +204,7 @@ static BOOL DPL_DestroyLobby1( LPVOID lpDPL )
static BOOL DPL_CreateLobby2( LPVOID lpDPL )
{
IDirectPlayLobby2AImpl *This = (IDirectPlayLobby2AImpl *)lpDPL;
IDirectPlayLobby2AImpl *This = lpDPL;
This->dpl2 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dpl2) ) );
if ( This->dpl2 == NULL )
@ -215,7 +217,7 @@ static BOOL DPL_CreateLobby2( LPVOID lpDPL )
static BOOL DPL_DestroyLobby2( LPVOID lpDPL )
{
IDirectPlayLobby2AImpl *This = (IDirectPlayLobby2AImpl *)lpDPL;
IDirectPlayLobby2AImpl *This = lpDPL;
HeapFree( GetProcessHeap(), 0, This->dpl2 );
@ -224,7 +226,7 @@ static BOOL DPL_DestroyLobby2( LPVOID lpDPL )
static BOOL DPL_CreateLobby3( LPVOID lpDPL )
{
IDirectPlayLobby3AImpl *This = (IDirectPlayLobby3AImpl *)lpDPL;
IDirectPlayLobby3AImpl *This = lpDPL;
This->dpl3 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dpl3) ) );
if ( This->dpl3 == NULL )
@ -237,7 +239,7 @@ static BOOL DPL_CreateLobby3( LPVOID lpDPL )
static BOOL DPL_DestroyLobby3( LPVOID lpDPL )
{
IDirectPlayLobby3AImpl *This = (IDirectPlayLobby3AImpl *)lpDPL;
IDirectPlayLobby3AImpl *This = lpDPL;
HeapFree( GetProcessHeap(), 0, This->dpl3 );
@ -268,7 +270,6 @@ static BOOL DPL_DestroyLobby3( LPVOID lpDPL )
* successfully for a third interface, a query for the first interface
* through the pointer for the third interface must succeed.
*/
extern
HRESULT DPL_CreateInterface
( REFIID riid, LPVOID* ppvObj )
{
@ -284,32 +285,32 @@ HRESULT DPL_CreateInterface
if( IsEqualGUID( &IID_IDirectPlayLobby, riid ) )
{
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)*ppvObj;
IDirectPlayLobbyWImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobbyWVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) )
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)*ppvObj;
IDirectPlayLobbyAImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobbyAVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby2, riid ) )
{
IDirectPlayLobby2WImpl *This = (IDirectPlayLobby2WImpl *)*ppvObj;
IDirectPlayLobby2WImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby2WVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby2A, riid ) )
{
IDirectPlayLobby2AImpl *This = (IDirectPlayLobby2AImpl *)*ppvObj;
IDirectPlayLobby2AImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby2AVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby3, riid ) )
{
IDirectPlayLobby3WImpl *This = (IDirectPlayLobby3WImpl *)*ppvObj;
IDirectPlayLobby3WImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby3WVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby3A, riid ) )
{
IDirectPlayLobby3AImpl *This = (IDirectPlayLobby3AImpl *)*ppvObj;
IDirectPlayLobby3AImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby3AVT;
}
else
@ -364,32 +365,32 @@ static HRESULT WINAPI DPL_QueryInterface
if( IsEqualGUID( &IID_IDirectPlayLobby, riid ) )
{
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)*ppvObj;
IDirectPlayLobbyWImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobbyWVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) )
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)*ppvObj;
IDirectPlayLobbyAImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobbyAVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby2, riid ) )
{
IDirectPlayLobby2WImpl *This = (IDirectPlayLobby2WImpl *)*ppvObj;
IDirectPlayLobby2WImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby2WVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby2A, riid ) )
{
IDirectPlayLobby2AImpl *This = (IDirectPlayLobby2AImpl *)*ppvObj;
IDirectPlayLobby2AImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby2AVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby3, riid ) )
{
IDirectPlayLobby3WImpl *This = (IDirectPlayLobby3WImpl *)*ppvObj;
IDirectPlayLobby3WImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby3WVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby3A, riid ) )
{
IDirectPlayLobby3AImpl *This = (IDirectPlayLobby3AImpl *)*ppvObj;
IDirectPlayLobby3AImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby3AVT;
}
else
@ -419,7 +420,7 @@ static ULONG WINAPI DPL_AddRef
ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef );
TRACE( "ref count incremented to %lu:%lu for %p\n",
TRACE( "ref count incremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
return ulObjRefCount;
@ -439,7 +440,7 @@ static ULONG WINAPI DPL_Release
ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef );
TRACE( "ref count decremented to %lu:%lu for %p\n",
TRACE( "ref count decremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
/* Deallocate if this is the last reference to the object */
@ -468,7 +469,7 @@ static ULONG WINAPI DPL_Release
* Returns an IDirectPlay interface.
*
*/
static HRESULT WINAPI DPL_ConnectEx
static HRESULT DPL_ConnectEx
( IDirectPlayLobbyAImpl* This,
DWORD dwFlags,
REFIID riid,
@ -480,7 +481,7 @@ static HRESULT WINAPI DPL_ConnectEx
DWORD dwConnSize = 0;
LPDPLCONNECTION lpConn;
FIXME("(%p)->(0x%08lx,%p,%p): semi stub\n", This, dwFlags, lplpDP, pUnk );
FIXME("(%p)->(0x%08x,%p,%p): semi stub\n", This, dwFlags, lplpDP, pUnk );
if( pUnk )
{
@ -610,7 +611,7 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_CreateAddress
lpAddress, lpdwAddressSize, FALSE );
}
HRESULT DPL_CreateAddress(
static HRESULT DPL_CreateAddress(
REFGUID guidSP,
REFGUID guidDataType,
LPCVOID lpData,
@ -622,7 +623,7 @@ HRESULT DPL_CreateAddress(
const DWORD dwNumAddElements = 2; /* Service Provide & address data type */
DPCOMPOUNDADDRESSELEMENT addressElements[ 2 /* dwNumAddElements */ ];
TRACE( "(%p)->(%p,%p,0x%08lx,%p,%p,%d)\n", guidSP, guidDataType, lpData, dwDataSize,
TRACE( "(%p)->(%p,%p,0x%08x,%p,%p,%d)\n", guidSP, guidDataType, lpData, dwDataSize,
lpAddress, lpdwAddressSize, bAnsiInterface );
addressElements[ 0 ].guidDataType = DPAID_ServiceProvider;
@ -656,7 +657,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddress
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)iface;
TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress,
TRACE("(%p)->(%p,%p,0x%08x,%p)\n", This, lpEnumAddressCallback, lpAddress,
dwAddressSize, lpContext );
return DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
@ -671,14 +672,14 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_EnumAddress
{
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress,
TRACE("(%p)->(%p,%p,0x%08x,%p)\n", This, lpEnumAddressCallback, lpAddress,
dwAddressSize, lpContext );
return DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
}
extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress,
DWORD dwAddressSize, LPVOID lpContext )
HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress,
DWORD dwAddressSize, LPVOID lpContext )
{
DWORD dwTotalSizeEnumerated = 0;
@ -686,13 +687,13 @@ extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, L
while ( dwTotalSizeEnumerated < dwAddressSize )
{
const DPADDRESS* lpElements = (const DPADDRESS*)lpAddress;
const DPADDRESS* lpElements = lpAddress;
DWORD dwSizeThisEnumeration;
/* Invoke the enum method. If false is returned, stop enumeration */
if ( !lpEnumAddressCallback( &lpElements->guidDataType,
lpElements->dwDataSize,
(BYTE*)lpElements + sizeof( DPADDRESS ),
(const BYTE *)lpElements + sizeof( DPADDRESS ),
lpContext ) )
{
break;
@ -727,14 +728,14 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes
char subKeyName[51];
FILETIME filetime;
TRACE(" (%p)->(%p,%p,%p,0x%08lx)\n", This, lpEnumAddressTypeCallback, guidSP, lpContext, dwFlags );
TRACE(" (%p)->(%p,%p,%p,0x%08x)\n", This, lpEnumAddressTypeCallback, guidSP, lpContext, dwFlags );
if( dwFlags != 0 )
{
return DPERR_INVALIDPARAMS;
}
if( !lpEnumAddressTypeCallback || !*lpEnumAddressTypeCallback )
if( !lpEnumAddressTypeCallback )
{
return DPERR_INVALIDPARAMS;
}
@ -863,7 +864,7 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_EnumLocalApplications
{
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
FIXME("(%p)->(%p,%p,0x%08lx):stub\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
FIXME("(%p)->(%p,%p,0x%08x):stub\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
return DPERR_OUTOFMEMORY;
}
@ -883,14 +884,14 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications
char subKeyName[51];
FILETIME filetime;
TRACE("(%p)->(%p,%p,0x%08lx)\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
TRACE("(%p)->(%p,%p,0x%08x)\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
if( dwFlags != 0 )
{
return DPERR_INVALIDPARAMS;
}
if( !lpEnumLocalAppCallback || !*lpEnumLocalAppCallback )
if( !lpEnumLocalAppCallback )
{
return DPERR_INVALIDPARAMS;
}
@ -979,7 +980,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_GetConnectionSettings
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)iface;
HRESULT hr;
TRACE("(%p)->(0x%08lx,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
TRACE("(%p)->(0x%08x,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
EnterCriticalSection( &This->unk->DPL_lock );
@ -1002,7 +1003,7 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_GetConnectionSettings
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
HRESULT hr;
TRACE("(%p)->(0x%08lx,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
TRACE("(%p)->(0x%08x,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
EnterCriticalSection( &This->unk->DPL_lock );
@ -1031,7 +1032,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_ReceiveLobbyMessage
LPDWORD lpdwDataSize )
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)iface;
FIXME(":stub %p %08lx %08lx %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
FIXME(":stub %p %08x %08x %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
lpdwDataSize );
return DPERR_OUTOFMEMORY;
}
@ -1045,7 +1046,7 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_ReceiveLobbyMessage
LPDWORD lpdwDataSize )
{
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
FIXME(":stub %p %08lx %08lx %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
FIXME(":stub %p %08x %08x %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
lpdwDataSize );
return DPERR_OUTOFMEMORY;
}
@ -1143,7 +1144,7 @@ static BOOL CALLBACK RunApplicationA_EnumLocalApplications
return TRUE; /* Keep enumerating, haven't found the application yet */
}
BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess,
static BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess,
LPHANDLE lphStart, LPHANDLE lphDeath,
LPHANDLE lphRead )
{
@ -1212,7 +1213,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication
DWORD dwSuspendCount;
HANDLE hStart, hDeath, hSettingRead;
TRACE( "(%p)->(0x%08lx,%p,%p,%p)\n",
TRACE( "(%p)->(0x%08x,%p,%p,%p)\n",
This, dwFlags, lpdwAppID, lpConn, hReceiveEvent );
if( dwFlags != 0 )
@ -1234,7 +1235,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication
/* Our callback function will fill up the enumData structure with all the information
required to start a new process */
IDirectPlayLobby_EnumLocalApplications( iface, RunApplicationA_EnumLocalApplications,
(LPVOID)(&enumData), 0 );
(&enumData), 0 );
/* First the application name */
strcpy( temp, enumData.lpszPath );
@ -1287,7 +1288,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication
/* Reserve this global application id! */
if( !DPLAYX_CreateLobbyApplication( newProcessInfo.dwProcessId ) )
{
ERR( "Unable to create global application data for 0x%08lx\n",
ERR( "Unable to create global application data for 0x%08x\n",
newProcessInfo.dwProcessId );
}
@ -1319,7 +1320,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication
/* Unsuspend the process - should return the prev suspension count */
if( ( dwSuspendCount = ResumeThread( newProcessInfo.hThread ) ) != 1 )
{
ERR( "ResumeThread failed with 0x%08lx\n", dwSuspendCount );
ERR( "ResumeThread failed with 0x%08x\n", dwSuspendCount );
}
return DP_OK;
@ -1333,7 +1334,7 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_RunApplication
HANDLE hReceiveEvent )
{
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
FIXME( "(%p)->(0x%08lx,%p,%p,%p):stub\n", This, dwFlags, lpdwAppID, lpConn, (void *)hReceiveEvent );
FIXME( "(%p)->(0x%08x,%p,%p,%p):stub\n", This, dwFlags, lpdwAppID, lpConn, hReceiveEvent );
return DPERR_OUTOFMEMORY;
}
@ -1380,13 +1381,13 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_SetConnectionSettings
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
HRESULT hr;
TRACE("(%p)->(0x%08lx,0x%08lx,%p)\n", This, dwFlags, dwAppID, lpConn );
TRACE("(%p)->(0x%08x,0x%08x,%p)\n", This, dwFlags, dwAppID, lpConn );
EnterCriticalSection( &This->unk->DPL_lock );
hr = DPLAYX_SetConnectionSettingsW( dwFlags, dwAppID, lpConn );
/* FIXME: Don't think that this is supposed to fail, but the docuementation
/* FIXME: Don't think that this is supposed to fail, but the documentation
is somewhat sketchy. I'll try creating a lobby application
for this... */
if( hr == DPERR_NOTLOBBIED )
@ -1414,13 +1415,13 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_SetConnectionSettings
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)iface;
HRESULT hr;
TRACE("(%p)->(0x%08lx,0x%08lx,%p)\n", This, dwFlags, dwAppID, lpConn );
TRACE("(%p)->(0x%08x,0x%08x,%p)\n", This, dwFlags, dwAppID, lpConn );
EnterCriticalSection( &This->unk->DPL_lock );
hr = DPLAYX_SetConnectionSettingsA( dwFlags, dwAppID, lpConn );
/* FIXME: Don't think that this is supposed to fail, but the docuementation
/* FIXME: Don't think that this is supposed to fail, but the documentation
is somewhat sketchy. I'll try creating a lobby application
for this... */
if( hr == DPERR_NOTLOBBIED )
@ -1494,7 +1495,7 @@ HRESULT DPL_CreateCompoundAddress
DWORD dwElements;
LPCDPCOMPOUNDADDRESSELEMENT lpOrigElements = lpElements;
TRACE("(%p,0x%08lx,%p,%p)\n", lpElements, dwElementCount, lpAddress, lpdwAddressSize );
TRACE("(%p,0x%08x,%p,%p)\n", lpElements, dwElementCount, lpAddress, lpdwAddressSize );
/* Parameter check */
if( ( lpElements == NULL ) ||
@ -1570,9 +1571,9 @@ HRESULT DPL_CreateCompoundAddress
/* Add the total size chunk */
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
LPDPADDRESS lpdpAddress = lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &DPAID_TotalSize, sizeof( GUID ) );
lpdpAddress->guidDataType = DPAID_TotalSize;
lpdpAddress->dwDataSize = sizeof( DWORD );
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
@ -1589,10 +1590,9 @@ HRESULT DPL_CreateCompoundAddress
( IsEqualGUID( &lpElements->guidDataType, &DPAID_LobbyProvider ) )
)
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
LPDPADDRESS lpdpAddress = lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
sizeof( GUID ) );
lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = sizeof( GUID );
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
@ -1604,16 +1604,13 @@ HRESULT DPL_CreateCompoundAddress
( IsEqualGUID( &lpElements->guidDataType, &DPAID_INet ) )
)
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
LPDPADDRESS lpdpAddress = lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
sizeof( GUID ) );
lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
lstrcpynA( (LPSTR)lpAddress,
(LPCSTR)lpElements->lpData,
lpElements->dwDataSize );
lstrcpynA( lpAddress, lpElements->lpData, lpElements->dwDataSize );
lpAddress = (char *) lpAddress + lpElements->dwDataSize;
}
else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_PhoneW ) ) ||
@ -1621,24 +1618,20 @@ HRESULT DPL_CreateCompoundAddress
( IsEqualGUID( &lpElements->guidDataType, &DPAID_INetW ) )
)
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
LPDPADDRESS lpdpAddress = lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
sizeof( GUID ) );
lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
lstrcpynW( (LPWSTR)lpAddress,
(LPCWSTR)lpElements->lpData,
lpElements->dwDataSize );
lstrcpynW( lpAddress, lpElements->lpData, lpElements->dwDataSize );
lpAddress = (char *) lpAddress + lpElements->dwDataSize * sizeof( WCHAR );
}
else if ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INetPort ) )
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
LPDPADDRESS lpdpAddress = lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
sizeof( GUID ) );
lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
@ -1647,10 +1640,9 @@ HRESULT DPL_CreateCompoundAddress
}
else if ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ComPort ) )
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
LPDPADDRESS lpdpAddress = lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
sizeof( GUID ) );
lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
@ -1712,9 +1704,9 @@ static HRESULT WINAPI IDirectPlayLobby3WImpl_WaitForConnectionSettings
( LPDIRECTPLAYLOBBY3 iface, DWORD dwFlags )
{
HRESULT hr = DP_OK;
BOOL bStartWait = (dwFlags & DPLWAIT_CANCEL) ? FALSE : TRUE;
BOOL bStartWait = !(dwFlags & DPLWAIT_CANCEL);
TRACE( "(%p)->(0x%08lx)\n", iface, dwFlags );
TRACE( "(%p)->(0x%08x)\n", iface, dwFlags );
if( DPLAYX_WaitForConnectionSettings( bStartWait ) )
{
@ -1729,9 +1721,9 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_WaitForConnectionSettings
( LPDIRECTPLAYLOBBY3A iface, DWORD dwFlags )
{
HRESULT hr = DP_OK;
BOOL bStartWait = (dwFlags & DPLWAIT_CANCEL) ? FALSE : TRUE;
BOOL bStartWait = !(dwFlags & DPLWAIT_CANCEL);
TRACE( "(%p)->(0x%08lx)\n", iface, dwFlags );
TRACE( "(%p)->(0x%08x)\n", iface, dwFlags );
if( DPLAYX_WaitForConnectionSettings( bStartWait ) )
{
@ -1838,7 +1830,7 @@ static const IDirectPlayLobby2Vtbl directPlayLobby2AVT =
/* Note: Hack so we can reuse the old functions without compiler warnings */
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
# define XCAST(fun) (typeof(directPlayLobby2AVT.fun))
# define XCAST(fun) (typeof(directPlayLobby2WVT.fun))
#else
# define XCAST(fun) (void*)
#endif
@ -1956,7 +1948,7 @@ HRESULT WINAPI DirectPlayLobbyCreateA( LPGUID lpGUIDDSP,
LPVOID lpData,
DWORD dwDataSize )
{
TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08x\n",
lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize);
/* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
@ -1988,7 +1980,7 @@ HRESULT WINAPI DirectPlayLobbyCreateW( LPGUID lpGUIDDSP,
LPVOID lpData,
DWORD dwDataSize )
{
TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08x\n",
lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize);
/* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must

View file

@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
//#include "winerror.h"
@ -76,7 +76,7 @@ HRESULT DPLSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp
if( IsEqualGUID( &IID_IDPLobbySP, riid ) )
{
IDPLobbySPImpl *This = (IDPLobbySPImpl *)*ppvObj;
IDPLobbySPImpl *This = *ppvObj;
This->lpVtbl = &dpLobbySPVT;
}
else
@ -109,7 +109,7 @@ HRESULT DPLSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp
static BOOL DPLSP_CreateIUnknown( LPVOID lpSP )
{
IDPLobbySPImpl *This = (IDPLobbySPImpl *)lpSP;
IDPLobbySPImpl *This = lpSP;
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
@ -119,14 +119,16 @@ static BOOL DPLSP_CreateIUnknown( LPVOID lpSP )
}
InitializeCriticalSection( &This->unk->DPLSP_lock );
This->unk->DPLSP_lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDPLobbySPImpl*->DPLobbySPIUnknownData*->DPLSP_lock");
return TRUE;
}
static BOOL DPLSP_DestroyIUnknown( LPVOID lpSP )
{
IDPLobbySPImpl *This = (IDPLobbySPImpl *)lpSP;
IDPLobbySPImpl *This = lpSP;
This->unk->DPLSP_lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &This->unk->DPLSP_lock );
HeapFree( GetProcessHeap(), 0, This->unk );
@ -135,7 +137,7 @@ static BOOL DPLSP_DestroyIUnknown( LPVOID lpSP )
static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* dp )
{
IDPLobbySPImpl *This = (IDPLobbySPImpl *)lpSP;
IDPLobbySPImpl *This = lpSP;
This->sp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->sp) ) );
@ -167,7 +169,7 @@ static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* dp )
static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP )
{
IDPLobbySPImpl *This = (IDPLobbySPImpl *)lpSP;
IDPLobbySPImpl *This = lpSP;
HeapFree( GetProcessHeap(), 0, This->sp );
@ -197,7 +199,7 @@ HRESULT WINAPI DPLSP_QueryInterface
if( IsEqualGUID( &IID_IDPLobbySP, riid ) )
{
IDPLobbySPImpl *This = (IDPLobbySPImpl *)*ppvObj;
IDPLobbySPImpl *This = *ppvObj;
This->lpVtbl = &dpLobbySPVT;
}
else
@ -224,7 +226,7 @@ ULONG WINAPI DPLSP_AddRef
ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef );
TRACE( "ref count incremented to %lu:%lu for %p\n",
TRACE( "ref count incremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
return ulObjRefCount;
@ -240,7 +242,7 @@ ULONG WINAPI DPLSP_Release
ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef );
TRACE( "ref count decremented to %lu:%lu for %p\n",
TRACE( "ref count decremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
/* Deallocate if this is the last reference to the object */

View file

@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_LOBBY_SP_H
@ -70,14 +70,14 @@ typedef struct SPDATA_ADDREMOTEPLAYERTOGROUP
LPDPNAME lpName;
} SPDATA_ADDREMOTEPLAYERTOGROUP, *LPSPDATA_ADDREMOTEPLAYERTOGROUP;
typedef struct SPDATA_BUILDPARENTALHEIRARCHY
typedef struct SPDATA_BUILDPARENTALHIERARCHY
{
DWORD dwSize;
LPDPLOBBYSP lpISP;
DWORD dwGroupID;
DWORD dwMessage;
DWORD dwParentID;
} SPDATA_BUILDPARENTALHEIRARCHY, *LPSPDATA_BUILDPARENTALHEIRARCHY;
} SPDATA_BUILDPARENTALHIERARCHY, *LPSPDATA_BUILDPARENTALHIERARCHY;
typedef struct SPDATA_CLOSE
{
@ -388,7 +388,7 @@ typedef struct SPDATA_STARTSESSIONCOMMAND
/* Prototypes for callbacks returned by DPLSPInit */
typedef HRESULT (WINAPI *LPSP_ADDGROUPTOGROUP)(LPSPDATA_ADDGROUPTOGROUP);
typedef HRESULT (WINAPI *LPSP_ADDPLAYERTOGROUP)(LPSPDATA_ADDPLAYERTOGROUP);
typedef HRESULT (WINAPI *LPSP_BUILDPARENTALHEIRARCHY)(LPSPDATA_BUILDPARENTALHEIRARCHY);
typedef HRESULT (WINAPI *LPSP_BUILDPARENTALHIERARCHY)(LPSPDATA_BUILDPARENTALHIERARCHY);
typedef HRESULT (WINAPI *LPSP_CLOSE)(LPSPDATA_CLOSE);
typedef HRESULT (WINAPI *LPSP_CREATEGROUP)(LPSPDATA_CREATEGROUP);
typedef HRESULT (WINAPI *LPSP_CREATEGROUPINGROUP)(LPSPDATA_CREATEGROUPINGROUP);
@ -422,7 +422,7 @@ typedef struct SP_CALLBACKS
DWORD dwFlags;
LPSP_ADDGROUPTOGROUP AddGroupToGroup;
LPSP_ADDPLAYERTOGROUP AddPlayerToGroup;
LPSP_BUILDPARENTALHEIRARCHY BuildParentalHeirarchy;
LPSP_BUILDPARENTALHIERARCHY BuildParentalHierarchy;
LPSP_CLOSE Close;
LPSP_CREATEGROUP CreateGroup;
LPSP_CREATEGROUPINGROUP CreateGroupInGroup;
@ -458,7 +458,7 @@ typedef struct SPDATA_INIT
} SPDATA_INIT, *LPSPDATA_INIT;
typedef HRESULT (WINAPI *LPSP_INIT)(LPSPDATA_INIT);
HRESULT WINAPI DPLSPInit(LPSPDATA_INIT);
HRESULT WINAPI DPLSPInit(LPSPDATA_INIT) DECLSPEC_HIDDEN;
/* Define the COM interface */
#define INTERFACE IDPLobbySP
@ -515,6 +515,6 @@ DECLARE_INTERFACE_(IDPLobbySP,IUnknown)
/* This variable is exported from the DLL at ordinal 6 to be accessed by the
* SP directly. This is the same variable that the DP SP will use.
*/
extern DWORD gdwDPlaySPRefCount;
extern DWORD gdwDPlaySPRefCount DECLSPEC_HIDDEN;
#endif

View file

@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* NOTE: Methods with the NS_ prefix are name server methods */
@ -67,50 +67,38 @@ struct NSCache
typedef struct NSCache NSCache, *lpNSCache;
/* Function prototypes */
DPQ_DECL_DELETECB( cbDeleteNSNodeFromHeap, lpNSCacheData );
static DPQ_DECL_DELETECB( cbDeleteNSNodeFromHeap, lpNSCacheData );
/* Name Server functions
* ---------------------
*/
void NS_SetLocalComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo )
{
#if 0
/* FIXME: Remove this method? */
DPLAYX_SetLocalSession( lpsd );
#endif
lpNSCache lpCache = (lpNSCache)lpNSInfo;
lpCache->bNsIsLocal = TRUE;
}
void NS_SetRemoteComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo )
{
lpNSCache lpCache = (lpNSCache)lpNSInfo;
lpCache->bNsIsLocal = FALSE;
}
static DPQ_DECL_COMPARECB( cbUglyPig, GUID )
{
return IsEqualGUID( elem1, elem2 );
}
/* Store the given NS remote address for future reference */
/* FIXME: LPDPMSG_ENUMSESSIONSREPLY should be const */
void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr,
DWORD dwHdrSize,
LPDPMSG_ENUMSESSIONSREPLY lpMsg,
LPVOID lpNSInfo )
void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr,
DWORD dwHdrSize,
LPCDPMSG_ENUMSESSIONSREPLY lpcMsg,
LPVOID lpNSInfo )
{
DWORD len;
lpNSCache lpCache = (lpNSCache)lpNSInfo;
lpNSCacheData lpCacheNode;
TRACE( "%p, %p, %p\n", lpcNSAddrHdr, lpMsg, lpNSInfo );
TRACE( "%p, %p, %p\n", lpcNSAddrHdr, lpcMsg, lpNSInfo );
/* See if we can find this session. If we can, remove it as it's a dup */
DPQ_REMOVE_ENTRY_CB( lpCache->first, next, data->guidInstance, cbUglyPig,
lpMsg->sd.guidInstance, lpCacheNode );
lpcMsg->sd.guidInstance, lpCacheNode );
if( lpCacheNode != NULL )
{
@ -137,15 +125,16 @@ void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr,
if( lpCacheNode->data == NULL )
{
ERR( "no memory for SESSIONDESC2\n" );
HeapFree( GetProcessHeap(), 0, lpCacheNode );
return;
}
CopyMemory( lpCacheNode->data, &lpMsg->sd, sizeof( *lpCacheNode->data ) );
len = WideCharToMultiByte( CP_ACP, 0, (LPWSTR)(lpMsg+1), -1, NULL, 0, NULL, NULL );
if ((lpCacheNode->data->lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0, len )))
*lpCacheNode->data = lpcMsg->sd;
len = WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)(lpcMsg+1), -1, NULL, 0, NULL, NULL );
if ((lpCacheNode->data->u1.lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0, len )))
{
WideCharToMultiByte( CP_ACP, 0, (LPWSTR)(lpMsg+1), -1,
lpCacheNode->data->lpszSessionNameA, len, NULL, NULL );
WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)(lpcMsg+1), -1,
lpCacheNode->data->u1.lpszSessionNameA, len, NULL, NULL );
}
lpCacheNode->dwTime = timeGetTime();
@ -169,7 +158,7 @@ LPVOID NS_GetNSAddr( LPVOID lpNSInfo )
/* Ok. Cheat and don't search for the correct stuff just take the first.
* FIXME: In the future how are we to know what is _THE_ enum we used?
* This is going to have to go into dplay somehow. Perhaps it
* comes back with app server id for the join command! Oh...that
* comes back with app server id for the join command! Oh... that
* must be it. That would make this method obsolete once that's
* in place.
*/
@ -185,19 +174,11 @@ LPVOID NS_GetNSAddr( LPVOID lpNSInfo )
/* Get the magic number associated with the Name Server */
DWORD NS_GetNsMagic( LPVOID lpNSInfo )
{
LPDWORD lpHdrInfo = (LPDWORD)NS_GetNSAddr( lpNSInfo );
LPDWORD lpHdrInfo = NS_GetNSAddr( lpNSInfo );
return lpHdrInfo[1];
}
/* Get the magic number associated with the non NS end */
DWORD NS_GetOtherMagic( LPVOID lpNSInfo )
{
lpNSCache lpCache = (lpNSCache)lpNSInfo;
return ((LPDWORD)lpCache->lpLocalAddrHdr)[1];
}
void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize )
{
lpNSCache lpCache = (lpNSCache)lpNSInfo;
@ -212,7 +193,7 @@ void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize )
*/
HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid,
DWORD dwFlags,
LPSPINITDATA lpSpData )
const SPINITDATA *lpSpData )
{
DPSP_ENUMSESSIONSDATA data;
@ -227,7 +208,7 @@ HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid,
data.lpMessage = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
data.dwMessageSize );
data.lpISP = lpSpData->lpISP;
data.bReturnStatus = (dwFlags & DPENUMSESSIONS_RETURNSTATUS) ? TRUE : FALSE;
data.bReturnStatus = (dwFlags & DPENUMSESSIONS_RETURNSTATUS) != 0;
lpMsg = (LPDPMSG_ENUMSESSIONSREQUEST)(((BYTE*)data.lpMessage)+lpSpData->dwSPHeaderSize);
@ -240,13 +221,13 @@ HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid,
lpMsg->dwPasswordSize = 0; /* FIXME: If enumerating passwords..? */
lpMsg->dwFlags = dwFlags;
CopyMemory( &lpMsg->guidApplication, lpcGuid, sizeof( *lpcGuid ) );
lpMsg->guidApplication = *lpcGuid;
return (lpSpData->lpCB->EnumSessions)( &data );
}
/* Delete a name server node which has been allocated on the heap */
DPQ_DECL_DELETECB( cbDeleteNSNodeFromHeap, lpNSCacheData )
static DPQ_DECL_DELETECB( cbDeleteNSNodeFromHeap, lpNSCacheData )
{
/* NOTE: This proc doesn't deal with the walking pointer */
@ -381,21 +362,13 @@ void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg,
DWORD dwVariableSize;
DWORD dwVariableLen;
/* LPCDPMSG_ENUMSESSIONSREQUEST msg = (LPDPMSG_ENUMSESSIONSREQUEST)lpcMsg; */
BOOL bAnsi = TRUE; /* FIXME: This needs to be in the DPLAY interface */
FIXME( ": few fixed + need to check request for response\n" );
if (bAnsi)
{
dwVariableLen = MultiByteToWideChar( CP_ACP, 0,
lpDP->dp2->lpSessionDesc->lpszSessionNameA,
-1, NULL, 0 );
}
else
{
dwVariableLen = strlenW( lpDP->dp2->lpSessionDesc->lpszSessionName ) + 1;
}
/* FIXME: Should handle ANSI or WIDECHAR input. Currently just ANSI input */
FIXME( ": few fixed + need to check request for response, might need UNICODE input ability.\n" );
dwVariableLen = MultiByteToWideChar( CP_ACP, 0,
lpDP->dp2->lpSessionDesc->u1.lpszSessionNameA,
-1, NULL, 0 );
dwVariableSize = dwVariableLen * sizeof( WCHAR );
*lpdwReplySize = lpDP->dp2->spData.dwSPHeaderSize +
@ -411,15 +384,8 @@ void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg,
rmsg->envelope.wVersion = DPMSGVER_DP6;
CopyMemory( &rmsg->sd, lpDP->dp2->lpSessionDesc,
sizeof( lpDP->dp2->lpSessionDesc->dwSize ) );
lpDP->dp2->lpSessionDesc->dwSize );
rmsg->dwUnknown = 0x0000005c;
if( bAnsi )
{
MultiByteToWideChar( CP_ACP, 0, lpDP->dp2->lpSessionDesc->lpszSessionNameA, -1,
(LPWSTR)(rmsg+1), dwVariableLen );
}
else
{
strcpyW( (LPWSTR)(rmsg+1), lpDP->dp2->lpSessionDesc->lpszSessionName );
}
MultiByteToWideChar( CP_ACP, 0, lpDP->dp2->lpSessionDesc->u1.lpszSessionNameA, -1,
(LPWSTR)(rmsg+1), dwVariableLen );
}

View file

@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPLAYX_NAMESERVER
@ -28,34 +28,32 @@
#include "dplayx_messages.h"
//#include "dplay_global.h"
void NS_SetLocalComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo );
void NS_SetRemoteComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo );
void NS_SetLocalComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
void NS_AddRemoteComputerAsNameServer( LPCVOID lpNSAddrHdr,
DWORD dwHdrSize,
LPDPMSG_ENUMSESSIONSREPLY lpMsg,
LPVOID lpNSInfo );
LPVOID NS_GetNSAddr( LPVOID lpNSInfo );
DWORD NS_GetNsMagic( LPVOID lpNSInfo );
DWORD NS_GetOtherMagic( LPVOID lpNSInfo );
void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize );
LPCDPMSG_ENUMSESSIONSREPLY lpcMsg,
LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
LPVOID NS_GetNSAddr( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
DWORD NS_GetNsMagic( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize ) DECLSPEC_HIDDEN;
void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg,
LPVOID* lplpReplyData,
LPDWORD lpdwReplySize,
IDirectPlay2Impl* lpDP );
IDirectPlay2Impl* lpDP ) DECLSPEC_HIDDEN;
HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid,
DWORD dwFlags,
LPSPINITDATA lpSpData );
const SPINITDATA *lpSpData ) DECLSPEC_HIDDEN;
BOOL NS_InitializeSessionCache( LPVOID* lplpNSInfo );
void NS_DeleteSessionCache( LPVOID lpNSInfo );
void NS_InvalidateSessionCache( LPVOID lpNSInfo );
BOOL NS_InitializeSessionCache( LPVOID* lplpNSInfo ) DECLSPEC_HIDDEN;
void NS_DeleteSessionCache( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
void NS_InvalidateSessionCache( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
void NS_ResetSessionEnumeration( LPVOID lpNSInfo );
LPDPSESSIONDESC2 NS_WalkSessions( LPVOID lpNSInfo );
void NS_PruneSessionCache( LPVOID lpNSInfo );
void NS_ResetSessionEnumeration( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
LPDPSESSIONDESC2 NS_WalkSessions( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
void NS_PruneSessionCache( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
#endif /* __WINE_DPLAYX_NAMESERVER */

View file

@ -1,560 +0,0 @@
/*
* self-registerable dll functions for dplayx.dll
*
* Copyright (C) 2003 John K. Hohm
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <stdarg.h>
//#include <string.h>
#include <windef.h>
#include <winbase.h>
//#include "winuser.h"
#include <winreg.h>
//#include "winerror.h"
//#include "dplay.h"
#include <dplobby.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(dplayx);
/*
* Near the bottom of this file are the exported DllRegisterServer and
* DllUnregisterServer, which make all this worthwhile.
*/
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
int num_methods; /* can be <0 to omit */
CLSID const *ps_clsid; /* can be NULL to omit */
CLSID const *ps_clsid32; /* can be NULL to omit */
};
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
LPCSTR ips32; /* can be NULL to omit */
LPCSTR ips32_tmodel; /* can be NULL to omit */
LPCSTR progid; /* can be NULL to omit */
LPCSTR viprogid; /* can be NULL to omit */
LPCSTR progid_extra; /* can be NULL to omit */
};
static HRESULT register_coclasses(struct regsvr_coclass const *list);
static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
/***********************************************************************
* static string constants
*/
static WCHAR const interface_keyname[10] = {
'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
static WCHAR const base_ifa_keyname[14] = {
'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
'e', 0 };
static WCHAR const num_methods_keyname[11] = {
'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
static WCHAR const ps_clsid_keyname[15] = {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', 0 };
static WCHAR const ps_clsid32_keyname[17] = {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', '3', '2', 0 };
static WCHAR const clsid_keyname[6] = {
'C', 'L', 'S', 'I', 'D', 0 };
static WCHAR const curver_keyname[7] = {
'C', 'u', 'r', 'V', 'e', 'r', 0 };
static WCHAR const ips_keyname[13] = {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
0 };
static WCHAR const ips32_keyname[15] = {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
'3', '2', 0 };
static WCHAR const progid_keyname[7] = {
'P', 'r', 'o', 'g', 'I', 'D', 0 };
static WCHAR const viprogid_keyname[25] = {
'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p',
'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D',
0 };
static char const tmodel_valuename[] = "ThreadingModel";
/***********************************************************************
* static helper functions
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid);
static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
WCHAR const *value);
static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
char const *value);
static LONG register_progid(WCHAR const *clsid,
char const *progid, char const *curver_progid,
char const *name, char const *extra);
static LONG recursive_delete_key(HKEY key);
static LONG recursive_delete_keyA(HKEY base, char const *name);
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
LONG res = ERROR_SUCCESS;
HKEY interface_key;
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->iid; ++list) {
WCHAR buf[39];
HKEY iid_key;
StringFromGUID2(list->iid, buf, 39);
res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_interface_key;
if (list->name) {
res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
(CONST BYTE*)(list->name),
strlen(list->name) + 1);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->base_iid) {
register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (0 <= list->num_methods) {
static WCHAR const fmt[3] = { '%', 'd', 0 };
HKEY key;
res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
wsprintfW(buf, fmt, list->num_methods);
res = RegSetValueExW(key, NULL, 0, REG_SZ,
(CONST BYTE*)buf,
(lstrlenW(buf) + 1) * sizeof(WCHAR));
RegCloseKey(key);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid) {
register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid32) {
register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
error_close_iid_key:
RegCloseKey(iid_key);
}
error_close_interface_key:
RegCloseKey(interface_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
LONG res = ERROR_SUCCESS;
HKEY interface_key;
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0,
KEY_READ | KEY_WRITE, &interface_key);
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->iid; ++list) {
WCHAR buf[39];
StringFromGUID2(list->iid, buf, 39);
res = recursive_delete_keyW(interface_key, buf);
}
RegCloseKey(interface_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
WCHAR buf[39];
HKEY clsid_key;
StringFromGUID2(list->clsid, buf, 39);
res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->name) {
res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
(CONST BYTE*)(list->name),
strlen(list->name) + 1);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->ips) {
res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->ips32) {
HKEY ips32_key;
res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL,
&ips32_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
(CONST BYTE*)list->ips32,
lstrlenA(list->ips32) + 1);
if (res == ERROR_SUCCESS && list->ips32_tmodel)
res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
(CONST BYTE*)list->ips32_tmodel,
strlen(list->ips32_tmodel) + 1);
RegCloseKey(ips32_key);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->progid) {
res = register_key_defvalueA(clsid_key, progid_keyname,
list->progid);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = register_progid(buf, list->progid, NULL,
list->name, list->progid_extra);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->viprogid) {
res = register_key_defvalueA(clsid_key, viprogid_keyname,
list->viprogid);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = register_progid(buf, list->viprogid, list->progid,
list->name, list->progid_extra);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
error_close_clsid_key:
RegCloseKey(clsid_key);
}
error_close_coclass_key:
RegCloseKey(coclass_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0,
KEY_READ | KEY_WRITE, &coclass_key);
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
WCHAR buf[39];
StringFromGUID2(list->clsid, buf, 39);
res = recursive_delete_keyW(coclass_key, buf);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->progid) {
res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
}
if (list->viprogid) {
res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->viprogid);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
}
}
error_close_coclass_key:
RegCloseKey(coclass_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
return register_key_defvalueW(base, name, buf);
}
/***********************************************************************
* regsvr_key_defvalueW
*/
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
LONG res;
HKEY key;
res = RegCreateKeyExW(base, name, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) return res;
res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
(lstrlenW(value) + 1) * sizeof(WCHAR));
RegCloseKey(key);
return res;
}
/***********************************************************************
* regsvr_key_defvalueA
*/
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
LONG res;
HKEY key;
res = RegCreateKeyExW(base, name, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) return res;
res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
lstrlenA(value) + 1);
RegCloseKey(key);
return res;
}
/***********************************************************************
* regsvr_progid
*/
static LONG register_progid(
WCHAR const *clsid,
char const *progid,
char const *curver_progid,
char const *name,
char const *extra)
{
LONG res;
HKEY progid_key;
res = RegCreateKeyExA(HKEY_CLASSES_ROOT, progid, 0,
NULL, 0, KEY_READ | KEY_WRITE, NULL,
&progid_key, NULL);
if (res != ERROR_SUCCESS) return res;
if (name) {
res = RegSetValueExA(progid_key, NULL, 0, REG_SZ,
(CONST BYTE*)name, strlen(name) + 1);
if (res != ERROR_SUCCESS) goto error_close_progid_key;
}
if (clsid) {
res = register_key_defvalueW(progid_key, clsid_keyname, clsid);
if (res != ERROR_SUCCESS) goto error_close_progid_key;
}
if (curver_progid) {
res = register_key_defvalueA(progid_key, curver_keyname,
curver_progid);
if (res != ERROR_SUCCESS) goto error_close_progid_key;
}
if (extra) {
HKEY extra_key;
res = RegCreateKeyExA(progid_key, extra, 0,
NULL, 0, KEY_READ | KEY_WRITE, NULL,
&extra_key, NULL);
if (res == ERROR_SUCCESS)
RegCloseKey(extra_key);
}
error_close_progid_key:
RegCloseKey(progid_key);
return res;
}
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
HKEY subkey;
for (;;) {
cName = sizeof(subkey_name) / sizeof(WCHAR);
res = RegEnumKeyExW(key, 0, subkey_name, &cName,
NULL, NULL, NULL, NULL);
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) {
res = ERROR_SUCCESS; /* presumably we're done enumerating */
break;
}
res = RegOpenKeyExW(key, subkey_name, 0,
KEY_READ | KEY_WRITE, &subkey);
if (res == ERROR_FILE_NOT_FOUND) continue;
if (res != ERROR_SUCCESS) break;
res = recursive_delete_key(subkey);
RegCloseKey(subkey);
if (res != ERROR_SUCCESS) break;
}
if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0);
return res;
}
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
LONG res;
HKEY key;
res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key);
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
if (res != ERROR_SUCCESS) return res;
res = recursive_delete_key(key);
RegCloseKey(key);
return res;
}
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
LONG res;
HKEY key;
res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key);
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
if (res != ERROR_SUCCESS) return res;
res = recursive_delete_key(key);
RegCloseKey(key);
return res;
}
/***********************************************************************
* coclass list
*/
static struct regsvr_coclass const coclass_list[] = {
{ &CLSID_DirectPlay,
"DirectPlay Object",
NULL,
"dplayx.dll",
"Both"
},
{ &CLSID_DirectPlayLobby,
"DirectPlayLobby Object",
NULL,
"dplayx.dll",
"Both"
},
{ NULL } /* list terminator */
};
/***********************************************************************
* interface list
*/
static struct regsvr_interface const interface_list[] = {
{ NULL } /* list terminator */
};
/***********************************************************************
* DllRegisterServer (DPLAYX.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
HRESULT hr;
TRACE("\n");
hr = register_coclasses(coclass_list);
if (SUCCEEDED(hr))
hr = register_interfaces(interface_list);
return hr;
}
/***********************************************************************
* DllUnregisterServer (DPLAYX.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
HRESULT hr;
TRACE("\n");
hr = unregister_coclasses(coclass_list);
if (SUCCEEDED(hr))
hr = unregister_interfaces(interface_list);
return hr;
}

View file

@ -13,15 +13,17 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define WINE_OLESELFREGISTER
1 WINE_REGISTRY dplayx.rgs
#define WINE_FILEDESCRIPTION_STR "Wine DirectPlay"
#define WINE_FILENAME_STR "dplayx.dll"
#define WINE_FILEVERSION 5,3,0,900
#define WINE_FILEVERSION_STR "5.3.0.900"
#define WINE_PRODUCTVERSION 5,3,0,900
#define WINE_PRODUCTVERSION_STR "5.3"
#define WINE_FILEVERSION 5,3,1,904
#define WINE_FILEVERSION_STR "5.3.1.904"
#define WINE_PRODUCTVERSION 5,3,1,904
#define WINE_PRODUCTVERSION_STR "5.3.1.904"
#define WINE_EXTRAVALUES VALUE "OLESelfRegister",""
#include "wine/wine_common_ver.rc"
#include <wine/wine_common_ver.rc>

View file

@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPLAY_H
@ -192,18 +192,16 @@ typedef struct tagDPNAME
{
LPWSTR lpszShortName;
LPSTR lpszShortNameA;
};
} DUMMYUNIONNAME1;
union /*playerLongName */ /* Player's formal/real name */
{
LPWSTR lpszLongName;
LPSTR lpszLongNameA;
};
} DUMMYUNIONNAME2;
} DPNAME, *LPDPNAME;
#define DPLONGNAMELEN 52
#define DPSHORTNAMELEN 20
#define DPSESSIONNAMELEN 32
@ -244,13 +242,13 @@ typedef struct tagDPSESSIONDESC2
{
LPWSTR lpszSessionName;
LPSTR lpszSessionNameA;
};
} DUMMYUNIONNAME1;
union /* Optional password */
{
LPWSTR lpszPassword;
LPSTR lpszPasswordA;
};
} DUMMYUNIONNAME2;
DWORD dwReserved1;
DWORD dwReserved2;
@ -260,8 +258,6 @@ typedef struct tagDPSESSIONDESC2
DWORD dwUser3;
DWORD dwUser4;
} DPSESSIONDESC2, *LPDPSESSIONDESC2;
typedef const DPSESSIONDESC2* LPCDPSESSIONDESC2;
#define DPOPEN_JOIN 0x00000001
@ -279,6 +275,9 @@ typedef const DPSESSIONDESC2* LPCDPSESSIONDESC2;
#define DPSESSION_PASSWORDREQUIRED 0x00000400
#define DPSESSION_MULTICASTSERVER 0x00000800
#define DPSESSION_CLIENTSERVER 0x00001000
#define DPSESSION_DIRECTPLAYPROTOCOL 0x00002000
#define DPSESSION_NOPRESERVEORDER 0x00004000
#define DPSESSION_OPTIMIZELATENCY 0x00008000
typedef struct tagDPLCONNECTION
{
@ -396,7 +395,7 @@ typedef BOOL (CALLBACK *LPDPENUMSESSIONSCALLBACK)(
extern HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA, LPVOID );
extern HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACKW, LPVOID );
extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY2 *lplpDP, IUnknown *pUnk);
extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk );
typedef BOOL (CALLBACK *LPDPENUMPLAYERSCALLBACK)(
DPID dpId,
@ -1065,6 +1064,20 @@ DECLARE_INTERFACE_(IDirectPlay4,IDirectPlay3)
/* DirectPlay::Connect */
#define DPCONNECT_RETURNSTATUS (DPENUMSESSIONS_RETURNSTATUS)
/* DirectPlay::GetCaps and DirectPlay::GetPlayerCaps */
#define DPCAPS_ISHOST 0x00000002
#define DPCAPS_GROUPOPTIMIZED 0x00000008
#define DPCAPS_KEEPALIVEOPTIMIZED 0x00000010
#define DPCAPS_GUARANTEEDOPTIMIZED 0x00000020
#define DPCAPS_GUARANTEEDSUPPORTED 0x00000040
#define DPCAPS_SIGNINGSUPPORTED 0x00000080
#define DPCAPS_ENCRYPTIONSUPPORTED 0x00000100
#define DPPLAYERCAPS_LOCAL 0x00000800
#define DPCAPS_ASYNCCANCELSUPPORTED 0x00001000
#define DPCAPS_ASYNCCANCELALLSUPPORTED 0x00002000
#define DPCAPS_SENDTIMEOUTSUPPORTED 0x00004000
#define DPCAPS_SENDPRIORITYSUPPORTED 0x00008000
#define DPCAPS_ASYNCSUPPORTED 0x00010000
/** DirectPlay system messages **/

View file

@ -13,23 +13,19 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DIRECT_PLAY_SP_H
#define __WINE_DIRECT_PLAY_SP_H
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <stdarg.h>
//#include <stdarg.h>
//#include "windef.h"
#include <winbase.h>
//#include "winuser.h"
//#include "dplay.h"
#include <dplobby.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "dplay.h"
#include "dplobby.h"
/* GUID for IDirectPlaySP {0C9F6360-CC61-11cf-ACEC-00AA006886E3} */
DEFINE_GUID(IID_IDirectPlaySP, 0xc9f6360, 0xcc61, 0x11cf, 0xac, 0xec, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);

View file

@ -31,8 +31,8 @@ reactos/dll/directx/amstream # Synced to Wine-1.3.37
reactos/dll/directx/dinput # Synced to Wine-20090208
reactos/dll/directx/dinput8 # Synced to Wine-20090208
reactos/dll/directx/dmusic # Synced to Wine-1_1_23
reactos/dll/directx/dplay # Synced to Wine-0_9_5
reactos/dll/directx/dplayx # Synced to Wine-0_9_5
reactos/dll/directx/dplay # Synced to Wine-1.5.26
reactos/dll/directx/dplayx # Synced to Wine-1.5.26
reactos/dll/directx/dxdiagn # Synced to Wine-0_9_5
reactos/dll/directx/msdmo # Autosync
reactos/dll/directx/qedit # Autosync