Commit graph

326 commits

Author SHA1 Message Date
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
Serge Gautherie 03422451b3 [REACTOS] Add '\n' to debug logs
on TRACE, WARN, FIXME and ERR calls.

Plus a few nit picks.
2022-05-04 03:28:38 +03:00
Victor Martinez Calvo b57be0a746
[GDI32] Fix GetObjectW() GDI_OBJECT_TYPE_BRUSH handling. (#4394)
This fixes the last GetObjectW apitest case:
ok_long(GetObjectA(hBrush, 0, &TestStruct), 0);

- When "cbSize" is "0", GetObjectW shouldn't return "sizeof(LOGBRUSH)" but 0.
- Rely in BRUSH::cjGetObject behavior which returns 0 when cjSize is 0.

Co-authored-by: Víctor Martínez Calvo <victormartinez@alub.io>
2022-05-03 16:00:21 +02:00
Hervé Poussineau 14d50cc6c0 [WIN32SS] Improve selection of 'closest graphic mode'
If color depth is not provided (in registry), try to find a 32 bit one.
If not found, fall back to first available graphic mode.

CORE-18027
2022-05-01 16:36:48 +02:00
Hervé Poussineau d8b3402fe6 [WIN32SS] In PDEVOBJ_vRefreshModeList, do not change current stored mode
When changing current devmode, we must not only change ppdev->pdmwDev
pointer, but also update lots of other structures. This work is done by
PDEVOBJ_lChangeDisplaySettings.

CORE-18169
2022-04-30 23:33:42 +02:00
Hervé Poussineau d1cd80c861 [WIN32SS] Set DISPLAY_DEVICE_PRIMARY_DEVICE flag
This flag was not set anymore since 2d2824f1b9
Note that this is still wrong for multi-monitor.

CORE-18169
2022-04-30 22:02:28 +02:00
Hervé Poussineau cb504d7b0c [WIN32SS] Fix crash if releasing a PDEVOBJ before switching to graphic mode
- do not try to remove ppdev from gppdevList if gppdevList is NULL
- do not check (and maybe change) gpmdev, as it should be done only in MDEVOBJ_vDestroy
2022-04-25 22:18:41 +02:00
Hervé Poussineau 2c391b1eab [WIN32SS] Fix buffer overflow in MDEVOBJ when having more than 10 display devices 2022-04-18 20:01:37 +02:00
Hervé Poussineau aa80cfb46e [WIN32SS] Fix some memory leaks (introduced in 21ddeb76d9) 2022-04-18 16:23:52 +02:00
Hervé Poussineau 0ce5985109 [WIN32SS] Do not call DrvEnableDriver/DrvDisableDriver for LDEV_IMAGE types 2022-04-17 16:20:04 +02:00
Hervé Poussineau 1744b01ad9 [WIN32SS] Rewrite LDEVOBJ reference counting
- introduce LDEVOBJ_vDisableDriver (reversal of LDEVOBJ_bEnableDriver)
- introduce LDEVOBJ_bUnloadImage (reversal of LDEVOBJ_pLoadDriver)
- introduce LDEVOBJ_vDereference, to remove a reference to a LDEVOBJ

Also:
- correctly handle success to unload the image, by removing it from pldev list
- correctly handle failure to unload the image, by re-enabling the driver
- simplify EngUnloadImage, as a wrapper around LDEVOBJ_vDereference
- move LDEVOBJ_ulGetDriverModes lower to prevent forward declaration of
  LDEVOBJ_vDereference

Unfortunately, disable driver unloading as long as ntoskrnl can't reload
a driver it just unloaded...
2022-04-17 08:48:33 +02:00
Hervé Poussineau 3a1a2aa16f [WIN32SS] Fix use of unitialized variable 2022-04-17 08:46:09 +02:00
Katayama Hirofumi MZ 567b0700fe
[NTUSER] Add 'Win:' comments to some functions (#4453) 2022-04-17 06:53:37 +09:00
James Tabor 001e300d92 [Win32SS] Fix Build 2
Fix Build 2
2022-04-15 19:30:59 -05:00
James Tabor 250e5ef38f [ENG] Update Structure
Update GRAPHICS_DEVICE monitor count and video monitor device pointer.
Update dwAccelerationLeve comments.
Updated for printer support.
2022-04-15 19:19:54 -05:00
Hervé Poussineau 9400063aae [WIN32SS] Enable multidisplay driver when required
For now, it is only a stub which returns an error.
2022-04-15 23:09:16 +02:00
Hervé Poussineau f3f4cc0f25 [WIN32SS] Implement EngQueryDeviceAttribute 2022-04-15 23:09:16 +02:00
Hervé Poussineau c89ac107ce [WIN32SS] Handle Graphics acceleration level (registry key Acceleration.Level)
- store the acceleration level in PDEVOBJ
- when searching a pdev, search a pdev with required acceleration level
- disable some functions when not at full acceleration level
  (levels 3 and 5 are not implemented)
2022-04-15 23:09:16 +02:00
Hervé Poussineau 494de7c2df [WIN32SS] Remove now unused code
Initialization of device mode list will be done later, just before switching to graphics mode.

If no graphic display is available, we will now fail when starting first GUI application in
co_IntGraphicsCheck(). Add a bugcheck here to prevent frozen screen.
2022-04-15 23:09:16 +02:00
Hervé Poussineau 2d2824f1b9 [WIN32SS] Implement PDEVOBJ_lChangeDisplaySettings to create initial MDEV
This function can create a MDEV for the whole display (maybe containing multiple
PDEVs), or update settings of a specific PDEV.

- call PDEVOBJ_lChangeDisplaySettings when switching to graphics mode.
- modify EngpGetPDEV to search requested PDEV only in current MDEV
2022-04-15 23:09:16 +02:00
Hervé Poussineau 9db63ad595 [WIN32SS] Add functions related to MDEV (creation, destruction...) 2022-04-15 23:09:16 +02:00
Hervé Poussineau a0cfdcd409 [WIN32SS] Introduce the MDEVOBJ structure
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.
2022-04-15 23:09:16 +02:00
Hervé Poussineau 0f617ddfbb [WIN32SS] Rewrite EngpCreatePDEV as PDEVOBJ_Create
- change first argument to be a PGRAPHICS_DEVICE instead of a device name
- add ldevtype (for now, only LDEV_DEVICE_DISPLAY is allowed)
- always pass a devmode if ldevtype is LDEV_DEVICE_DISPLAY
- insert the ppdev into gppdevList on success
- change callers to adapt them to new rules
2022-04-15 23:09:16 +02:00
Hervé Poussineau c5fb89dced [WIN32SS] Add PDEVOBJ_vEnableDisplay and PDEVOBJ_bDisplayDisplay
Use them where appropriate.
2022-04-15 23:09:16 +02:00
Hervé Poussineau 34085be22d [WIN32SS] Rename PDEVOBJ_vSwitchPdev to PDEVOBJ_bDynamicModeChange
Even if it currently always succeeds, let it return a boolean for later.
2022-04-15 23:09:16 +02:00