Merged msacm and msacm32 dlls.
[wine] / documentation / status / directplay
1 This file contains information on the implementation of the direct play
2 and direct play lobby features. There's lots to do and I'm not exactly
3 implementing it overnight! Please lend a hand.
4
5 Most methods and APIs are but stubs at this point. Examine the code
6 to see what has been implemented. Use -debugmsg +dplay to get a 
7 reasonably thourough description of what's going on.
8
9 Associated DirectX user header files are include/dplay.h, include/dplobby.h.
10
11 Implementation of the DPLAY and DPLAYX dlls are both in the dlls/dplayx
12 directory. Here's a brief description of the function of each of the files in that
13 directory:
14
15 dplay.c: Implementation of all the direct play object interfaces.
16
17 dplobby.c: Implementation of all the direct play lobby interfaces.
18
19 dpclassfactory.c: Implementation of the COM class factory which can create either
20                   direct play lobby or direct play lobby interfaces.
21
22 dpinit.h: Header file so that dpclassfactory.c can access dplay and dplobby query 
23           functions. Shouldn't be included by anything else.
24
25 dplayx_global.h,
26 dplayx_global.c: Implementation of all things which are associated with dplay on
27                  the computer - ie shared resources and such. Methods in this
28                  compilation unit should not call anything out side this unit
29                  excepting base windows services and an interface to start the
30                  messaging thread.
31
32 name_server.h,
33 name_server.c: Implementation of all things which are associated with the name
34                server functionality
35
36 dplayx_main.c: LibMain executed for loading and unloading the dll. This will make
37                the call to dplayx_global.c to request initialization and destruction
38                of any global data.
39
40 dplayx_queue.h: Linked list implementation for dplay/dplobby. Based off of the BSD
41                 version found in <sys/queue.h>
42
43 dplayx_messages.h,
44 dplayx_messages.c: Messaging interface required for both DirectPlay and 
45                    DirectPlayLobby.
46
47 Presently the architectural relationship between this files is a little shakey, but
48 isn't so sufficiently bad that it needs fixing yet.
49
50 I think I can safely say that any application which requires direct play
51 or direct play lobby will not work at this point. Priority will be to get
52 examples from the sdk running. Once they're at least partially working, I can
53 get down to trying to get some of the games working.
54
55 However, now that address separation is a reality, all binary samples provided 
56 in the sdk can be used. I have had success spawning processes and one
57 directx7 example will allow creation of an app and allow another to join it.
58 Unfortunately, there isn't much for it to be able to do give the state of
59 inter lobby messaging.
60
61 A small issue will be the fact that DirectX 6.1(ie. DirectPlay4) introduces a layer of functionality
62 inside the DP objects which provide guaranteed protocol delivery. This is
63 even if the native protocol, IPX or modem for instance, doesn't guarantee it. I'm going to leave
64 this kind of implementation to as close to the end as possible. However, I
65 will implement an abstraction layer, where possible, for this functionality. 
66 It will do nothing to start, but will require only the implementation of the 
67 guaranteness to give final implementation.
68
69
70 TODO:
71   - (done) Header files for DP4 and DPL3 
72   - (done) Add stub functions for all DP4 and DPL3 interfaces
73   - (done) Correct naming of the parameters for DP3 and DPL2
74   - (done) Seperate out DP and DPL into multiple .c files
75   - (done) Allow CoCreateInstance to create the new interfaces
76   - (started)Implement mutual exclusion on object data for existing functions
77   - (done) Create and move to correct dll directories (dplay and dplayx)
78   - (done) Implement dplay in terms of dplayx
79   - (done) Need a better internal implementation for the objects which scales and 
80     preferably doesn't involve casting structures. Solution is a crude ctor/dtor
81     which can actually trap some runtime errors.
82   - (done) More generic initialization and destruction helper methods based off
83     the chosen internal implementation. Solution is a crude ctor/dtor.
84   - Use only windows routines where an equivalent is available
85   - (done) Fix wine dplay.h and dplobby.h header files to allow apps to create the ansi versions
86   - (started) Port some WineLib test programs using sdk programs (both C and C++ progs)  
87   - (done) Implement a lib main for the dplayx dll (required for RunApplication, etc.)
88   - (done)Figure out how to share the global memory correctly
89   - Ensure that all dll stubs are present and the ordinals are correct
90   - (started) Implementation of functionality
91   - Addition of DirectX 7.0 functionality for direct play (try to catch that moving train)
92   - bug fixes ;)
93   - Implement some WineLib test programs using sdk programs as a skeleton
94   - (done) Change all RegEnumKey calls to RegEnumKeyEx.
95   - Change RegEnumKeyEx enumeration pattern to allow error handling and to
96     share registry implementation (or at least simplify).
97   - Add in appropriate RegCloseKey calls for all the opening we're doing...
98   - Fix all the buffer sizes for registry calls. They're off by one - but in a safe direction.
99   - Find out how to call the service provider dlls - they don't have a published interface!
100   - Fix race condition on interface destruction
101   - Handles need to be correctly reference counted
102   - Need to check if we need to deallocate any list objects when destroying 
103     dplay interface
104   - RunApplication process spawning needs to have correct syncronization.
105   - Need to get inter lobby messages working.
106
107 ENHANCEMENTS:
108   - Improve footprint and realtime blocking by setting up a seperate data share
109     between lobby application and client since there can be multiple apps per 
110     client.
111   - Handle everything in UNICODE (as server does) and do conversions for ANSI 
112     interfaces. Should cut down on dplayx code base and maintanability (marginally)
113     and could be used to improve efficiency of dialog with the server (it wouldn't
114     have to do ANSI<->UNICODE transformations).
115
116
117
118 Programs to make work:
119   - lserver.exe (from sdk)
120   - override.exe (from sdk)
121   - dpchat.exe (from sdk)
122   - duel.exe (from sdk)
123   - dplaunch.exe (from sdk)
124
125 Next API to implement on a per SDK program basis:
126   override.exe
127   - fixme:dplay:DirectPlayCreate Modem binding not supported yet
128   - DirectPlay3AImpl_InitializeConnection
129   - DirectPlay2AImpl_Open
130   - ?
131
132   dplaunch.exe
133   - Just needs final process startup messages to be exchanged correctly!
134
135   lserver.exe
136   - IDirectPlayLobby2WImpl_Connect 
137   - fixme:dplay:DirectPlayCreate Modem binding not supported yet
138   - IDirectPlay3WImpl_CreatePlayer 
139   - IDirectPlay3WImpl_CreateGroup
140   - IDirectPlay3WImpl_SetGroupData
141   - IDirectPlay3WImpl_Send
142   - ?
143  
144   bellhop.exe
145   - DP_SendSessionRequestBroadcast (implement the name server stuff)
146   - ?
147
148   dpslots.exe
149   - IDirectPlayLobby3AImpl_ConnectEx
150   - ?
151
152   override.exe
153   - DirectPlayCreate Service provider binding not supported yet
154   - ?
155
156 Other TODO:
157
158 - look at problem with parsing the resource file for dplaunch. wrc problem?
159 - I should be getting the dialog box to come up for dpchat when something is selected
160 Call OLE32.7: CoCreateInstance(010017f0,00000000,00000001,010017e0,010094b4) ret=01002f38 fs=0237
161 Call ADVAPI32.188: RegOpenKeyExA(80000002,5e08dd90 "Software\\Microsoft\\DirectPlay\\Compatibility",00000000,00020019,40e7f49c) ret=5e0b6e5a fs=0237
162
163    
164 Peter Hunnisett  -  hunnise@nortelnetworks.com