Added the minmax.h header (VC6).
[wine/wine-kai.git] / documentation / status / directplay
blob532f91496613335170bc05f4e3bd448a18e924b2
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.
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.
9 Associated DirectX user header files are include/dplay.h, include/dplobby.h.
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:
15 dplay.c: Implementation of all the direct play object interfaces.
17 dplobby.c: Implementation of all the direct play lobby interfaces.
19 dpclassfactory.c: Implementation of the COM class factory which can create either
20                   direct play lobby or direct play lobby interfaces.
22 dpinit.h: Header file so that dpclassfactory.c can access dplay and dplobby query 
23           functions. Shouldn't be included by anything else.
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.
32 name_server.h,
33 name_server.c: Implementation of all things which are associated with the name
34                server functionality
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.
40 dplayx_queue.h: Linked list implementation for dplay/dplobby. Based off of the BSD
41                 version found in <sys/queue.h>
43 dplayx_messages.h,
44 dplayx_messages.c: Messaging interface required for both DirectPlay and 
45                    DirectPlayLobby.
47 dplaysp.c,
48 dplaysp.h: COM interface between DPLAYX and the service provider dlls. dplaysp.h is
49            something that should be included into any service provider. Basically 
50            the COM interface is partially documented but is generally lacking in the
51            finer points.
53 Presently the architectural relationship between this files is a little shakey, but
54 isn't so sufficiently bad that it needs fixing yet.
56 I think I can safely say that any application which requires direct play
57 or direct play lobby will not work at this point. Priority will be to get
58 examples from the sdk running. Once they're at least partially working, I can
59 get down to trying to get some of the games working.
61 However, now that address separation is a reality, all binary samples provided 
62 in the sdk can be used. I have had success spawning processes and one
63 directx7 example will allow creation of an app and allow another to join it.
64 Unfortunately, there isn't much for it to be able to do give the state of
65 inter directlobby or directplay messaging.
67 Messages which work:
69 For session enumeration: DPMSGCMD_ENUMSESSIONSREPLY & DPMSGCMD_ENUMSESSIONSREQUEST
70                          have most fields understood, but not all. Everything _seems_
71                          to work.
73 For playerid requesting: DPMSGCMD_REQUESTNEWPLAYERID & DPMSGCMD_NEWPLAYERIDREPLY
74                          barely work. This needs to be completed for sessions to be
75                          able to actually start.
77 A small issue will be the fact that DirectX 6.1(ie. DirectPlay4) introduces a layer of functionality
78 inside the DP objects which provide guaranteed protocol delivery. This is
79 even if the native protocol, IPX or modem for instance, doesn't guarantee it. I'm going to leave
80 this kind of implementation to as close to the end as possible. However, I
81 will implement an abstraction layer, where possible, for this functionality. 
82 It will do nothing to start, but will require only the implementation of the 
83 guaranteness to give final implementation.
86 TODO:
87   - (done) Header files for DP4 and DPL3 
88   - (done) Add stub functions for all DP4 and DPL3 interfaces
89   - (done) Correct naming of the parameters for DP3 and DPL2
90   - (done) Seperate out DP and DPL into multiple .c files
91   - (done) Allow CoCreateInstance to create the new interfaces
92   - (started)Implement mutual exclusion on object data for existing functions
93   - (done) Create and move to correct dll directories (dplay and dplayx)
94   - (done) Implement dplay in terms of dplayx
95   - (done) Need a better internal implementation for the objects which scales and 
96     preferably doesn't involve casting structures. Solution is a crude ctor/dtor
97     which can actually trap some runtime errors.
98   - (done) More generic initialization and destruction helper methods based off
99     the chosen internal implementation. Solution is a crude ctor/dtor.
100   - Use only windows routines where an equivalent is available
101   - (done) Fix wine dplay.h and dplobby.h header files to allow apps to create the ansi versions
102   - (started) Port some WineLib test programs using sdk programs (both C and C++ progs)  
103   - (done) Implement a lib main for the dplayx dll (required for RunApplication, etc.)
104   - (done)Figure out how to share the global memory correctly
105   - Ensure that all dll stubs are present and the ordinals are correct
106   - (started) Implementation of functionality
107   - Addition of DirectX 7.0 functionality for direct play (try to catch that moving train)
108   - bug fixes ;)
109   - Implement some WineLib test programs using sdk programs as a skeleton
110   - (done) Change all RegEnumKey calls to RegEnumKeyEx.
111   - Change RegEnumKeyEx enumeration pattern to allow error handling and to
112     share registry implementation (or at least simplify).
113   - Add in appropriate RegCloseKey calls for all the opening we're doing...
114   - Fix all the buffer sizes for registry calls. They're off by one - but in a safe direction.
115   - (done) Find out how to call the service provider dlls - they don't have a published interface!
116   - Fix race condition on interface destruction
117   - Handles need to be correctly reference counted
118   - Need to check if we need to deallocate any list objects when destroying 
119     dplay interface
120   - RunApplication process spawning needs to have correct syncronization.
121   - Need to get inter lobby messages working.
122   - Decypher dplay messages between applications and implement...
123   - Need to implement lobby session spawning.
125 ENHANCEMENTS:
126   - Improve footprint and realtime blocking by setting up a seperate data share
127     between lobby application and client since there can be multiple apps per 
128     client. Also get rid of offset dependency by making data offset independent 
129     somehow.
130   - Handle everything in UNICODE (as server does) and do conversions for ANSI 
131     interfaces. Should cut down on dplayx code base and maintanability (marginally)
132     and could be used to improve efficiency of dialog with the server (it wouldn't
133     have to do ANSI<->UNICODE transformations).
137 Programs to make work:
138   - lserver.exe (from sdk)
139   - override.exe (from sdk)
140   - dpchat.exe (from sdk)
141   - duel.exe (from sdk)
142   - dplaunch.exe (from sdk)
144 Next API to implement on a per SDK program basis:
145   override.exe
146   - (calls dpserial so basic problems with that remain)
147   - after that ?
149   dplaunch.exe
150   - I think that everything is basically working. The launched app may not
151     work on the other hand.
153   lserver.exe
154   - Missing messaging portion. Everything else works.
156   bellhop.exe
157   - Need to implement lobby server support.
158   - ?
160   dpslots.exe
161   - Works as host except for message stuff
162   - Missing correct handling of receipt of playerid
164 Other TODO:
166 - look at problem with parsing the resource file for dplaunch. wrc problem?
167 - I should be getting the dialog box to come up for dpchat when something is selected
168 Call OLE32.7: CoCreateInstance(010017f0,00000000,00000001,010017e0,010094b4) ret=01002f38 fs=0237
169 Call ADVAPI32.188: RegOpenKeyExA(80000002,5e08dd90 "Software\\Microsoft\\DirectPlay\\Compatibility",00000000,00020019,40e7f49c) ret=5e0b6e5a fs=0237
171    
172 Peter Hunnisett  -  hunnise@nortelnetworks.com