Commit e4e61708 authored by Peter Hunnisett's avatar Peter Hunnisett Committed by Alexandre Julliard

- Make registry usage a little more correct and modern

- Create home for all dplay name server functionality - Add the framework for EnumSessions - Documentation update
parent 014dccc7
...@@ -13,7 +13,8 @@ C_SRCS = dplay.c \ ...@@ -13,7 +13,8 @@ C_SRCS = dplay.c \
dplobby.c \ dplobby.c \
dpclassfactory.c \ dpclassfactory.c \
dplayx_main.c \ dplayx_main.c \
dplayx_global.c dplayx_global.c \
name_server.c
@MAKE_DLL_RULES@ @MAKE_DLL_RULES@
......
/* Direct Play Lobby 2 & 3 Implementation /* Direct Play Lobby 2 & 3 Implementation
* *
* Copyright 1998,1999 - Peter Hunnisett * Copyright 1998,1999,2000 - Peter Hunnisett
* *
* <presently under construction - contact hunnise@nortelnetworks.com> * <presently under construction - contact hunnise@nortelnetworks.com>
* *
...@@ -843,6 +843,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes ...@@ -843,6 +843,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes
LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers"; LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers";
DWORD dwIndex, sizeOfSubKeyName=50; DWORD dwIndex, sizeOfSubKeyName=50;
char subKeyName[51]; char subKeyName[51];
FILETIME filetime;
TRACE(" (%p)->(%p,%p,%p,0x%08lx)\n", This, lpEnumAddressTypeCallback, guidSP, lpContext, dwFlags ); TRACE(" (%p)->(%p,%p,%p,0x%08lx)\n", This, lpEnumAddressTypeCallback, guidSP, lpContext, dwFlags );
...@@ -863,7 +864,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes ...@@ -863,7 +864,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes
/* Need to loop over the service providers in the registry */ /* Need to loop over the service providers in the registry */
if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey, if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey,
0, KEY_ENUMERATE_SUB_KEYS, &hkResult ) != ERROR_SUCCESS ) 0, KEY_READ, &hkResult ) != ERROR_SUCCESS )
{ {
/* Hmmm. Does this mean that there are no service providers? */ /* Hmmm. Does this mean that there are no service providers? */
ERR(": no service providers?\n"); ERR(": no service providers?\n");
...@@ -872,8 +873,9 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes ...@@ -872,8 +873,9 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes
/* Traverse all the service providers we have available */ /* Traverse all the service providers we have available */
for( dwIndex=0; for( dwIndex=0;
RegEnumKeyA( hkResult, dwIndex, subKeyName, sizeOfSubKeyName ) != ERROR_NO_MORE_ITEMS; RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName,
++dwIndex ) NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS;
++dwIndex, sizeOfSubKeyName=50 )
{ {
HKEY hkServiceProvider, hkServiceProviderAt; HKEY hkServiceProvider, hkServiceProviderAt;
...@@ -885,12 +887,13 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes ...@@ -885,12 +887,13 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes
DWORD dwAtIndex; DWORD dwAtIndex;
LPSTR atKey = "Address Types"; LPSTR atKey = "Address Types";
LPSTR guidDataSubKey = "Guid"; LPSTR guidDataSubKey = "Guid";
FILETIME filetime;
TRACE(" this time through: %s\n", subKeyName ); TRACE(" this time through: %s\n", subKeyName );
/* Get a handle for this particular service provider */ /* Get a handle for this particular service provider */
if( RegOpenKeyExA( hkResult, subKeyName, 0, KEY_QUERY_VALUE, if( RegOpenKeyExA( hkResult, subKeyName, 0, KEY_READ,
&hkServiceProvider ) != ERROR_SUCCESS ) &hkServiceProvider ) != ERROR_SUCCESS )
{ {
ERR(": what the heck is going on?\n" ); ERR(": what the heck is going on?\n" );
...@@ -918,17 +921,18 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes ...@@ -918,17 +921,18 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes
} }
/* Get a handle for this particular service provider */ /* Get a handle for this particular service provider */
if( RegOpenKeyExA( hkServiceProvider, atKey, 0, KEY_QUERY_VALUE, if( RegOpenKeyExA( hkServiceProvider, atKey, 0, KEY_READ,
&hkServiceProviderAt ) != ERROR_SUCCESS ) &hkServiceProviderAt ) != ERROR_SUCCESS )
{ {
WARN(": No Address Types registry data sub key/members\n" ); TRACE(": No Address Types registry data sub key/members\n" );
break; break;
} }
/* Traverse all the address type we have available */ /* Traverse all the address type we have available */
for( dwAtIndex=0; for( dwAtIndex=0;
RegEnumKeyA( hkServiceProviderAt, dwAtIndex, atSubKey, sizeOfSubKeyName ) != ERROR_NO_MORE_ITEMS; RegEnumKeyExA( hkServiceProviderAt, dwAtIndex, atSubKey, &sizeOfSubKeyName,
++dwAtIndex ) NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS;
++dwAtIndex, sizeOfSubKeyName=50 )
{ {
TRACE( "Found Address Type GUID %s\n", atSubKey ); TRACE( "Found Address Type GUID %s\n", atSubKey );
...@@ -997,6 +1001,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications ...@@ -997,6 +1001,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications
LPSTR guidDataSubKey = "Guid"; LPSTR guidDataSubKey = "Guid";
DWORD dwIndex, sizeOfSubKeyName=50; DWORD dwIndex, sizeOfSubKeyName=50;
char subKeyName[51]; char subKeyName[51];
FILETIME filetime;
TRACE("(%p)->(%p,%p,0x%08lx)\n", This, lpEnumLocalAppCallback, lpContext, dwFlags ); TRACE("(%p)->(%p,%p,0x%08lx)\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
...@@ -1012,7 +1017,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications ...@@ -1012,7 +1017,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications
/* Need to loop over the service providers in the registry */ /* Need to loop over the service providers in the registry */
if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey, if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey,
0, KEY_ENUMERATE_SUB_KEYS, &hkResult ) != ERROR_SUCCESS ) 0, KEY_READ, &hkResult ) != ERROR_SUCCESS )
{ {
/* Hmmm. Does this mean that there are no service providers? */ /* Hmmm. Does this mean that there are no service providers? */
ERR(": no service providers?\n"); ERR(": no service providers?\n");
...@@ -1021,8 +1026,8 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications ...@@ -1021,8 +1026,8 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications
/* Traverse all registered applications */ /* Traverse all registered applications */
for( dwIndex=0; for( dwIndex=0;
RegEnumKeyA( hkResult, dwIndex, subKeyName, sizeOfSubKeyName ) != ERROR_NO_MORE_ITEMS; RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName, NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS;
++dwIndex ) ++dwIndex, sizeOfSubKeyName=50 )
{ {
HKEY hkServiceProvider; HKEY hkServiceProvider;
...@@ -1035,7 +1040,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications ...@@ -1035,7 +1040,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications
TRACE(" this time through: %s\n", subKeyName ); TRACE(" this time through: %s\n", subKeyName );
/* Get a handle for this particular service provider */ /* Get a handle for this particular service provider */
if( RegOpenKeyExA( hkResult, subKeyName, 0, KEY_QUERY_VALUE, if( RegOpenKeyExA( hkResult, subKeyName, 0, KEY_READ,
&hkServiceProvider ) != ERROR_SUCCESS ) &hkServiceProvider ) != ERROR_SUCCESS )
{ {
ERR(": what the heck is going on?\n" ); ERR(": what the heck is going on?\n" );
......
/* DPLAYX.DLL name server implementation
*
* Copyright 2000 - Peter Hunnisett
*
* <presently under construction - contact hunnise@nortelnetworks.com>
*
*/
/* NOTE: Methods with the NS_ prefix are name server methods */
#include "debugtools.h"
#include "name_server.h"
DEFAULT_DEBUG_CHANNEL(dplay);
void DPLAYX_NS_SetLocalComputerAsNameServer( LPDPSESSIONDESC2 lpsd )
{
FIXME( ": (%p) stub\n", lpsd );
}
#ifndef __WINE_DPLAYX_NAMESERVER
#define __WINE_DPLAYX_NAMESERVER
#include "dplay.h"
void DPLAYX_NS_SetLocalComputerAsNameServer( LPDPSESSIONDESC2 lpsd );
#endif /* __WINE_DPLAYX_NAMESERVER */
This file contains information on the implementation of the direct play This file contains information on the implementation of the direct play
and direct play lobby features. and direct play lobby features. There's lots to do and I'm not exactly
implementing it overnight! Please lend a hand.
Most methods and APIs are not implemented at this point. Examine the code Most methods and APIs are but stubs at this point. Examine the code
to see what has been implemented. Stay tuned for some information here once to see what has been implemented. Use -debugmsg +dplay to get a
there is more implementation (and I figure out what the heck I'm doing). reasonably thourough description of what's going on.
The files are include/dplay.h, include/dplobby.h, multimedia/dplobby.c and multimedia/dplay.c. Associated header files are include/dplay.h, include/dplobby.h.
The .c files will be moved to appropriate dll directories at some later time.
Implementation of the DPLAY and DPLAYX dlls are both in the dlls/dplayx
directory.
dplay.c: Implementation of all the direct play object interfaces.
dplobby.c: Implementation of all the direct play lobby interfaces.
dpclassfactory.c: Implementation of the COM class factory which can create either
direct play lobby or direct play lobby interfaces.
dplayx_global.c: Implementation of all things which are associated with dplay on
the computer - ie shared resources and such. Methods in this
compilation unit should not call anything out side this unit.
name_server.c: Implementation of all things which are associated with the name
server functionality
dplayx_main.c: LibMain executed for loading and unloading the dll. This will make
the call to dplayx_global.c to request initialization and destruction
of any global data.
Presently the architectural relationship between this files is a little shakey, but
isn't so sufficiently bad that it needs fixing yet.
Everything right now will run in the context of the calling thread, but at some
point in the future the code will actually be far enough along to create a thread
for session management.
I think I can safely say that any application which requires direct play I think I can safely say that any application which requires direct play
or direct play lobby will not work at this point. Priority will be to get or direct play lobby will not work at this point. Priority will be to get
...@@ -42,12 +65,16 @@ TODO: ...@@ -42,12 +65,16 @@ TODO:
- (done) Implement a lib main for the dplayx dll (required for RunApplication, etc.) - (done) Implement a lib main for the dplayx dll (required for RunApplication, etc.)
- Figure out how to share the global memory correctly - Figure out how to share the global memory correctly
- Ensure that all dll stubs are present and the ordinals are correct - Ensure that all dll stubs are present and the ordinals are correct
- (started)Implementation of functionality - (started) Implementation of functionality
- Addition of DirectX 7.0 functionality for direct play (try to catch that moving train) - Addition of DirectX 7.0 functionality for direct play (try to catch that moving train)
- bug fixes ;) - bug fixes ;)
- Implement some WineLib test programs using sdk programs as a skeleton - Implement some WineLib test programs using sdk programs as a skeleton
- Change all RegEnumKey calls to RegEnumKeyEx and change enumeration pattern to allow - (done) Change all RegEnumKey calls to RegEnumKeyEx.
error handling. - Change RegEnumKeyEx enumeration pattern to allow error handling.
- 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 - but in a safe direction.
- Find out how to call the service provider dlls - they don't have a published interface!
- Fix race condition on interface destruction
Programs to make work: Programs to make work:
- lserver.exe (from sdk) - lserver.exe (from sdk)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment