ReactOS
0.4.17-dev-966-gf06eace
dplayx_main.c
Go to the documentation of this file.
1
/*
2
* DPLAYX.DLL LibMain
3
*
4
* Copyright 1999,2000 - Peter Hunnisett
5
*
6
*
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
11
*
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
16
*
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20
*
21
* NOTES
22
* o DPMSGCMD_ENUMSESSIONSREPLY & DPMSGCMD_ENUMSESSIONSREQUEST
23
* Have most fields understood, but not all. Everything seems to work.
24
* o DPMSGCMD_REQUESTNEWPLAYERID & DPMSGCMD_NEWPLAYERIDREPLY
25
* Barely works. This needs to be completed for sessions to start.
26
* o A small issue will be the fact that DirectX 6.1(ie. DirectPlay4)
27
* introduces a layer of functionality inside the DP objects which
28
* provide guaranteed protocol delivery. This is even if the native
29
* protocol, IPX or modem for instance, doesn't guarantee it. I'm going
30
* to leave this kind of implementation to as close to the end as
31
* possible. However, I will implement an abstraction layer, where
32
* possible, for this functionality. It will do nothing to start, but
33
* will require only the implementation of the guarantee to give
34
* final implementation.
35
*
36
* TODO:
37
* - Implement mutual exclusion on object data for existing functions
38
* - Ensure that all dll stubs are present and the ordinals are correct
39
* - Addition of DirectX 7.0 functionality for direct play
40
* - Implement some WineLib test programs using sdk programs as a skeleton
41
* - Change RegEnumKeyEx enumeration pattern to allow error handling and to
42
* share registry implementation (or at least simplify).
43
* - Add in appropriate RegCloseKey calls for all the opening we're doing...
44
* - Fix all the buffer sizes for registry calls. They're off by one -
45
* but in a safe direction.
46
* - Fix race condition on interface destruction
47
* - Handles need to be correctly reference counted
48
* - Check if we need to deallocate any list objects when destroying
49
* a dplay interface
50
* - RunApplication process spawning needs to have correct synchronization.
51
* - Need to get inter lobby messages working.
52
* - Decipher dplay messages between applications and implement...
53
* - Need to implement lobby session spawning.
54
* - Improve footprint and realtime blocking by setting up a separate data share
55
* between lobby application and client since there can be multiple apps per
56
* client. Also get rid of offset dependency by making data offset independent
57
* somehow.
58
*/
59
#include <stdarg.h>
60
61
#include "
winerror.h
"
62
#include "
windef.h
"
63
#include "
winbase.h
"
64
#include "
objbase.h
"
65
#include "
rpcproxy.h
"
66
#include "
wine/debug.h
"
67
#include "
dplay_global.h
"
68
#include "
dplayx_global.h
"
69
70
WINE_DEFAULT_DEBUG_CHANNEL
(dplay);
71
72
/* This is a globally exported variable at ordinal 6 of DPLAYX.DLL */
73
DWORD
gdwDPlaySPRefCount
= 0;
74
75
76
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
77
{
78
79
TRACE
(
"(%p,%ld,%p)\n"
, hinstDLL,
fdwReason
,
lpvReserved
);
80
81
switch
(
fdwReason
)
82
{
83
case
DLL_PROCESS_ATTACH
:
84
DisableThreadLibraryCalls
(hinstDLL);
85
/* First instance perform construction of global processor data */
86
return
DPLAYX_ConstructData
();
87
88
case
DLL_PROCESS_DETACH
:
89
DP_FreeConnections
();
90
/* Last instance performs destruction of global processor data */
91
return
DPLAYX_DestructData
();
92
93
default
:
94
break
;
95
96
}
97
98
return
TRUE
;
99
}
fdwReason
static DWORD const fdwReason
Definition:
appcrt_dllmain.cpp:57
WINE_DEFAULT_DEBUG_CHANNEL
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition:
precomp.h:23
TRUE
#define TRUE
Definition:
types.h:120
DLL_PROCESS_ATTACH
#define DLL_PROCESS_ATTACH
Definition:
compat.h:131
DLL_PROCESS_DETACH
#define DLL_PROCESS_DETACH
Definition:
compat.h:130
DisableThreadLibraryCalls
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition:
loader.c:85
DP_FreeConnections
void DP_FreeConnections(void)
Definition:
dplay.c:5133
dplay_global.h
DPLAYX_DestructData
BOOL DPLAYX_DestructData(void)
Definition:
dplayx_global.c:513
DPLAYX_ConstructData
BOOL DPLAYX_ConstructData(void)
Definition:
dplayx_global.c:355
dplayx_global.h
DllMain
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition:
dplayx_main.c:76
gdwDPlaySPRefCount
DWORD gdwDPlaySPRefCount
Definition:
dplayx_main.c:73
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
void
Definition:
nsiface.idl:2307
lpvReserved
static IN DWORD IN LPVOID lpvReserved
Definition:
load_notifications.c:17
objbase.h
rpcproxy.h
debug.h
TRACE
#define TRACE(s)
Definition:
solgame.cpp:4
winbase.h
windef.h
WINAPI
#define WINAPI
Definition:
msvc.h:6
winerror.h
dll
directx
wine
dplayx
dplayx_main.c
Generated on Thu Oct 1 2026 06:04:22 for ReactOS by
1.9.6