Commit graph

118 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto c77a5ff99b
Revert my last commits that break build.
Revert "[PSDK][AFD][VGADDI] Further build and MS PSDK compatibility fixes."
This reverts commit 99efc2ae50.

Revert "[PSDK] Sync winresrc.h with wine-8.20"
This reverts commit 3e83562aa7.

Revert "[OSK][PROGMAN] Fix resource file build."
This reverts commit 84e4ad0a82.

Revert "[PSDK] Use the new .rh files in winresrc.h"
This reverts commit f6fb7c48c9.
2023-11-23 17:20:47 +01:00
Hermès Bélusca-Maïto 99efc2ae50
[PSDK][AFD][VGADDI] Further build and MS PSDK compatibility fixes.
- windows.h:
  * should define _WINDOWS_ and _INC_WINDOWS instead of _WINDOWS_H
  * include winresrc.h if RC_INVOKED and not NOWINRES (Wine also agrees
    with that)
  * also, some .h included from there should _not_ be included if their
    respective NO*** flags are defined.

- batclass.h: Use correct _WINDOWS_ guard.

- winsnmp.h:
  * should define _INC_WINSNMP instead of _WINSNMP_H
  * use _INC_WINDOWS instead of _WINDOWS_H

- afd.h, vgaddi.h: Use the correct guards.

- winnt.rh: Define the (SUB)LANG_* exactly as they are in the winnt.h,
  otherwise we get macro redefinition compile errors.

NOTE: Ideally these .rh files should be auto-generated from their
corresponding .h files.

- afxres.h: Do not include the whole windows.h, but instead, only
  the winres.h file, and only if RC_INVOKED is defined.

NOTE: Both afxres.h and winres.h do not really belong to the PSDK,
but belong instead to MFC. The reason why we have them here is twofold:

1. Wine used to have also winres.h (from where we got ours). This is
   because the .rc resource files of some non-MFC modules were generated
   with Visual Studio, which always includes afxres.h for these, and the
   solution was to use a slightly less MFC-specific header: winres.h
   (Wine commit cb08c82244673f26842e7a0766de90f091b5a493).
   However, this winres.h has been since removed from Wine tree
   (Wine commit 197f4059ab2af5f13f9c56faa26e3b4af902f869).

2. Few of our modules either use afxres.h or winres.h in their resource
   files, and we still want to be able to compile them.
