Commit graph

350 commits

Author SHA1 Message Date
Thomas Faber 8b19b6ec5a [GDI32] Fix memory leak in case of public DC. CORE-18498 2023-01-27 22:30:35 -05:00
Julio Carchi a999c43746
[NTGDI] Check if face->charmap is not zero before accessing its encoding (#4390)
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
2023-01-18 21:24:40 +03:00
Serge Gautherie 8efde69a25
[WIN32K:NTGDI] PATH_PathToRegion(): Update documentation (#4941)
Addendum to 215e0d9 (r64177).
2022-12-22 01:27:51 +01:00
Timo Kreuzer a206b55838 [WIN32K] Fix memory leak on failure in REGION_SetPolyPolygonRgn 2022-12-13 07:18:24 +01:00
Timo Kreuzer 4f0f5f6ff8 [WIN32K] Fix a bug in PATH_PathToRegion 2022-12-13 07:18:24 +01:00
Timo Kreuzer 84b09285c8 [WIN32K] Fix missing NULL check in NtGdiPathToRegion 2022-12-13 07:18:24 +01:00
Timo Kreuzer 60af8194bb [WIN32K] Fix uninitialized variable in IntExtTextOutW 2022-12-13 07:18:24 +01:00
Katayama Hirofumi MZ 11ee1fa88e [NTGDI][FREETYPE] Follow-up of #4920 (e316d61); Rename functions
Follow the naming policy.

- ftGdiGetRealGlyph --> IntGetRealGlyph
- ftGdiGlyphCacheGet --> IntFindGlyphCache
- ftGdiGlyphSet --> IntGetBitmapGlyphNoCache
- ftGdiGlyphCacheSet --> IntGetBitmapGlyphWithCache
- FtMatrixFromMx --> IntMatrixFromMx

CORE-11848
2022-12-04 22:11:46 +09:00
Katayama Hirofumi MZ e316d61215
[NTGDI][FREETYPE] lfEscapement for TextOut (#4920)
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
2022-12-03 13:03:28 +09:00
Timo Kreuzer 9fc56bfc9d [WIN32K] Fix missing NULL check in IntCreateDIBitmap 2022-12-01 20:17:40 +02:00
Katayama Hirofumi MZ 138eb58b95
[NTGDI][FREETYPE] lfWidth for GetTextMetrics and GetCharWidth (#4919)
- 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
2022-12-01 08:54:39 +09:00
Katayama Hirofumi MZ 4d0d22aee2
[NTGDI][FREETYPE] Add special structure for hashing (#4916)
Add FONT_CACHE_HASHED structure and use it.
CORE-11848
2022-11-29 19:41:09 +09:00
Katayama Hirofumi MZ b85f0056a8
[NTGDI][FREETYPE] lfWidth for GetTextExtentPoint32 (#4912)
- Apply LOGFONT.lfWidth in TextIntGetTextExtentPoint function.
- Delete XFORM transformation in TextIntGetTextExtentPoint (to be simply ignored).
CORE-11848
2022-11-28 07:34:58 +09:00
Katayama Hirofumi MZ 015cd2596c [NTGDI][FREETYPE] Follow-up of #4901 (57702ed)
- Drop APIENTRYs for static functions.
- Use FIELD_OFFSET instead of offsetof.
- Delete unnecessary ASSERTs.
- Add annotations.
CORE-11848
2022-11-27 12:42:25 +09:00
Katayama Hirofumi MZ 57702ed401
[NTGDI][FREETYPE] Font cache: Use hash (#4901)
- 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
2022-11-27 11:26:44 +09:00
Katayama Hirofumi MZ 3f3714bad4
[NTGDI][FREETYPE] Font cache: Use FT_Matrix instead of MATRIX (#4900)
- Use FT_Matrix instead of MATRIX in FONT_CACHE_ENTRY structure.
- Use FtMatrixFromMx and FT_Set_Transform instead of FtSetCoordinateTransform.
CORE-11848
2022-11-25 11:23:29 +09:00
Katayama Hirofumi MZ 375b02f337 [NTGDI][FREETYPE] Simplify IntRequestFontSize and FONTGDI
FONTGDI.lfWidth and FONTGDI.EmHeight are not used.
Simplify code without setting these members.
CORE-11848
2022-11-24 14:18:20 +09:00
Katayama Hirofumi MZ 476f94c0fe [NTGDI][FREETYPE] Formatting code; Follow up #4865 (a620c6f)
CORE-11848
2022-11-24 12:28:10 +09:00
Katayama Hirofumi MZ a620c6f82e
[NTGDI][FREETYPE] Simplify font rendering (#4865)
- Add ftGdiGetRealGlyph and ftGdiGetTextWidth helper functions.
- Optimize font rendering.
CORE-11848
2022-11-24 11:51:04 +09:00
Hervé Poussineau 12ef61ba10 [WIN32SS:ENG] Set VGA device as child of primary device
That way, we don't have anymore the VGA device together with primary device in device list.

Change also EngpUnlinkGraphicsDevice() function to add back VGA device to device list
when removing its parent from device list.

CORE-18522
2022-11-15 23:16:10 +01:00
Hervé Poussineau b3cdb7e713 [WIN32SS:ENG] Add EngpLinkGraphicsDevice, to add a device to gpGraphicsDeviceFirst list 2022-11-15 23:16:10 +01:00
Hervé Poussineau 3d01a103d7 [WIN32SS:ENG] Zero memory when allocating GRAPHICS_DEVICE structures 2022-11-15 23:16:10 +01:00
Hervé Poussineau ea30b96334 [WIN32SS:ENG] When VGA mode is requested, drop all graphic devices except VGA one
We don't need driver cooperation anymore to handle VGA mode request.
2022-11-15 23:15:26 +01:00
Katayama Hirofumi MZ a2c6af0da4
[BOOTDATA][NTUSER] Add UserIsIMMEnabled and use it (#4882)
This PR enables SRVINFO_IMM32 also for non-CJK. You can disable this flag by setting zero to the LoadIMM registry value if you're non-CJK.
CORE-11700
2022-11-15 17:10:06 +09:00
Katayama Hirofumi MZ 0bc6bd6480
[NTGDI][NTUSER][INCLUDE] Add 'See also:' comments for structures (#4872)
Add 'See also' URLs to some undocumented structures.
2022-11-12 20:27:50 +09:00
Katayama Hirofumi MZ 9f36a9d4a7
[NTGDI][FREETYPE] Optimize MatchFontNames (#4861)
Optimize MatchFontNames helper function for speed.
CORE-15554
2022-11-08 16:35:01 +09:00
Katayama Hirofumi MZ 467768f766
[NTGDI][FREETYPE] Reduce font size request (#4862)
- Delete some IntRequestFontSize function calls.
- Enable cache on font size requests.
- Add two members into FONTGDI structure, for font size cache.
CORE-15554
2022-11-08 16:31:10 +09:00
Thamatip Chitpong dd75ae8eca
[WIN32SS] Use GDI_HANDLE_* macros for readability (#4797) 2022-10-26 02:17:01 +02:00
Hervé Poussineau 162de4a0d8 [WIN32SS:ENG] Call display mouse functions only when using hardware pointer
Otherwise, use software pointer functions.

This fixes graphical glitches on cursor change, when the display driver
provides accelerated pointer functions (DrvSetPointerShape/DrvMovePointer),
but refuses to handle a certain cursor.

These graphical glitches may be reproduced:
- by using Voodoo driver SFFT 1.9
- by using framebuf_new.dll instead of framebuf.dll
- by using the panning driver (setting DefaultSettings.XPanning and
  DefaultSettings.YPanning in registry)
2022-10-11 19:04:59 +02:00
Hermès Bélusca-Maïto 58740bfbc1
[GDI32][USER32] Order the set_module_type arguments the usual way ("UNICODE" before the entrypoint).
+ Harmonize the entrypoints as well.
2022-10-06 15:37:23 +02:00
Hervé Poussineau 7278ed2015 [WIN32SS] Change LDEVOBJ_bProbeAndCaptureDevmode to account for not provided fields when searching an exact mode
This fixes mode change if an application requests (for example) 640x480x32, without providing display frequency.
2022-09-28 18:31:19 +02:00
Mark Jansen d84b76a69e
[GDI32] Fix ExtTextOutA with ETO_GLYPH_INDEX
CORE-18365
2022-09-18 20:51:12 +02:00
Timo Kreuzer 090ccb3d8e [WIN32K] Add missing NULL checks
Also fix an old copy-pasta.
2022-08-04 16:15:24 +02:00
Serge Gautherie b671b1cf8f
[WIN32K:ENG] EngAlphaBlend(): Release EnterLeaveSource on error (#4560)
Part of CORE-11156

Co-authored-by: Carlo Bramini <carlo.bramix@libero.it>
2022-07-02 12:30:03 +03:00
Hervé Poussineau cd8305494c [WIN32SS:ENG] Fix handling of Acceleration.Level parameter (was not read anymore) 2022-06-05 14:49:47 +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
Stanislav Motylkov 26b88af642
[WIN32SS] Add missing code parts for monitor handling
- [VIDEOPRT] Add stub for IOCTL_VIDEO_ENUM_MONITOR_PDO.

- [WIN32SS:ENG] Add missing checks and comments.

- [WIN32SS:NTUSER] Add missing monitor handling and comments.

Addendum to 31827c43. CORE-18197 CORE-11715
2022-05-30 15:28:44 +03:00
Stanislav Motylkov 31827c43b6
[WIN32SS] EnumDisplayDevices: Fill DeviceID field properly
- [VIDEOPRT] Return the real PhysicalDeviceObject in Win32k callbacks.

- [WIN32SS:ENG] Pass PhysDeviceObject into the GraphicsDevice structure
  and rename the destination field accordingly.

- [WIN32SS:NTUSER] Request hardware identifiers from device PDO and
  fill DISPLAY_DEVICE's DeviceID field with the first identifier.

Now it's correctly passed to the usermode, and Desktop Propertes applet
can open the video adapter device properties.

Thanks to Hervé Poussineau for the help.

CORE-18197 CORE-11715
2022-05-30 15:28:21 +03:00
Hervé Poussineau d2a87f1b7f [WIN32K] Improve finding the best matching display mode
Search the display mode having the smallest difference with the requested one.
We can then remove the hardcoded values of 60 Hz and 32 bpp by default.

CORE-18189
2022-05-22 23:42:03 +02:00
Hervé Poussineau 588285881e [WIN32SS] Change LDEVOBJ_bProbeAndCaptureDevmode to load missing settings from registry
- use EngpGetDisplayDriverParameters to get display settings from registry
- update searched display settings with the provided ones (+ add missing SEH2)
- then, search exact mode

User can now change only one display setting, without specifying other ones.
2022-05-22 17:32:44 +02:00
Hervé Poussineau 9acd895f18 [WIN32SS] Copy loading of registry settings from mdevobj.c to new function
This function will be used in next commit, and duplicated implementation
in mdevobj.c will be dropped.
2022-05-22 17:32:40 +02:00
Hervé Poussineau 900beca021 [WIN32SS] In LDEVOBJ_bGetClosestMode, search 60 Hz if everything failed
This function needs probably to be rewritten.
2022-05-22 17:32:08 +02:00
Hervé Poussineau 22dac3447f Revert "[WIN32SS] Handle panning in LDEVOBJ_bProbeAndCaptureDevmode"
This reverts commit 37c2bb3985.

CORE-18189
2022-05-22 17:31:44 +02:00
Hervé Poussineau 81aa81e38f [WIN32SS] Implement display acceleration level 5 (ie no acceleration)
This is a easy as forcing usage of panning driver.
2022-05-14 21:29:12 +02:00
Hervé Poussineau 4e0f2fc01c [WIN32SS] Implement panning driver
This can be configured in registry with DefaultSettings.XPanning and
DefaultSettings.YPanning, which describe the real screen resolution.

DefaultSettings.XResolution and DefaultSettings.YResolution describe
the resolution of the virtual screen.
2022-05-14 21:29:12 +02:00
Hervé Poussineau 83d2c8ce33 [WIN32SS] mouse: call panning driver when moving pointer
Yes, if a driver supports both hardware pointers and panning, it will be called twice on each move.
2022-05-14 21:29:12 +02:00
Hervé Poussineau 57c07ba117 [WIN32SS] mouse: use pointer flags in PDEVOBJ
When changing pointer cursor:
- use PDEV_HARDWARE_POINTER flag if using hardware pointer
- use PDEV_SOFTWARE_POINTER flag if using software pointer
- keep pfnMovePointer as an accelerator to driver function (if available) and never change it
- fix bug (2 pointers) when switching between hardware and software pointer

When moving pointer:
- check PDEV_HARDWARE_POINTER flag to know if we need to call the driver
- check PDEV_SOFTWARE_POINTER flag to know if we need to call EngMovePointer
2022-05-14 21:29:12 +02:00
Hervé Poussineau 37c2bb3985 [WIN32SS] Handle panning in LDEVOBJ_bProbeAndCaptureDevmode
- search a graphic mode corresponding to real screen resolution (not virtual panning one)
- when capturing the selected mode, copy from input the virtual panning resolution
- when searching the best mode, also try without panning
2022-05-14 21:29:12 +02:00
Hervé Poussineau 185f2dac85 [WIN32SS] Copy function table earlier, and use it in all PDEVOBJ operations 2022-05-14 21:29:12 +02:00
George Bișoc 878c2f4444
[WIN32K:NTUSER] Implement security infrastructure for NTUSER component
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.
2022-05-06 10:09:48 +02:00