reactos/win32ss/gdi/eng
Oleg Dubinskiy e034377b51
[WIN32SS][ENG][NTDDRAW] Manage DirectDraw instances when switching display mode (#4519)
CORE-17932

[ENG] Implement DirectDraw management in switch display mode functions
(e.g. resolution change, color depth, display frequency etc.):

- Switch DirectDraw instances between the two PDEVs (the current one and
  the new one allocated by ourselves) by calling dxg!DxDdDynamicModeChange
  function.

- Suspend them before and resume after the display mode switch, by calling
  dxg!DxDdsuspendDirectDraw and dxg!DxDdResumeDirectDraw appropriately.

We currently don't have these functions implemented, but MS DXG has, so
it allows to properly manage DirectDraw PDEVs using this driver, similarly
to Windows.
My analysis confirms that these functions are always called in XP/2k3 on
display mode switch, even when there is no any DirectX app running at the
moment. Analyzing their prototypes show that my guesses are correct.

- Initialize hDev and dhpdev members for EDD_DIRECTDRAW_GLOBAL for newly
  created surfaces, switch them during mode change and re-initialize after
  it also. They are commonly used by DirectDraw stack.
  In addition, enable DirectDraw for old and new PDEVs, by calling
  dxg!DxDdEnableDirectDraw function.


[NTDDRAW] Additionally, fix usage of DirectDraw lock count in the PDEVOBJ
structure.

- Enable cDirectDrawDisableLocks member for storing its value, instead of
  DxDd_nCount, which is marked as ROS-specific.

- Use it in win32k!DxEngGet/SetHdevData for getting/setting DirectDraw
  count appropriately.

My analysis also shows that in Windows, the PDEVOBJ::cDirectDrawDisableLocks
method calls DxEngGetHdevData with type 8, which corresponds to our DxDd_nCount.
So there are no doubts that this member is used there.

- Rename DxEngGetHdevData_dd_count alias of type 8 to DxEngGetHdevData_dd_locks,
  to match more accurately an actual member name. Update the enumeration
  and fix all code parts appropriately.

All these changes allow to properly change display mode during executing
DirectDraw applications, when they try to switch in full-screen mode.
At least a bugcheck that happened before my changes, does no longer appear.

There are still some games that don't run correctly, as if there is no
3D acceleration (which actually exists). This requires further investigations.
2023-06-21 18:00:24 +02:00
..
i386 [WIN32K] Fix getting long value from float object 2021-03-31 18:35:31 +02:00
alphablend.c [WIN32K:ENG] EngAlphaBlend(): Release EnterLeaveSource on error (#4560) 2022-07-02 12:30:03 +03:00
bitblt.c [WIN32K] Add StretchBlt function ability to flip images (#3458) 2021-02-21 08:28:36 +09:00
bitblt_new.c [WIN32K] Implement RECTL_bClipRectBySize() and use it in IntEngBitBlt() to clip the target rect against the bounds of the target surface. Also clip the source rect against the source surface. Fixes remaining part of CORE-14463 2018-06-30 16:40:04 +02:00
clip.c
copybits.c [WIN32K] Add StretchBlt function ability to flip images (#3458) 2021-02-21 08:28:36 +09:00
debug.c [FORMATTING] Remove trailing whitespace. Addendum to 34593d93. 2021-09-13 03:52:22 +02:00
device.c [WIN32SS:ENG] Set VGA device as child of primary device 2022-11-15 23:16:10 +01:00
device.h [WIN32SS:ENG] Fix handling of Acceleration.Level parameter (was not read anymore) 2022-06-05 14:49:47 +02:00
driverobj.c [WIN32K:ENG] In EngLockDriverObj, properly return NULL when locking failed 2021-06-09 18:27:12 +02:00
driverobj.h
drvdbg.c
eng.h [WIN32SS][NTUSER] Fix message time (#1259) 2019-04-12 07:56:04 +09:00
engbrush.c [WIN32SS] Introduce the MDEVOBJ structure 2022-04-15 23:09:16 +02:00
engevent.c
engevent.h
engmisc.c
engobjects.h [NTGDI][FREETYPE] lfWidth for GetTextMetrics and GetCharWidth (#4919) 2022-12-01 08:54:39 +09:00
engwindow.c [WIN32SS] 2017-11-18 12:15:45 +01:00
error.c [NTUSER] Add 'Win:' comments to some functions (#4453) 2022-04-17 06:53:37 +09:00
float.c
floatobj.h [FORMATTING] Remove trailing whitespace. Addendum to 34593d93. 2021-09-13 03:52:22 +02:00
gradient.c
inteng.h
ldevobj.c [WIN32SS:ENG] Do not free LDEV if unloading a driver failed 2023-04-16 19:37:05 +02:00
ldevobj.h [WIN32SS] Preparation to load internal drivers (ie entry point in win32k) 2022-04-15 23:09:16 +02:00
lineto.c
mapping.c
mapping.h
math.c
mdevobj.c [WIN32SS:ENG] Fix handling of Acceleration.Level parameter (was not read anymore) 2022-06-05 14:49:47 +02:00
mdevobj.h [WIN32SS] Fix buffer overflow in MDEVOBJ when having more than 10 display devices 2022-04-18 20:01:37 +02:00
mem.c
mouse.c [WIN32SS:ENG] Call display mouse functions only when using hardware pointer 2022-10-11 19:04:59 +02:00
mouse.h
multidisp.c [WIN32SS] Enable multidisplay driver when required 2022-04-15 23:09:16 +02:00
paint.c
pandisp.c [WIN32SS] Implement panning driver 2022-05-14 21:29:12 +02:00
pathobj.c [Win32SS] 2017-10-06 11:54:27 -05:00
pdevobj.c [WIN32SS][ENG][NTDDRAW] Manage DirectDraw instances when switching display mode (#4519) 2023-06-21 18:00:24 +02:00
pdevobj.h [WIN32SS][ENG][NTDDRAW] Manage DirectDraw instances when switching display mode (#4519) 2023-06-21 18:00:24 +02:00
perfcnt.c
rlecomp.c [WIN32SS] Fix RLE4 bitmap decoding (#1188) 2018-12-25 18:04:21 +09:00
semaphor.c
sort.c
stretchblt.c [FORMATTING] Remove trailing whitespace. Addendum to 34593d93. 2021-09-13 03:52:22 +02:00
string.c
stubs.c [WIN32SS] Implement EngQueryDeviceAttribute 2022-04-15 23:09:16 +02:00
surface.c [WIN32SS:ENG] EngCreateBitmap: mark created bitmaps as API bitmaps (#4146) 2021-12-29 16:51:23 +01:00
surface.h Update Headers for Printing and Other 2019-08-15 21:39:26 -05:00
transblt.c
umpdstubs.c [Win32SS] Implement EngCreate/DeletePalette. 2019-09-03 14:36:20 -05:00
xlateobj.c [WIN32K] Fix spelling typo. 2019-06-23 02:12:23 +02:00
xlateobj.h