Commit graph

22 commits

Author SHA1 Message Date
Thamatip Chitpong e0c17c3f46
[DXG] Don't repeat "DXG" module name in version info 2023-12-01 08:23:13 +07:00
Hermès Bélusca-Maïto 0e88f0485c
[PSDK][WIN32SS] Fix WINNT in ddraw.h; remove NT_BUILD_ENVIRONMENT usage
Keep compatibility with MS PSDK ddraw.h file by using WINNT instead of
_WINNT_ in the preprocessor conditional test.
Incidentally this allows also removing those #define NT_BUILD_ENVIRONMENT
in the win32ss modules.

See commit 5fcfaf2e1 (r42346).
2023-11-22 15:46:06 +01:00
Hermès Bélusca-Maïto f5563ad22c
[WIN32SS:REACTX] Remove INTERNAL_CALL, deprecated since commit 24abf1b22 (r53467) 2023-11-22 15:46:05 +01:00
Serge Gautherie 24757e30e9
[NTDDRAW][NTGDI][VGADDI] Add missing \n to DPRINT() calls (#5952)
Add missing \n to DPRINT() calls and demote some DPRINT1().
2023-11-15 21:07:27 +01:00
Oleg Dubinskiy f4d7cccd3c
[DXGTHK] Export DriverEntry (#5607)
Export driver entry point function DriverEntry from our dxgthk.sys,
following Windows behaviur. It is exported on XP SP3 and Server 2003.
2023-09-21 14:25:21 +03:00
Oleg Dubinskiy a4b0899ca1
[DXGTHK] Fix EngCreateBitmap exported parameters (#5606)
Use two longs instead of one for the first parameter of EngCreateBitmap export. Make it same as win32k export.
MSDN documentation says that 1st parameter is SIZEL (SIZE) structure, which actually contains 2 longs inside. Sice it is passed by value, it needs to take enough memory when export in dxgthk and redirect to win32k (since it's actually a win32k function).
Fixes the compilation of our dxg.sys when calling dxgthk!EngCreateBitmap from it.
Found during my DirectX investigations.
2023-08-23 17:53:22 +02:00
Andriy Shevchenko 2ea03b5b22
[REACTOS] Fix typos in comments (#5591)
Fixing typos in code comments enhances code readability and comprehension for developers and collaborators.
2023-08-22 16:20:29 +03:00
Oleg Dubinskiy e7ccb36b9b
[WIN32SS][NTDDRAW] Don't startup DirectX graphics each time on DirectDraw object creation (#5329)
CORE-17561, CORE-17932, CORE-18221

Do it at each system startup instead: Remove old DirectX initialization code.
It's now outdated and not needed anymore.

Previously, the corresponding hackish intEnableReactXDriver() function
did two things: load dxg.sys and enable DirectDraw.
Now loading DirectX graphics is done during WINSRV initialization, and
enabling DirectDraw is called during each (and also first) display mode
switch, as in Windows. As debug analysis proves, there are no any other
calls in NtGdiDdCreateDirectDrawObject, besides the corresponding DXG
function.
2023-06-21 18:03:27 +02:00
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
Oleg Dubinskiy 31139c253f
[WIN32SS][NTDDRAW][NTGDI] Implement some DxEng* callbacks (#3638)
Implement the following DxEng* functions:
- DxEngAltLockSurface
- DxEngDeleteSurface
- DxEngReferenceHdev
- DxEngSelectBitmap
- DxEngSetBitmapOwner
- DxEngUnreferenceHdev

Update their prototypes and call the appropriate win32k functions
inside them, since they are already implemented. Also get rid of
now unused IntGdi(Un)ReferencePdev, whose were called only by dxeng,
and whose are not used anymore. In Windows, DxEng(Un)ReferenceHdev calls
PDEVOBJ_vReferencePDEV and PDEVOBJ_vDeferencePDEV directly (those
correspond to our PDEVOBJ_vReference and PDEVOBJ_vRelease accordingly).

Required by MS DirectDraw stack (ddraw.dll & dxg.sys). CORE-17561
2022-06-01 00:58:35 +03:00
Oleg Dubinskiy 5d81de7d5b
[REACTOS] Update email in all my copyrights (#4415)
Change it to Gmail, because Yandex disabled ua domain, which was used in my previous email.
2022-03-31 01:53:30 +02:00
Hermès Bélusca-Maïto 5e93daa9ce
[WIN32SS] Use the DCFLAGS and DCTYPE flags defined in ntgdi/dc.h instead of the old ones in include/ntgdihdl.h
The names of these new flags match the documented ones at
https://reactos.org/wiki/Techwiki:Win32k/DC
https://books.google.hr/books?id=-O92IIF1Bj4C&pg=PA197&lpg=PA197
and the gdikdx debug extension.
2022-03-19 17:26:09 +01:00
Oleg Dubinskiy 8a6312abda
[WIN32SS][NTDDRAW] Improve DxEngGetDCState type 2 implementation (#4176)
- Use the REGION_Complexity() function to get the actual region complexity instead of just number of rectangles.
- Don't use prgnRao at all, because it is always uninitialized when passed to the function. So in condition between prgnRao and prgnVis, the 2nd one always succeeds.
- Update the comment accordingly.
- Additionally, add a DPRINT to the end of the function, which displays the returned value.

This allows to properly enable and use DirectDraw and Direct3D hardware acceleration with the following MS DirectX components: ddraw.dll, d3d8.dll, d3d9.dll and dxg.sys. As in VM, same on real hardware.
But note that now the bugcheck 0x50 (PAGE_FAULT_IN_NONPAGED_AREA) occurs when executing fullscreen DDraw apps, after switching display mode. It's unhidden by this fix.
Addendum to 855bf46.
CORE-17561
2021-12-20 21:27:13 +01:00
Oleg Dubinskiy 855bf46399
[WIN32SS][NTDDRAW] Get complexity of visible region in DxEngGetDCState (#2604)
CORE-7733

Get the complexity of visible region in the DxEngGetDCState() function, according to its remarks.
This implementation returns a number of rectangles that make up the region, similarly to as it done in REGION_Complexity() function:
https://git.reactos.org/?p=reactos.git;a=blob;f=win32ss/gdi/ntgdi/region.c;h=38bf3d377fa805e9db8768774c4fc473590252d0;hb=HEAD#l573 
It is required by MS ddraw.dll when calling win32k/dxg functions during launching DirectDraw test or any DirectX 1 - 7 apps/games.
2020-05-01 15:57:11 +02:00
Jérôme Gardou 23373acbb9 [CMAKE] Use modules instead of shared libraries
There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.

On my system, this reduces the configure-time by a factor of two.
2019-04-06 17:43:38 +02:00
Hervé Poussineau 0c4d21a5a1 Revert "[DXG] Define GUIDs only once", to fix MSVC build
This reverts commit 3a78dd4b31.
2019-04-01 18:00:59 +02:00
Hervé Poussineau 3a78dd4b31 [DXG] Define GUIDs only once 2019-04-01 11:38:32 +02:00
Timo Kreuzer 2620930066 [DXG] Fix 64 bit build 2019-03-04 21:58:42 +01:00
Timo Kreuzer 2a5e2a2ab6 [REACTX] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
Joachim Henze 14f0e62f9a [WIN32SS][NTDDRAW] Fix ddraw palette regression CORE-13714
This nice patch of Jerome Gardou improves palette
when VBEMP & inbuilt Mesa is used for
Diablo II, MS Age Of Empires 1, Anno 1602
to the state we had in SVN r75060 and below.

We already committed this fix into 0.4.8-release before.
2018-04-11 15:39:54 +02:00
Serge Gautherie b789161199
[DXG] Fix a Clang-Cl warning about DDHAL_CB32_CANCREATESURFACE
"warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]"

CORE-14306
2018-02-10 18:04:05 +01:00
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00