Improve checks in AlphaBlend and TransparentBlt functions: check whether DCSrc is of DCTYPE_INFO also, to fail in that case properly too.
Spotted by PVS-Studio analysis.
Reference: https://pvs-studio.com/en/blog/posts/cpp/1122/.
Support emoji characters and minor characters.
JIRA issue: CORE-19030
NOTE: Not every emoji is supported yet (No ZWJ support). Surrogate pairs only.
NOTE: This feature only works if the appropriate font is selected.
- Add IS_HIGH_SURROGATE and
IS_LOW_SURROGATE macros.
- Add Utf32FromSurrogatePair helper function
to convert a surrogate pair to a UTF-32 code
point.
- Convert the surrogate pairs in the text in
TextIntGetTextExtentPoint, IntGetTextDisposition,
and IntExtTextOutW functions.
Slight performance improvement.
JIRA issue: CORE-15554
- Add bNoTransform variable.
- Check whether mat is identity matrix.
- If so, then don't do FT_Vector_Transform.
Slight performance improvement. STACK_TEXT_BUFFER_SIZE = 100 was too small
for long text. This PR can reduce unnecessary buffer allocations in NtGdiExtTextOutW
function.
JIRA issue: CORE-15554
- Change STACK_TEXT_BUFFER_SIZE to 512.
When I am implementing the IME soft keyboard (#6021 and #6036),
I noticed an issue with PatBlt function.
- Fix the rectangle coordinates when the value was
negative in NtGdiPatBlt function.
- Fix NC_DrawFrame function.
- Fix UserDrawWindowFrame function.
CORE-19334
According to the results of CImage testcase,
the top byte of the GetPixel() return value is
zero if the return is a valid color.
Do bitwise-AND operation if the color value is valid.
CORE-19008
I intend to port back the combined work of Thomas Faber and Serge Gautherie in context of CORE 14271.
Both developers fixed wrong retval evaluations for SeSinglePrivilegeCheck() and RtlCreateUnicodeString().
Both functions do return a BOOLEAN, and therefore using NTSTATUS() on them is wrong.
Those bugs have been fixed at multiple places. That is long gone.
But Serge fixed his locations a bit more elegantly, without the need for additional variables.
Therefore this addendum adapts a few of Thomas locations to the improved Serge-ified style.
Yes: I intentionally used a space instead of a minus after the mentioned CORE 14271,
as I don't want that pure stylistic addendum to be linked with the initial ticket anymore.
That would be overkill.
Many thanks for Simone Lombardo for pointing to the code needing attention
and providing a working proof-of-concept solution.
CORE-12377
CORE-18084
CORE-13889
CORE-18221
Load the DirectX graphics kernel driver (dxg.sys) by win32k at WINSRV
initialization time, in NtUserInitialize(). Keep it always loaded in
memory, as on Windows, instead of loading it only by DirectX dlls.
This fixes the problem of acessing this driver: we need only to call
DxDdEnableDirectDraw() and do other stuff when DirectDraw/Direct3D is
required by anything. In other cases, it is called from win32k PDEV
functions when changing display mode (as in Windows). Since it's used
by other things too, it needs to be always loaded.
Otherwise, if it's not loaded, its APIs are not accessible when needed,
and execution fails.
For example, it fixes display mode change problem in VMWare, when a
new mode fails to be applied. Indeed, when it manages DirectDraw stuff,
it calls DXG routines, and therefore fails if dxg.sys isn't loaded
in memory at this moment.
- Implement InitializeGreCSRSS() initialization routine, that initializes
supplemental NTGDI/GRE data once CSRSS and WINSRV are loaded:
* Call DxDdStartupDxGraphics() inside it, which loads dxg.sys.
* Additionally, move fonts and language ID initialization there, from
win32k!DriverEntry. Confirmed by analysis on Windows.
- Call InitializeGreCSRSS() in NtUserInitialize() main initialization routine
(called by WINSRV initialization).
Moved to NTGDI from previously NTUSER place:
Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
This allows DevExpress Ribbon Notepad sample to start.
Also add a fat DPRINT1 suggested by Timo Kreuzer,
because there is a lot wrong in the code.
CORE-18091 CORE-18558
Rotation and shearing transformation of font/text is now available. Retrial of PR #1207.
- Rename ftGdiGetTextWidth as IntGetTextDisposition and add a Y parameter.
- Apply lfEscapement values (by multiplying matrices).
- Add IntEngFillPolygon and IntEngFillBox helper functions.
CORE-11848
- Add lfWidth member into FONTGDI structure.
- Delete IntWidthMatrix function.
- Fix IntRequestFontSize behavior for processing lfWidth value.
- Apply lfWidth in GetTextMetrics and GetCharWidth.
- Ignore the XFORM values in GetTextMetrics and GetCharWidth.
CORE-11848
- Modify FONT_CACHE_ENTRY structure to use hash.
- Use hash in ftGdiGlyphCacheGet and ftGdiGlyphCacheSet functions.
- Reduce function call overheads by using FONT_CACHE_ENTRY, in getting glyph.
CORE-11848
- Use FT_Matrix instead of MATRIX in FONT_CACHE_ENTRY structure.
- Use FtMatrixFromMx and FT_Set_Transform instead of FtSetCoordinateTransform.
CORE-11848
- Delete some IntRequestFontSize function calls.
- Enable cache on font size requests.
- Add two members into FONTGDI structure, for font size cache.
CORE-15554
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
Implement a base security infrastructure with code that sets up a security descriptor for the service that we're going to connect through it. Such service is based upon a desktop and a window station.
=== DOCUMENTATION REMARKS ===
The authenticated user, represented by an access token that describes its security context, is the main holder and has ultimate power against the default created desktop and window station objects in USER. The authenticated user in question
is the actual logged in user, this is the case when the server is impersonating a client. Administrators on the other hand have some share of power against default desktop but their power in question is extremely limited against the default
window station as admins can only just enumerate the available and valid handle stations within a desktop.
This will be used (later) to store the list of all enabled display devices.
Add a global variable gpmdev (should really be stored in DISPLAYINFO structure)
Replace global variable gppdevPrimary by pmdev->ppdevGlobal.
Remove useless ASSERT(FALSE); in IntGdiCreateDisplayDC, because it actually does not check anything useful. It only asserts each time when the function is called from DxEngCreateMemoryDC by MS DirectDraw stack (ddraw.dll & dxg.sys).
UNIMPLEMENTED debug print is enough a lot to see that this function is not implemented properly.
CORE-17561
- Extend PATH_WidenPath function as PATH_WidenPathEx with the path argument.
- Use PATH_WidenPathEx and PATH_FillPathEx functions to implement wide pen drawing in PATH_StrokePath function.
- Add the code to IntGdiLineTo, IntRectangle, IntGdiPolygon, and IntGdiPolyline in order to stroke the path when the effective wide pen.
FIXME: Boundary rectangle.
CORE-2527, CORE-8366