Index: Help/Doxyfile |
— | — | @@ -693,7 +693,7 @@ |
694 | 694 | # should be searched for input files as well. Possible values are YES and NO. |
695 | 695 | # If left blank NO is used. |
696 | 696 | |
697 | | -RECURSIVE = NO |
| 697 | +RECURSIVE = YES |
698 | 698 | |
699 | 699 | # The EXCLUDE tag can be used to specify files and/or directories that should |
700 | 700 | # excluded from the INPUT source files. This way you can easily exclude a |
— | — | @@ -700,7 +700,7 @@ |
701 | 701 | # subdirectory from a directory tree whose root is specified with the INPUT tag. |
702 | 702 | # Note that relative paths are relative to directory from which doxygen is run. |
703 | 703 | |
704 | | -EXCLUDE = |
| 704 | +EXCLUDE = ../.svn |
705 | 705 | |
706 | 706 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or |
707 | 707 | # directories that are symbolic links (a Unix file system feature) are excluded |
Index: Help/Doxyfile.debug |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | # exceed 55 pixels and the maximum width should not exceed 200 pixels. |
47 | 47 | # Doxygen will copy the logo to the output directory. |
48 | 48 | |
49 | | -PROJECT_LOGO = C:/Programming/Projects/dxgl/common/dxgl.png |
| 49 | +PROJECT_LOGO = ../common/dxgl.png |
50 | 50 | |
51 | 51 | # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) |
52 | 52 | # base path where the generated documentation will be put. |
— | — | @@ -693,7 +693,7 @@ |
694 | 694 | # should be searched for input files as well. Possible values are YES and NO. |
695 | 695 | # If left blank NO is used. |
696 | 696 | |
697 | | -RECURSIVE = NO |
| 697 | +RECURSIVE = YES |
698 | 698 | |
699 | 699 | # The EXCLUDE tag can be used to specify files and/or directories that should |
700 | 700 | # excluded from the INPUT source files. This way you can easily exclude a |
— | — | @@ -700,7 +700,7 @@ |
701 | 701 | # subdirectory from a directory tree whose root is specified with the INPUT tag. |
702 | 702 | # Note that relative paths are relative to directory from which doxygen is run. |
703 | 703 | |
704 | | -EXCLUDE = |
| 704 | +EXCLUDE = ../.svn |
705 | 705 | |
706 | 706 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or |
707 | 707 | # directories that are symbolic links (a Unix file system feature) are excluded |
Index: ddraw/ddraw.cpp |
— | — | @@ -35,6 +35,15 @@ |
36 | 36 | int vsyncstatus;
|
37 | 37 | bool ddenabled = false;
|
38 | 38 |
|
| 39 | +/**
|
| 40 | + * Tests if a pointer is valid for reading from. Compile ion Visual C++ with /EHa
|
| 41 | + * enabled Structed Exception Handling in C++ code, to prevent crashes on invalid
|
| 42 | + * pointers.
|
| 43 | + * @param ptr
|
| 44 | + * Pointer to test for validity.
|
| 45 | + * @return
|
| 46 | + * Returns false if the pointer is valid, or true if an error occurs.
|
| 47 | + */
|
39 | 48 | bool IsBadReadPointer(void *ptr)
|
40 | 49 | {
|
41 | 50 | char a;
|
— | — | @@ -50,37 +59,62 @@ |
51 | 60 | }
|
52 | 61 | }
|
53 | 62 |
|
| 63 | +/// Stub for function found in system ddraw.dll
|
54 | 64 | DDRAW_API void WINAPI AcquireDDThreadLock()
|
55 | 65 | {
|
56 | 66 | // FIXME: Add thread lock
|
57 | 67 | FIXME("AcquireDDThreadLock: stub\n");
|
58 | 68 | }
|
| 69 | +
|
| 70 | +/// Stub for function found in system ddraw.dll
|
59 | 71 | DDRAW_API void WINAPI CompleteCreateSystemSurface()
|
60 | 72 | {
|
61 | 73 | FIXME("CompleteCreateSystemSurface: stub\n");
|
62 | 74 | }
|
| 75 | +
|
| 76 | +/// Stub for function found in system ddraw.dll
|
63 | 77 | DDRAW_API void WINAPI D3DParseUnknownCommand()
|
64 | 78 | {
|
65 | 79 | FIXME("D3DParseUnknownCommand: stub\n");
|
66 | 80 | }
|
| 81 | +
|
| 82 | +/// Stub for function found in system ddraw.dll
|
67 | 83 | DDRAW_API void WINAPI DDGetAttachedSurfaceLcl()
|
68 | 84 | {
|
69 | 85 | FIXME("DDGetAttachedSurfaceLcl: stub\n");
|
70 | 86 | }
|
| 87 | +
|
| 88 | +/// Stub for function found in system ddraw.dll
|
71 | 89 | DDRAW_API void WINAPI DDInternalLock()
|
72 | 90 | {
|
73 | 91 | //FIXME: Add locking code
|
74 | 92 | FIXME("DDInternalLock: stub\n");
|
75 | 93 | }
|
| 94 | +
|
| 95 | +/// Stub for function found in system ddraw.dll
|
76 | 96 | DDRAW_API void WINAPI DDInternalUnlock()
|
77 | 97 | {
|
78 | 98 | //FIXME: Add unlocking code
|
79 | 99 | FIXME("DDInternalUnlock: stub\n");
|
80 | 100 | }
|
| 101 | +
|
| 102 | +/// Stub for function found in system ddraw.dll
|
81 | 103 | DDRAW_API void WINAPI DSoundHelp()
|
82 | 104 | {
|
83 | 105 | FIXME("DSoundHelp: stub\n");
|
84 | 106 | }
|
| 107 | +
|
| 108 | +/**
|
| 109 | + * This function is used by DirectDrawCreate to test if opengl32.dll is calling
|
| 110 | + * these functions. If so, DirectDrawCreate will load the system ddraw.dll and
|
| 111 | + * call its DirectDrawCreate function.
|
| 112 | + * @param returnaddress
|
| 113 | + * The address to evaluate whether it is from opengl32.dll or not.
|
| 114 | + * The return address of the calling function may be obtained with the
|
| 115 | + * _ReturnAddress() function.
|
| 116 | + * @return
|
| 117 | + * Returns nonzero if the address points to opengl32.dll, otherwise returns zero.
|
| 118 | + */
|
85 | 119 | int IsCallerOpenGL(void *returnaddress)
|
86 | 120 | {
|
87 | 121 | int isgl = 0;
|
— | — | @@ -100,6 +134,22 @@ |
101 | 135 | CloseHandle(hSnapshot);
|
102 | 136 | return isgl;
|
103 | 137 | }
|
| 138 | +
|
| 139 | +/**
|
| 140 | + * Creates an IDirectDraw compatible interface to the DXGL graphics library.
|
| 141 | + * @param lpGUID
|
| 142 | + * Address to the GUID of the device to be created, or NULL for the current
|
| 143 | + * display. Currently, only NULL is supported.
|
| 144 | + * @param lplpDD
|
| 145 | + * Pointer to an address to be filled with an IDirectDraw compatible interface.
|
| 146 | + * To retreive a pointer to a later DirectDraw or Direct3D interface, call the
|
| 147 | + * QueryInterface method in the returned object.
|
| 148 | + * @param pUnkOuter
|
| 149 | + * Unused, should be NULL.
|
| 150 | + * @return
|
| 151 | + * Returns DD_OK if lplpDD points to an IDirectDraw pointer, or an error code
|
| 152 | + * otherwise.
|
| 153 | + */
|
104 | 154 | HRESULT WINAPI DirectDrawCreate(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter)
|
105 | 155 | {
|
106 | 156 | if(gllock || IsCallerOpenGL(_ReturnAddress()))
|
— | — | @@ -137,11 +187,43 @@ |
138 | 188 | *lplpDD = (LPDIRECTDRAW)myddraw;
|
139 | 189 | return error;
|
140 | 190 | }
|
| 191 | +
|
| 192 | +/**
|
| 193 | + * Creates an IDirectDrawClipper compatible interface.
|
| 194 | + * @param dwFlags
|
| 195 | + * Unused, set to 0.
|
| 196 | + * @param lplpDD
|
| 197 | + * Pointer to an address to be filled with an IDirectDrawClipper compatible
|
| 198 | + * interface.
|
| 199 | + * @param pUnkOuter
|
| 200 | + * Unused, should be NULL.
|
| 201 | + * @return
|
| 202 | + * Returns DD_OK if lplpDD points to an IDirectDrawClipper pointer, or an error
|
| 203 | + * code otherwise.
|
| 204 | + */
|
141 | 205 | HRESULT WINAPI DirectDrawCreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
|
142 | 206 | {
|
143 | 207 | *lplpDDClipper = new glDirectDrawClipper(dwFlags,NULL);
|
144 | 208 | return DD_OK;
|
145 | 209 | }
|
| 210 | +
|
| 211 | +/**
|
| 212 | + * Creates an IDirectDraw7 compatible interface to the DXGL graphics library.
|
| 213 | + * @param lpGUID
|
| 214 | + * Address to the GUID of the device to be created, or NULL for the current
|
| 215 | + * display. Currently, only NULL is supported.
|
| 216 | + * @param lplpDD
|
| 217 | + * Pointer to an address to be filled with an IDirectDraw7 compatible interface.
|
| 218 | + * To retreive a pointer to a later DirectDraw or Direct3D interface, call the
|
| 219 | + * QueryInterface method in the returned object.
|
| 220 | + * @param iid
|
| 221 | + * Must be set to IID_IDirectDraw7
|
| 222 | + * @param pUnkOuter
|
| 223 | + * Unused, should be NULL.
|
| 224 | + * @return
|
| 225 | + * Returns DD_OK if lplpDD points to an IDirectDraw7 pointer, or an error code
|
| 226 | + * otherwise.
|
| 227 | + */
|
146 | 228 | HRESULT WINAPI DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter)
|
147 | 229 | {
|
148 | 230 | if(ddenabled) return DDERR_DIRECTDRAWALREADYCREATED;
|
— | — | @@ -148,7 +230,7 @@ |
149 | 231 | GetCurrentConfig(&dxglcfg);
|
150 | 232 | glDirectDraw7 *myddraw;
|
151 | 233 | HRESULT error;
|
152 | | - if(iid != IID_IDirectDraw7) ERR(DDERR_UNSUPPORTED);
|
| 234 | + if(iid != IID_IDirectDraw7) ERR(DDERR_INVALIDPARAMS);
|
153 | 235 | myddraw = new glDirectDraw7(lpGUID,pUnkOuter);
|
154 | 236 | error = myddraw->err();
|
155 | 237 | if(error != DD_OK)
|
— | — | @@ -161,6 +243,7 @@ |
162 | 244 | return error;
|
163 | 245 | }
|
164 | 246 |
|
| 247 | +/// Callback wrapper for DirectDrawEnumerateA
|
165 | 248 | BOOL WINAPI DDEnumA(GUID FAR *guid, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext, HMONITOR hMonitor)
|
166 | 249 | {
|
167 | 250 | int *context = (int *)lpContext;
|
— | — | @@ -168,6 +251,17 @@ |
169 | 252 | return callback(guid,lpDriverDescription,lpDriverName,(LPVOID)context[1]);
|
170 | 253 | }
|
171 | 254 |
|
| 255 | +/**
|
| 256 | + * Enumerates the available device GUIDs for DXGL, ANSI character format.
|
| 257 | + * Legacy call, uses DirectDrawEnumerateExA
|
| 258 | + * @param lpCallback
|
| 259 | + * Address of the function to call for each enumerated object.
|
| 260 | + * @param lpContext
|
| 261 | + * Pointer to be passed to the callback function.
|
| 262 | + * @return
|
| 263 | + * Returns DD_OK if the call succeeds, or DDERR_INVALIDPARAMS if lpCallback
|
| 264 | + * is invalid.
|
| 265 | + */
|
172 | 266 | HRESULT WINAPI DirectDrawEnumerateA(LPDDENUMCALLBACKA lpCallback, LPVOID lpContext)
|
173 | 267 | {
|
174 | 268 | if(IsBadReadPointer(lpCallback)) return DDERR_INVALIDPARAMS;
|
— | — | @@ -177,6 +271,7 @@ |
178 | 272 | return DirectDrawEnumerateExA(DDEnumA,&context,0);
|
179 | 273 | }
|
180 | 274 |
|
| 275 | +/// Callback wrapper for DirectDrawEnumerateW
|
181 | 276 | BOOL WINAPI DDEnumW(GUID FAR *guid, LPWSTR lpDriverDescription, LPWSTR lpDriverName, LPVOID lpContext, HMONITOR hMonitor)
|
182 | 277 | {
|
183 | 278 | int *context = (int *)lpContext;
|
— | — | @@ -184,6 +279,17 @@ |
185 | 280 | return callback(guid,lpDriverDescription,lpDriverName,(LPVOID)context[1]);
|
186 | 281 | }
|
187 | 282 |
|
| 283 | +/**
|
| 284 | + * Enumerates the available device GUIDs for DXGL, Unicode character format.
|
| 285 | + * Legacy call, uses DirectDrawEnumerateExW
|
| 286 | + * @param lpCallback
|
| 287 | + * Address of the function to call for each enumerated object.
|
| 288 | + * @param lpContext
|
| 289 | + * Pointer to be passed to the callback function.
|
| 290 | + * @return
|
| 291 | + * Returns DD_OK if the call succeeds, or DDERR_INVALIDPARAMS if lpCallback
|
| 292 | + * is invalid.
|
| 293 | + */
|
188 | 294 | HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW lpCallback, LPVOID lpContext)
|
189 | 295 | {
|
190 | 296 | if(IsBadReadPointer(lpCallback)) return DDERR_INVALIDPARAMS;
|
— | — | @@ -193,6 +299,8 @@ |
194 | 300 | return DirectDrawEnumerateExW(DDEnumW,&context,0);
|
195 | 301 | }
|
196 | 302 |
|
| 303 | +/// Callback wrapper for DirectDrawEnumerateExA
|
| 304 | +/// Converts Unicode strings to ANSI.
|
197 | 305 | BOOL WINAPI DDEnumExA(GUID FAR *guid, LPWSTR lpDriverDescription, LPWSTR lpDriverName, LPVOID lpContext, HMONITOR hMonitor)
|
198 | 306 | {
|
199 | 307 | int *context = (int *)lpContext;
|
— | — | @@ -204,6 +312,20 @@ |
205 | 313 | return callback(guid,desc,driver,(LPVOID)context[1],hMonitor);
|
206 | 314 | }
|
207 | 315 |
|
| 316 | +/**
|
| 317 | + * Enumerates the available device GUIDs for DXGL, ANSI character format.
|
| 318 | + * Uses DirectDrawEnumerateExW
|
| 319 | + * @param lpCallback
|
| 320 | + * Address of the function to call for each enumerated object.
|
| 321 | + * @param lpContext
|
| 322 | + * Pointer to be passed to the callback function.
|
| 323 | + * @param dwFlags
|
| 324 | + * Use DDENUM_ATTACHEDSECONDARYDEVICES to enumerate display devices attached
|
| 325 | + * to the system.
|
| 326 | + * @return
|
| 327 | + * Returns DD_OK if the call succeeds, or DDERR_INVALIDPARAMS if lpCallback
|
| 328 | + * is invalid.
|
| 329 | + */
|
208 | 330 | HRESULT WINAPI DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags)
|
209 | 331 | {
|
210 | 332 | if(IsBadReadPointer(lpCallback)) return DDERR_INVALIDPARAMS;
|
— | — | @@ -213,6 +335,14 @@ |
214 | 336 | return DirectDrawEnumerateExW(DDEnumExA,&context,dwFlags);
|
215 | 337 | }
|
216 | 338 |
|
| 339 | +/**
|
| 340 | + * Callback for EnumDisplayMonitors.
|
| 341 | + * @param hMonitor
|
| 342 | + * Handle to display device found by EnumDisplayMonitors.
|
| 343 | + * @param ptr
|
| 344 | + * Pointer to list of display devices. First value is the number of devices
|
| 345 | + * found so far. Subsequent values are stored display device handles.
|
| 346 | + */
|
217 | 347 | BOOL CALLBACK MonitorEnum(HMONITOR hMonitor, HDC unused, LPRECT unused2, LPARAM ptr)
|
218 | 348 | {
|
219 | 349 | int * monitors = *(int**)ptr;
|
— | — | @@ -228,6 +358,19 @@ |
229 | 359 | return TRUE;
|
230 | 360 | }
|
231 | 361 |
|
| 362 | +/**
|
| 363 | + * Enumerates the available device GUIDs for DXGL, Unicode character format.
|
| 364 | + * @param lpCallback
|
| 365 | + * Address of the function to call for each enumerated object.
|
| 366 | + * @param lpContext
|
| 367 | + * Pointer to be passed to the callback function.
|
| 368 | + * @param dwFlags
|
| 369 | + * Use DDENUM_ATTACHEDSECONDARYDEVICES to enumerate display devices attached
|
| 370 | + * to the system.
|
| 371 | + * @return
|
| 372 | + * Returns DD_OK if the call succeeds, or DDERR_INVALIDPARAMS if lpCallback
|
| 373 | + * is invalid.
|
| 374 | + */
|
232 | 375 | HRESULT WINAPI DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags)
|
233 | 376 | {
|
234 | 377 | if(IsBadReadPointer(lpCallback)) return DDERR_INVALIDPARAMS;
|
— | — | @@ -253,10 +396,30 @@ |
254 | 397 | }
|
255 | 398 | return DD_OK;
|
256 | 399 | }
|
| 400 | +
|
| 401 | +/**
|
| 402 | + * Tells the operating system whether it can unload the DLL.
|
| 403 | + * @return
|
| 404 | + * Currently returns S_FALSE, preventing the operating system from unloading
|
| 405 | + * the DLL until the application terminates.
|
| 406 | + */
|
257 | 407 | HRESULT WINAPI DllCanUnloadNow()
|
258 | 408 | {
|
259 | 409 | return S_FALSE;
|
260 | 410 | }
|
| 411 | +
|
| 412 | +/**
|
| 413 | + * Creates an IClassFactory object to retrieve a DirectDraw object using COM.
|
| 414 | + * @param rclsid
|
| 415 | + * Must be one of the following: CLSID_DirectDraw, CLSID_DirectDraw7, or
|
| 416 | + * CLSID_DirectDrawClipper
|
| 417 | + * @param riid
|
| 418 | + * Must be IID_IUnknown or IID_IClassFactory.
|
| 419 | + * @param ppv
|
| 420 | + * Pointer to an address to the IClassFactory object created by this call.
|
| 421 | + * @return
|
| 422 | + * Returns S_OK if the call succeeds, or an error otherwise.
|
| 423 | + */
|
261 | 424 | HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
262 | 425 | {
|
263 | 426 | if((rclsid != CLSID_DirectDraw) && (rclsid != CLSID_DirectDraw7) &&
|
— | — | @@ -268,32 +431,48 @@ |
269 | 432 | factory->Release();
|
270 | 433 | return result;
|
271 | 434 | }
|
| 435 | +
|
| 436 | +/// Stub for function found in system ddraw.dll
|
272 | 437 | DDRAW_API void WINAPI GetDDSurfaceLocal()
|
273 | 438 | {
|
274 | 439 | FIXME("GetDDSurfaceLocal: stub\n");
|
275 | 440 | }
|
| 441 | +
|
| 442 | +/// Stub for function found in system ddraw.dll
|
| 443 | +/// This function gets called by the fnddraw.exe test application.
|
276 | 444 | DDRAW_API HANDLE WINAPI GetOLEThunkData(int i1)
|
277 | 445 | {
|
278 | 446 | DEBUG("GetOleThunkData: stub\n");
|
279 | 447 | return 0;
|
280 | 448 | }
|
| 449 | +
|
| 450 | +/// Stub for function found in system ddraw.dll
|
| 451 | +/// Function import is GetSurfaceFromDC
|
281 | 452 | DDRAW_API HRESULT WINAPI GlobalGetSurfaceFromDC(LPDIRECTDRAW7 lpDD, HDC hdc, LPDIRECTDRAWSURFACE7 *lpDDS)
|
282 | 453 | {
|
283 | 454 | FIXME("GetSurfaceFromDC: Verify proper referencing for LPDIRECTDRAW7\n");
|
284 | 455 | return lpDD->GetSurfaceFromDC(hdc,lpDDS);
|
285 | 456 | }
|
| 457 | +
|
| 458 | +/// Stub for function found in system ddraw.dll
|
286 | 459 | DDRAW_API void WINAPI RegisterSpecialCase()
|
287 | 460 | {
|
288 | 461 | FIXME("RegisterSpecialCase: stub\n");
|
289 | 462 | }
|
| 463 | +
|
| 464 | +/// Stub for function found in system ddraw.dll
|
290 | 465 | DDRAW_API void WINAPI ReleaseDDThreadLock()
|
291 | 466 | {
|
292 | 467 | FIXME("ReleaseDDThreadLock: stub\n");
|
293 | 468 | }
|
| 469 | +
|
| 470 | +/// Stub for function found in system ddraw.dll
|
294 | 471 | DDRAW_API void WINAPI SetAppCompatData()
|
295 | 472 | {
|
296 | 473 | FIXME("SetAppCompatData: stub\n");
|
297 | 474 | }
|
| 475 | +
|
| 476 | +/// Stub for function found in system ddraw.dll
|
298 | 477 | DDRAW_API BOOL IsDXGLDDraw()
|
299 | 478 | {
|
300 | 479 | return TRUE;
|