Commit graph

192 commits

Author SHA1 Message Date
jimtabor 2903022199 [NtGDI] Use Vis Region for New Clip Region
Interesting results while using VBOX-GA.
Rolling back to Vis, wine throwback. See CORE-16680.
2020-02-09 11:28:19 -06:00
Mark Jansen 53c9a6deaa
[WIN32K] Don't trust the BITMAPINFOHEADER size
This is not entirely correct yet, but less wrong than before
CORE-16621
2020-01-26 13:08:53 +01:00
James Tabor 4927905eeb [NtGdi] Fix clip region merging.
Use a new region while merging from the original. See CORE-16626.
2020-01-20 12:49:11 -06:00
Thomas Faber 5b83d86af5
[WIN32K:NTGDI] Add missing probe to NtGdiGetPath. 2020-01-03 11:21:24 +01:00
Thomas Faber f0d2bd3852
[WIN32K:NTGDI] Avoid breakpoints in syscalls. 2020-01-03 11:21:21 +01:00
Katayama Hirofumi MZ fb7ac93dd1
[WIN32SS][NTGDI][FREETYPE] Add ASSERT(pOS2); to FillTM (#2170)
I had used a static analyzer cppcheck to improve the code. This analyzer suggested NULL check for this code.
2019-12-25 18:27:44 +09:00
Katayama Hirofumi MZ dae1f8d716 [WIN32SS][FREETYPE][NTGDI] Clarify calculation precedence for '&' and '?' 2019-12-24 13:48:33 +09:00
jimtabor 5214a38fd0 [Win32SS] Fix Opaque Text Fade while in Desktop Startup
See CORE-16498.
2019-12-09 11:18:32 -06:00
Hermès Bélusca-Maïto 0ad65796bb
[WIN32K][VIDEOPRT] Improve initialization and interfacing with INBV.
CORE-12149

VIDEOPRT:
=========

Improve interfacing with INBV, so as to detect when an external module
acquired INBV display ownership, and whether ownership is being released
later on. (This does NOT rely on hooking!)

For this purpose we improve the IntVideoPortResetDisplayParameters(Ex)
callback that gets registered with an InbvNotifyDisplayOwnershipLost()
call during initialization, and we add a monitoring thread.

The callback is called whenever an external module calls
InbvAcquireDisplayOwnership(), for example the bugcheck code or the KDBG
debugger in SCREEN mode. When this happens, a flag that tells the
monitoring thread to start monitoring INBV is set (ReactOS-specific),
and the display adapters get reset with HwResetHw() (as done on Windows).

Due to the fact that this INBV callback can be called at *ANY* IRQL, we
cannot use dispatcher synchronization mechanisms such as events to tell
the INBV monitoring thread to start its operations, so we need to rely
instead on a flag to be set. And, since INBV doesn't provide with any
proper callback/notification system either, we need to actively monitor
its state by pooling. To reduce the load on the system the monitoring
thread performs 1-second waits between each check for the flag set by
the INBV callback, and during checking the INBV ownership status.

When the INBV ownership is detected to be released by an external module,
the INBV callback is re-registered (this is *MANDATORY* since the
external module has called InbvNotifyDisplayOwnershipLost() with a
different callback parameter!), and then we callout to Win32k for
re-enabling the display.

This has the virtue of correctly resetting the display once the KDBG
debugger in SCREEN mode is being exited, and fixes CORE-12149 .

The following additional fixes were needed:

VIDEOPRT & WIN32K:
==================

Remove the registration with INBV that was previously done in a ReactOS-
specific hacked IRP_MJ_WRITE call; it is now done correctly during the
video device opening done by EngpRegisterGraphicsDevice() in the VIDEOPRT's
IRP_MJ_CREATE handler, as done on Windows.

WIN32K:
=======

- Stub the VideoPortCallout() support, for VIDEOPRT -> WIN32 callbacks.
  This function gets registered with VIDEOPRT through an
  IOCTL_VIDEO_INIT_WIN32K_CALLBACKS call in EngpRegisterGraphicsDevice().

- Only partially implement the 'VideoFindAdapterCallout' case, that just
  re-enables the primary display by refreshing it (using the new function
  UserRefreshDisplay()).

VIDEOPRT:
=========

- PVIDEO_WIN32K_CALLOUT is an NTAPI (stdcall) callback.

- In the IntVideoPortResetDisplayParameters(Ex) callback, reset all the
  "resettable" adapters registered in the HwResetAdaptersList list.
  We thus get rid of the global ResetDisplayParametersDeviceExtension.

- Make the IntVideoPortResetDisplayParameters(Ex) callback slightly more
  robust (using SEH) against potential HwResetListEntry list corruption
  or invalid DriverExtension->InitializationData.HwResetHw() that would
  otherwise trigger a BSOD, and this would be disastrous since that
  callback is precisely called when INBV is acquired, typically when the
  BSOD code initializes the display for displaying its information...

Extras:
- Validate the IrpStack->MajorFunction in IntVideoPortDispatchDeviceControl()
  and implement IRP_MJ_SHUTDOWN handling. Stub out the other IOCTLs that
  are handled by VIDEOPRT only (and not by the miniports).

- VIDEOPRT doesn't require IRP_MJ_INTERNAL_DEVICE_CONTROL (unused).

- Implement IOCTL_VIDEO_PREPARE_FOR_EARECOVERY that just resets the
  display to standard VGA 80x25 text mode.
2019-12-02 02:33:20 +01:00
Hermès Bélusca-Maïto 148e137b42
[WIN32K] Add some validity checks in PDEVOBJ_vReference() and use it instead of explicitly manipulating ppdev->cPdevRefs. 2019-11-25 00:41:51 +01:00
Hermès Bélusca-Maïto acf689a973
[WIN32K] Use RtlString* routines. 2019-11-25 00:41:49 +01:00
Hermès Bélusca-Maïto 0ad90f83d3
[WIN32K] Code formatting. 2019-11-25 00:41:49 +01:00
Katayama Hirofumi MZ ebfb62b420 [NTGDI][FONT] Delete FillTMEx function and simplify codes 2019-11-21 17:01:25 +09:00
Katayama Hirofumi MZ f8821421a4
[NTGDI][FONT] Don't rely FT_FaceRec.style_name (#2064)
- Delete ItalicFromStyle and WeightFromStyle functions.
- Don't use FT_FaceRec.style_name for font style but pOS2->fsSelection, pOS2->usWeightClass, WinFNT.italic and WinFNT.weight.
- Don't use the bitmap glyph as possible if the glyph will be oblique'd.
- Tahoma Italic is working!
CORE-9614
2019-11-20 22:49:51 +09:00
Katayama Hirofumi MZ 6fc6e3c398 [WIN32SS][NTGDI] Unite duplicate of condition 'UsesSource' 2019-10-22 09:33:32 +09:00
Katayama Hirofumi MZ 1bf982ff88 [WIN32SS][NTGDI] 'otm' is always non-NULL in epilogue 2019-10-22 09:29:15 +09:00
jimtabor 333b8f19a4 [GDI32] Update Gdi Driver Header.
Patch by : Akihiro Sagawa : Implement GetCharWidthInfo().

1128587fd2
2019-10-18 23:49:13 -05:00
Katayama Hirofumi MZ b81f9b0842
[WIN32SS][FONT] Fix registry-based management (#1879)
CORE-16269
- Fix and improve registry-based font entry management.
- Append style name to registry value name.
- Make some DPRINT DPRINT1 (noisy).
2019-09-10 20:39:52 +09:00
jimtabor 6f353f7747 [Win32SS|Eng] Update stubs.
These functions are no longer support for UMPD.
2019-09-04 13:09:34 -05:00
jimtabor 3ca67d97e2 [Win32SS] Fix safe pointer and define type. 2019-09-03 15:02:46 -05:00
jimtabor c698eff041 [Win32SS] Implement EngCreate/DeletePalette.
Safe to be called from user side without UMPD support.
2019-09-03 14:36:20 -05:00
James Tabor d48345a0ee Update Headers for Printing and Other
Add missing flags and function types. Fix typos.
2019-08-15 21:39:26 -05:00
Katayama Hirofumi MZ 2b526bceac
[WIN32SS][NTGDI] Registry-based font management (#1816)
CORE-16269
- Add IntGdiAddFontResourceEx function that is extended from IntGdiAddFontResource, in order to add dwFlags parameter.
- Add IntLoadFontsInRegistry function that will load the fonts from registry info.
- If loading from registry failed, IntLoadSystemFonts will be called.
- Use IntLoadFontsInRegistry rather than IntLoadSystemFonts in the OS startup.
- Add NameFromCharSet function.
- Append " (CharSetName)" to registry value name if not TrueType.
2019-08-10 14:52:09 +09:00
Doug Lyons c1ec0d92e2
[WIN32K:NTGDI] Fix ASSERTS in REGION_bXformRgn. CORE-15992 2019-08-07 07:47:47 +02:00
Katayama Hirofumi MZ 9cd11eb103
[WIN32SS][NTGDI] Fix condition of bold emulation (#1787)
- Define EMUBOLD_NEEDED macro to determine the condition of bold emuration necessity.
- Use this macro.
- Loose the condition.
2019-08-04 15:15:52 +09:00
Mark Jansen c057a07d79
[WIN32SS] Improve font loading failure logging 2019-08-04 01:55:18 +02:00
Mark Jansen 35dc022e14
[WIN32SS] Only access a font face if it was actually loaded 2019-08-04 00:41:12 +02:00
Katayama Hirofumi MZ 7547757892
[WIN32SS][NTGDI] Improve IntGetOutlineTextMetrics (#1760)
Improve size checking of IntGetOutlineTextMetrics function.
2019-08-02 20:28:30 +09:00
Katayama Hirofumi MZ 6642dbc470
[WIN32SS][NTGDI][NTUSER] Make gusLanguageID USHORT (#1776)
Every language ID is an unsigned integer.

- Make gusLanguageID unsigned.
- Make the return value type of UserGetLanguageID unsigned.
2019-07-31 22:24:01 +09:00
Katayama Hirofumi MZ 7c9755b47d
[WIN32SS][NTGDI] Fix and improve font dumping (#1768)
Fix and improve font dumping. CORE-16245
- FontGDI->FontObj is not a pointer.
- "%s" does null check, so we remove redundant null checks.
- Add FaceName and StyleName dumping.
2019-07-30 18:15:56 +09:00
jimtabor 02db01f3a6 [NtGDI] Fix one size region test.
See CORE-16246, the clip region may be the same size but more complex
than the callers simple region.
2019-07-29 13:02:07 -05:00
jimtabor 665871527b [GDI32] Allow functions to access printing support.
Reapplying lost committed code.
2019-07-27 14:15:42 -05:00
jimtabor 4563ca28d3 [GDI32] Add more to Local DC structure.
Make the two structures identical. These are used for printing and
enhanced metafile support.
2019-07-27 14:13:14 -05:00
Joachim Henze 64e182e429 [WIN32SS] Addendum to font alignment CORE-16133
addendum to 0.4.13-dev-707-g
0e4db883e5

Jim Tabor intended to structurally use flTextAlign over
lTextAlign internally within IntExtTextOutW().
He initially committed these changes in 0.4.12-dev-805-g
3377fe184e

But we unintentionally lost these changes via 0.4.13-dev-370-g
8f482af0a8

Many thanks to Doug Lyons who helped a lot with fixing CORE-16133.
2019-07-27 10:00:42 +02:00
Katayama Hirofumi MZ 0e4db883e5 [WIN32SS][NTGDI] text/font vertical alignment patch CORE-16133
Based on Doug Lyons' patch. It partially fix CORE-16246 and CORE-16133.
Selection area is not fixed yet.
2019-07-26 19:13:00 +09:00
Katayama Hirofumi MZ 31d616ff73
[WIN32SS][GDI] Assume pso->sizlBitmap.cy positiveness (#1743)
We assume pso->sizlBitmap.cy is positive. CORE-15995

Because pso->sizlBitmap.cy is certificated as a positive value after initialization in SURFACE_AllocSurface, so we can safely omit abs and labs (absolute) function calls for it.
2019-07-21 21:39:05 +09:00
Katayama Hirofumi MZ 023794c7c1 [FONTS][NTGDI] Change Marlett.ttf charset and delete charset hacks 2019-07-21 12:59:06 +09:00
Hermès Bélusca-Maïto 3de67cec24
[WIN32K:NTGDI] Improve allocated resources cleanup in failure paths of IntGdiLoadFontsFromMemory().
- Use an auxiliary list where we add the new enumerated faces, for easy
  roll-back in case a failure happens during font loading. Only at the
  very end when font loading has been successfully done, the auxiliary
  list is appended to the corresponding global or per-proceess font list.

- Perform actual cleanup in case of failures.

- Introduce CleanupFontEntryEx() helper to simplify cleanup in
  IntGdiLoadFontsFromMemory() in failure paths; implement
  CleanupFontEntry() around it.

Additions:

- Perform string buffer NULL check in IntGdiAddFontResource().
- Reorder memory unmapping and section object dereferencing in
  IntGdiAddFontResource().
- Move DuplicateUnicodeString() upwards.
- Mark explicitly the Marlett font handling hacks.
2019-07-21 01:01:41 +02:00
Katayama Hirofumi MZ ae99df1675 [WIN32SS][NTGDI] Support raster fonts (*.fnt and *.fon) (#1739)
Add raster font (*.fnt and *.fon files) support. CORE-16165

- Add IntGetCharSet() function to get the charset by index and/or the number of charsets.
- Make IntGdiLoadFontsFromMemory() a non-recursive function.
- IntGetOutlineTextMetrics() accepts raster fonts.
- Improve CharMap handling (especially TT_PLATFORM_APPLE_UNICODE).
- Write the raster font file info to the registry.
- Don't request font size for raster fonts in IntRequestFontSize() function.
2019-07-20 16:47:29 +02:00
Joachim Henze b5478a7873 [WIN32SS][FREETYPE] Fix performance regression FreeBASIC console output CORE-16177
By restoring historic state of GreExtTextOutW() / IntExtTextOutW()

This reverts guilty rev 0.4.12-dev-190-g
d6cfeaef51
as well as some follow ups that dealt with new errors popping up afterwards.
The revert got ack of Katayama Hirofumi MZ.

Test VBox on master: https://reactos.org/testman/compare.php?ids=68471,68475
Test KVM on master: https://reactos.org/testman/compare.php?ids=68472,68476

Analog revert was applied before to 0.4.12-RC-42-g
021f498cb2
2019-07-07 20:50:30 +02:00
Bernhard Feichtinger 774246e95c [WIN32SS][GDI] Improve stub for EngQueryDeviceAttribute 2019-06-30 23:50:20 +02:00
Katayama Hirofumi MZ bf06c94e15
[WIN32SS][NTGDI] Strictly check in XFORMOBJ_iSetXform (#1676)
Check if the determinant of the given transformation matrix is non-zero. If zero, the function returns DDI_ERROR without change. CORE-15554
2019-06-24 21:32:40 +09:00
Hermès Bélusca-Maïto 78d20a9b3a
[WIN32K] Fix spelling typo. 2019-06-23 02:12:23 +02:00
Katayama Hirofumi MZ 641a0ea99b
[WIN32SS][NTGDI] usWinAscent and usWinDescent must be treated as signed (#1670)
TT_OS2.usWinAscent and TT_OS2.usWinDescent must be treated as FT_Short. These values affect font metrics. This PR will fix CORE-14994.
2019-06-20 18:58:45 +09:00
Thomas Faber 00e882c2b1
[WIN32K:ENG] In PDEVOBJ_vRefreshModeList, find a proper match for the current display mode instead of assuming a constant index. CORE-15325 2019-06-16 12:45:58 +02:00
Joachim Henze 8f482af0a8 [WIN32SS][FREETYPE] Avoid performance regression CORE-16020
by reverting essential parts of "Font rotation at arbitrary angles"
which was once committed in several steps:

Initial commit (PR#1207)
0.4.12-dev-243-g
f757a13519
broke font rendering for GTK apps CORE-15623

Second commit (PR#1238)
0.4.12-dev-558-g
64987cf273
restored font rendering in GTK apps but introduced slowdown CORE-16020

Katayama agreed to the temporal revert and will try to come up later
with a performance optimized version.
We revert in 0.4.12-RC and 0.4.13-dev.

The revert will cause failure-increases in gdi32:TextTransform
https://reactos.org/testman/compare.php?ids=67898,67901
2019-06-06 02:24:20 +02:00
James Tabor 9f57320175 [GDI32] Meta File Fix Ups
Remove pointer hack. Safer since using wines Enhanced Meta headers with
unknown wine magic information.
2019-06-03 15:49:14 -05:00
jimtabor da264743e1 [Win32SS] Support Clipboard Metafile
Major fix ups and plugging in missing code changes. Handle code is from
another project currently being developed for ReactOS.
See CORE-12143
2019-05-31 21:44:17 -05:00
jimtabor 268b21c2f9 [NtGDI] Support Clipboard Metafile
Fuctions that help transfer meta file data from one process to the next.
See CORE-12143.
2019-05-30 16:36:33 -05:00
jimtabor e229b3eea7 [GDI32] Support Clipboard Metafile
Metafile patch from Katayama Hirofumi MZ. See CORE-12143.
2019-05-30 16:33:23 -05:00