2023-11-23 16:26:30 +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
Serge Gautherie bac646f9fe
[VMX_SVGA] Demote 3 DPRINT1() and define NDEBUG (#5843)
Addendum to 486e587 (r45778).
2023-11-13 11:11:10 +01: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
Hermès Bélusca-Maïto 5cb2b73988
[VIDEOPRT] VideoPortGetAccessRanges: Return ERROR_MORE_DATA if there exist more device access ranges that can be returned than what is specified by NumAccessRanges. 2023-06-28 17:22:01 +02:00
Hermès Bélusca-Maïto 122eaeb6ad
[VIDEOPRT] VideoPortGetAccessRanges: Add doxygen doc, SAL annotations and minor formatting. 2023-06-28 17:22:00 +02:00
Hermès Bélusca-Maïto 61c77d1f87
[XBOXVMP] Real OG XBOX NVidia GPU exposes 3 access ranges, so retrieve them.
CORE-19011

Fix a "bug" I introduced in commit 61012eb54.
VideoPortGetAccessRanges() expects the caller to specify at least the
total number of ranges the hardware exposes, otherwise it fails with
ERROR_MORE_DATA. (Tested also with the help of Windows' videoprt.sys.)

On real original XBOX there are three:
```
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation NV2A [XGPU] [10de:02a0] (rev a1)
    Subsystem: Unknown [0000:0000]
    Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 03
    Memory at fd000000 (32-bit, non-prefetchable) [size=16M]
    Memory at f0000000 (32-bit, prefetchable) [size=128M]
    Memory at 00000000 (32-bit, prefetchable) [size=512K]
```

Thanks to Stanislav and Daniel for tests on the real XBOX.
2023-06-28 17:21:58 +02:00
Hermès Bélusca-Maïto 3121aee56e
[VIDEOPRT] Honour NumAccessRanges == 0 / AccessRanges == NULL in VideoPortVerifyAccessRanges()
These are specified for releasing the hardware resources previously
acquired by either a previous call to VideoPortVerifyAccessRanges()
or a call to VideoPortGetAccessRanges().
2023-06-25 21:25:08 +02:00
Hermès Bélusca-Maïto de6313d89e
[VIDEOPRT] Reformat VideoPortVerifyAccessRanges()
Fix indentation, add SAL annotations and Doxygen description.
2023-06-25 21:25:07 +02:00
Hermès Bélusca-Maïto 7eca194709
[VIDEOPRT] In legacy detection, don't guess the maximum number of buses of a certain type.
Use whatever number there is on the system.
Also ensure that vpStatus is correctly initialized.
2023-06-25 21:25:07 +02:00
Victor Perevertkin 38e4b859e2
[FRAMEBUFACC] Remove the driver
This is an unfinished attempt to rewrite the driver by Magnus Olsen,
dating back to 2007.
2023-06-19 13:58:46 +03:00
Victor Perevertkin cdb130420e
[FRAMEBUF_NEW] Remove the driver
It doesn't seem to be better than the current "framebuf", and has an
unfriendly license (NT4 DDK Sample).
2023-06-19 13:58:46 +03:00
Victor Perevertkin b9b2608bfb
[FRAMEBUF] Return the "old" driver back
It has a better license (GPL) and does not have visible drawbacks
compared to framebuf_new.
2023-06-19 13:58:43 +03:00
Hermès Bélusca-Maïto 61012eb544
[XBOXVMP] Fix in VideoPortGetAccessRanges call: missing Slot parameter.
Contrary to what is (badly) written on MSDN, this parameter is
*mandatory* when the ranges looked for are on a PCI adapter.

Detected when testing with MS Windows' videoprt.sys on XBOX emulator;
thanks to Simone Lombardo for assistance!
2023-06-14 12:10:55 +02:00
hpoussin 1bdefebc9e
Enable framebuf_new driver (#4775)
Replace framebuf display driver by framebuf_new display driver
Compile framebuf_new as framebuf.dll, and add it to bootcd/livecd
Remove old framebuf from compilation, to not conflict
2023-04-02 23:33:15 +09:00
Joachim Henze 83e1363065
[INF] More deduplication and style harmonization (#4952)
- deduplication of manufacturer strings
- at some places harmonizes the different length of separator lines within the same file, centers the words (as requested by hbelusca during review), harmonizes those lines to 74characters length each
- moving some strings that are not to be localized into the non-localization string section
- other minor formatting preferences coauthored by StasM
2022-12-28 02:26:17 +01:00
Hervé Poussineau 79f16507c4 [VGAMP/VGADDI] Be consistent in IOCTL_VIDEO_GET_CURRENT_MODE and IOCTL_VIDEO_SET_CURRENT_MODE
As IOCTL_VIDEO_GET_CURRENT_MODE returns 2 as ModeIndex, wait for the same value
in IOCTL_VIDEO_SET_CURRENT_MODE.
Also change vgaddi to send this hardcoded value.

vga_new also uses 2 as index for 640x480x16
2022-11-15 23:15:26 +01:00
Hervé Poussineau d117765e71 [BOCHSMP] Move related registry entries to bochsmp directory 2022-11-11 15:14:13 +01:00
Hervé Poussineau a33719500c [BOCHSMP] Add driver for QEMU and Bochs graphic card 2022-10-17 18:20:22 +02:00
Hervé Poussineau f0b8a1730e [VIDEOPRT] Correctly detach from device stack in case of failure 2022-10-15 15:06:53 +02:00
Hervé Poussineau 22d8c0fd54 [FRAMEBUF] Implement required DirectDraw functions
However, do not support any optional callback.

dxdiag now accepts to run DirectDraw tests.
2022-09-26 23:45:56 +02:00
Stanislav Motylkov bbccad0ed6
[INF] Set manufacturer as ReactOS Project for consistency
Also make it non-localizable. CORE-18191
2022-06-27 17:00:18 +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
Stanislav Motylkov 17e0e4428c
[PC98VID] Fix video driver settings
- Store settings in non hardware-profile registry key.
- Rename driver file to vgapnp.sys to keep in sync with VBE.
- This makes PC-98 video driver working again.

Addendum to 073a1ea3 and f03750de. CORE-18201 CORE-17977
2022-05-27 18:56:13 +03:00
Stanislav Motylkov 5471363801
[XBOXVMP] Fix video driver settings
- Store settings in non hardware-profile registry key.
- This makes Xbox video driver working again.

Addendum to f03750de. CORE-16216
2022-05-27 18:54:20 +03:00
Hermès Bélusca-Maïto 52275a92bd
[WIN32SS:DISPLAY] Fix some return values (use correct types) in display drivers.
See for example, in DrvEnableSurface(), etc.

TODO: framebufacc's comments need to be "translated" into actual English...
2022-03-19 17:51:44 +01:00
Hervé Poussineau 963e76fd60 [VIDEOPRT] Fix typo: DEViCEMAP -> DEVICEMAP 2022-01-26 19:30:32 +01:00
Hervé Poussineau 1add6de3e8 [VIDEOPRT] Change case of device registry path written to registry
Change it it two places, to handle when 'UseNewKey' is enabled or disabled.

This fixes the Spice guest agent, which searches 'System' case-sensitively in it.
2022-01-26 19:30:32 +01:00
Hervé Poussineau b80d806e05 [VIDEOPRT] Honour UseNewKey setting in registry
This changes:
- which device key is written to DEVICEMAP\Video
- which registry key is used in VideoPortSetRegistryParameters()

CORE-17896
2022-01-26 19:30:32 +01:00
Hervé Poussineau 2538583dbe [VIDEOPRT] Query children only when device has been opened
HwGetVideoChildDescriptor callback must be called only after HwInitialize.

CORE-17979
2022-01-06 22:02:07 +01:00
Hervé Poussineau 983d9a1c2a [VBEMP] Disable reporting multiple monitors
It has never worked, and only leads to some infinite loops with some hardware or BIOS configurations.
2022-01-06 20:16:12 +01:00
Hervé Poussineau f03750de6a [VBEMP] Rename to vgapnp.sys
- rename driver vbemp.sys to vgapnp.sys
- rename service VBE to vga
- store settings in non hardware-profile registry key
2022-01-06 20:16:12 +01:00
Hervé Poussineau 073a1ea34c [VGAMP] Rename to vga.sys
- rename driver vgamp.sys to vga.sys
- rename service Vga to VgaSave
- store settings in non hardware-profile registry key
2022-01-06 20:16:12 +01:00
Hervé Poussineau 0d9386d0e0 [VGA_NEW] Disable it for now 2022-01-06 17:47:45 +01:00
Serge Gautherie 40b9ee0ae0
[VIDEOPRT] Match Zw*Key() DesiredAccess values (#4145)
Even if the kernel mode does not care, this makes it clear.
2022-01-06 04:04:09 +03:00
Hervé Poussineau 5dc56dd1d6 Revert "[VIDEOPRT] Fix updating of new registry path values"
This reverts commit ecf3416f49.

This commit was meant to fix CORE-17688. While its effectively fixed
the problem, it introduced another regression CORE-17719.

In the mean time, commit c05a45e17e fixed
things properly.

CORE-17719
2021-12-08 18:36:34 +01:00
Hervé Poussineau cd48bc7af8 [LIVECD] Add more registry entries for vbemp/vgamp
CORE-17579
2021-10-25 21:44:45 +02:00
Hervé Poussineau ea8cbbd4ca [VIDEOPRT] Correctly return failure in IRP_MJ_CREATE when HwInitialize fails
CORE-17789
2021-10-14 23:39:31 +02:00
Hervé Poussineau 807af6a4d1 [VIDEOPRT] Correctly return failure when adapter can't be found
This was wrong in both call chains (PNP case or legacy case)
HwFindAdapter returns a VP_STATUS, while we were expecting a NTSTATUS.

CORE-17789
2021-10-14 23:39:31 +02:00
Hervé Poussineau 87b74f2901 [VIDEOPRT] Correctly report legacy resources in IRP_MN_FILTER_RESOURCE_REQUIREMENTS
It was broken since first commit 25eae4b916 (r54237)

CORE-17789
2021-10-14 23:39:31 +02:00
Hervé Poussineau 951dc66c66 [VGAMP] Correctly check and report legacy resources (VGA I/O ports and memory)
As we are a non PNP driver, the call chain will be
DriverEntry -> VidePortInitialize -> VideoPortFindAdapter -> HwFindAdapter.

If legacy resources are available, we will fail VGAFindAdapter,
so DriverEntry will fail, so vgamp.sys driver won't be used.

CORE-17789
2021-10-14 23:39:30 +02:00
Hervé Poussineau 6dd94572e5 [VBEMP] Correctly report legacy resources (VGA I/O ports and memory)
CORE-17789
2021-10-14 23:39:30 +02:00
Hervé Poussineau 3379de3924 [VBEMP] Fail HwInitialize (ie IRP_MJ_CREATE) when /NOVESA switch is present
In that case, we want a simple VGA driver to drive the graphic adapter.

CORE-17789
2021-10-14 23:39:30 +02:00
Hervé Poussineau 92d0dd3633 [VIDEOPRT] Create and setup new registry key only for non-legacy drivers
CORE-17734
2021-09-29 22:56:35 +02:00
Hermès Bélusca-Maïto 9393fc320e
[FORMATTING] Remove trailing whitespace. Addendum to 34593d93.
Excluded: 3rd-party code (incl. wine) and most of the win32ss.
2021-09-13 03:52:22 +02:00
Timo Kreuzer ecf3416f49 [VIDEOPRT] Fix updating of new registry path values
CORE-17688
When a new driver is installed for the same device (like VBoxVideo), it uses the same hardware enum registry key and thus reuses the same DisplayId and the same display registry key. Therefore we need to update the setting in that key, even when the key already exists.

This seems to work good and not cause any issues, but testing indicated that on Windows some values are only updated, when the driver has changed. If neccessary, this can be achieved by updating and querying the ActiveService value in the device enum key (e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_80EE&DEV_BEEF&SUSYS_00000000&REV_00\3&267a616a&0&10\Control: ActiveService). If that doesn't match the current device name (from DriverExtension->RegistryPath) the values should be copied over.
2021-07-27 14:44:14 +02:00
Hervé Poussineau 8379c87b0b [VIDEOPRT] Write correct MaxObjectNumber to registry
VideoPortMaxObjectNumber variable will be updated later in the function, if everything went fine.
2021-07-10 19:03:37 +02:00
Timo Kreuzer 49c16e661a [VIDEOPRT] Do not attach secondary devices to the device stack
This fixes display on the primary screen.
2021-07-10 16:27:44 +02:00