Commit Graph

1182 Commits

Author SHA1 Message Date
Joachim Henze
32d615fc10
[DD] Keep the network drivers infs 8.3 like on MS Windows (#7007)
Windows has all its network drivers inf files in 8.3.

This is an addendum to 0.4.15-dev-52-g 019f21ee1d
which moved us further away from our target.

The commit on its own was a good idea actually to get the inf into the drivers directory
and therefore simplifies adding and excluding drivers more locally (e.g. excluding works by
adding a single hashtag within the specific drivers CMakeLists.txt now).

But that cool feature doesn't require us to move away from our target.

For the record:
The historic netrtpnt.inf and netisa.inf (both 8.3) have been merged to
netne2000.inf (not 8.3) by 0.4.15-dev-2763-g 6924b8ff39
Unification of that was cool too,
but again: 8.3 is superior. Therefore netne.inf for that.

Worst of all: Since the .inf files did contain their filename within a comment also, that means
the historic renaming by the mentioned commit invalidated that comment.
netamd.inf fixed by restoring the ancient filename before 0.4.15-dev-52-g 019f21ee1d
netrtl.inf fixed by restoring the ancient filename before 0.4.15-dev-52-g 019f21ee1d
netne.inf I fixed the comment manually.
2024-06-17 22:41:31 +02:00
Joachim Henze
3e6f65ffcd
[DC21X4] Fix uninitialized variable read (#6984)
This is the network driver which is used for MSVPC 2007.

I spotted it during a WIP-backport-experiment of the driver, when compiling with GCC4.7.2, which warned about it.
GCC8.4.0 unfortunately is blind to that on master head, for unknown reasons. Not good.
MSVC github buildbot is also blind to that on master head, for unknown reasons. Not good.
We later found that at least Clang did also warn about it on master head.
2024-06-13 21:24:23 +02:00
Hermès Bélusca-Maïto
ab0e04c81d
[MOUNTMGR] Introduce MountMgrSendSyncDeviceIoCtl() to replace repeated code (#6960)
See https://www.osr.com/blog/2018/02/14/beware-iobuilddeviceiocontrolrequest/
for some details about IRQL requirements.
2024-06-13 20:01:16 +02:00
Hermès Bélusca-Maïto
ed27d733f7
[MOUNTMGR][DDK] Fix some IOCTLs definitions to Win2k3+ compatibility (#6959)
Fix IOCTL_MOUNTDEV_LINK_CREATED, IOCTL_MOUNTDEV_LINK_DELETED,
IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY, to Win2k3+ compatible definitions.
The previous versions of these IOCTLs (in Win2000 and XP) were defined without any access protection.

This was noticed here:
https://community.osr.com/t/ioctl-mountdev-link-created-definition-changed/29428
2024-06-12 12:31:32 +02:00
Hermès Bélusca-Maïto
7930bed0a1
[MPR][MOUNTMGR][DDK] Remove unused wine-specific code (#6958)
Usage of these in MPR was already inside #ifndef __REACTOS__ block,
so, "This Is Fine".
2024-06-12 12:29:22 +02:00
Hermès Bélusca-Maïto
0d36818422
[MOUNTMGR] Some cleanup 2024-06-12 12:29:06 +02:00
Hermès Bélusca-Maïto
e80cd6760c
[PARTMGR] Reimplement IOCTL_MOUNTDEV_QUERY_UNIQUE_ID for MBR and GPT partitions (#6926)
CORE-15575

In addition, fix a PartitionId assignment copy-paste error in PartitionCreateDevice().

The returned standard UniqueId has the following format:

- Basic volume on MBR disk: disk Mbr.Signature + partition StartingOffset (length: 0x0C)
- Basic volume on GPT disk: "DMIO:ID:" + Gpt.PartitionGuid (length: 0x18)
- Volume on Basic disk (NT <= 4): 8-byte FTDisk identifier (length: 0x08)
- Volume on Dynamic disk (NT 5+): "DMIO:ID:" + dmio VolumeGuid (length: 0x18)
- Super-floppy (single-partition with StartingOffset == 0),
  or Removable media: DiskInterfaceName.
- As fallback, we use the VolumeInterfaceName.

References:
- https://winreg-kb.readthedocs.io/en/latest/sources/system-keys/Mounted-devices.html
- https://stackoverflow.com/a/72787681/21852502
- Manual testing on Windows.
2024-06-12 12:15:31 +02:00
Hermès Bélusca-Maïto
3d26d76a4c
[PARTMGR] Detect and flag partitionless ("super-floppy") disks (#6926)
CORE-15575

Detect whether the disk is a "super-floppy", which is the name given
to partitionless disk having no MBR, with the unique partition volume
starting at sector offset zero and spanning the whole disk.
The name comes from the fact that at the partitioning level, the disk
"looks like" a large-capacity floppy disk.

This is typically how external removable (USB, ...) drives are
partitioned by default by Windows.

https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-and-gpt-faq?view=windows-11#superfloppy

The kernel-mode functions IoReadPartitionTable() / IoWritePartitionTable()
report the drive layout of a "super-floppy" disk as follows:
an MBR-style disk containing only one single partition starting at the
beginning of the disk (StartingOffset == 0) without hidden sectors, and
its type being FAT16 non-bootable.
The disk NTFT signature is set to 0x00000001.

----

Additional bug fixes to make the feature work reliably:

- Make PartMgrGetDriveLayout() also update the FDO DiskData's
  PartitionStyle and Signature/GPT DiskId for consistency (code moved
  from PartMgrRefreshDiskData()).

- In FdoIoctlDiskSetDriveLayout[Ex](), if the disk is "super-floppy",
  but the user wants to create more than one partition, fail the call.
  (In the Ex call, fail also if the partition style changes.)
2024-06-12 12:15:22 +02:00
Hermès Bélusca-Maïto
33ac3578fd
[PARTMGR] Fix the way the "symlink -> target" DPRINT is displayed 2024-06-12 12:14:53 +02:00
Hermès Bélusca-Maïto
2d6bbdc6ed
[PARTMGR] Fix x64 build warning
warning C4267: 'function': conversion from 'size_t' to 'ULONG', possible loss of data'

The OutputBufferLength member that was temporarily stored in
outBufferLength is already a ULONG, and IssueSyncIoControlRequest()
takes the length as a ULONG. So there is no need to use 'size_t' here.
2024-06-12 12:14:45 +02:00
Hermès Bélusca-Maïto
b84f2a1cdc
[KDVM] Fix definition of RtlEqualMemory() (#6988)
Comply with the standard documented behaviour:

https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlequalmemory#return-value
> RtlEqualMemory returns TRUE if Source1 and Source2 are equivalent; otherwise, it returns FALSE.

and
https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlcomparememory#return-value
> [...] If all bytes match up to the specified Length value, the Length value is returned.
2024-06-10 22:29:22 +02:00
Hermès Bélusca-Maïto
0a8b421d53
[PARTMGR] Implement IOCTL_VOLUME_QUERY_VOLUME_NUMBER and IOCTL_VOLUME_IS_PARTITION (#6911)
- Implement IOCTL_VOLUME_QUERY_VOLUME_NUMBER:
  See usage example in:
  7241cebfa2/mayfield/branches/spr/src/umapps/ndassvc/service/drivematch.cpp (L627)

- Stubplement IOCTL_VOLUME_IS_PARTITION:
  The only type of volume we support right now is disk partition
  so we just return success. A more robust algorithm would be
  to check whether the volume has only one single extent, that
  covers the whole partition on which it lies upon. If this is
  not the case, return STATUS_UNSUCCESSFUL instead.
2024-06-10 21:32:47 +02:00
Oleg Dubinskiy
a55e9ce19c
[AC97] Use individual Decibel range for Master Volume control (#6950)
Add ReactOS change to use the same Decibel (dB) sound loudness range for Master Volume control as for WaveOut Volume Control.
This fixes incompatible volume level change scaling when changing the volume in Fox Audio Player 0.10.2 from Rapps and Winamp 2.95 with WaveOut output plugin.
Now it is identical to the one when using original AC97 driver from Windows XP/Server 2003.
CORE-14780
2024-06-01 12:31:53 +02:00
Serge Gautherie
3cc4361cca
[CMAKE] Clang*: Add '-Werror=unknown-warning-option' for C/CXX (#6383)
* [UDFS] Clang: Fix a #pragma

'warning: unknown warning group '-Wstringop-overflow', ignored [-Wunknown-warning-option]'

Follow-up to 612b1f2e6 (0.4.15-dev-1129).

* [CREATESPEC] Clang: Fix a target_compile_options()

'warning: unknown warning option '-Wno-stringop-overflow'; did you mean '-Wno-shift-overflow'? [-Wunknown-warning-option]'

Addendum to 00ed72d7e (0.4.15-dev-1169).

* [MSVCRT_WINETEST] Clang*: Fix a target_compile_options()

'warning: unknown warning option '-Wno-stringop-truncation'; did you mean '-Wno-string-concatenation'? [-Wunknown-warning-option]'

Addendum to commits 00ed72d7e (0.4.15-dev-1169) then f155b9377 (0.4.15-dev-4612).

* [TELNET] Clang*: Fix a target_compile_options()

'warning: unknown warning option '-Wno-restrict' [-Wunknown-warning-option]'

Addendum to 447ef2aa4 (0.4.15-dev-4613).
2024-05-31 16:26:11 +02:00
George Bișoc
f69e256376
[ACPI] Register a device interface class with ACPI fans
As the commit title says, the point of registering a device interface with ACPI fans is to receive incoming PnP notifications of incoming ACPI fan drivers so that the power manager can connect to them by creating a power device policies dedicated to them during power manager initialization.

CORE-18969
2024-05-22 20:23:06 +02:00
Timo Kreuzer
677f190f4c [CMAKE] Stop setting the C standard on modules
Global standard is C99.
2024-05-22 18:04:53 +02:00
Oleg Dubinskiy
d1b8feb690
[AUDIO] Implement retreiving audio playback position (#6817)
Implement GetWavePosition API for both Legacy and MMixer modes.
[WDMAUD.DRV]
- Fix wrong I/O control code passed to DeviceIoControl for Legacy mode. Use IOCTL_GETPOS instead of IOCTL_OPEN_WDMAUD, to use the correct routine.
- Implement WdmAudGetWavePosition for MMixer mode, as it was completely unimplemented there. Call an appropiate MMixer routine and return back resulting wave position.
[WDMAUD]
- Implement WdmAudGetPostion routine, which is used by Legacy mode, and call the same MMixer routine from it too.
- Handle it in IOCTL_GETPOS I/O control request of dispatch routine.
[MMIXER]
- Implement MMixerGetWavePosition internal routine, which is called by both Legacy and MMixer modes, and does the actual work of retrieving playback position.
- Call an apporpriate KSPROPERTY_AUDIO_POSITION property from it, and return in the output resulting KSAUDIO_POSITION.PlayOffset member, which contains the current playback position offset, to be returned to the caller.
This fixes a failure retreiving the current audio playback position snd subsequent playing the audio data by several 3rd-party applications which are using this API (for example, some Gecko based browsers by @roytam1: Basilisk (Serpent) 52.9.0 IA-32 build, NewMoon 28.10.7 IA-32 build and KMeleon 76.5.3 Goanna engine).
CORE-19542
2024-05-06 20:07:47 +02:00
Oleg Dubinskiy
12b3272d9e
[AUDIO] Implement support for WAVE_FORMAT_EXTENSIBLE audio format (#6686)
[MMIXER] Implement hadling WAVE_FORMAT_EXTENSIBLE audio format
Fix opening audio device error when trying to open it with WAVE_FORMAT_EXTENSIBLE format tag set in wFormatTag member of WAVEFORMATEX:
- Pass additional data size from WAVEFORMATEX.cbSize to pin data format.
- Append it to the whole size of pin data format (KSDATAFORMAT.FormatSize).
- Set additional fields in WAVEFORMATEXTENSIBLE structure (data format, BPS and channel mask) when WAVE_FORMAT_EXTENSIBLE is used. They are used by our inbuilt Intel AC97 miniport driver at least. It simply fails when these members are not set.
- Fix pin connect allocation size by appending an additional data size from WAVEFORMATEX.cbSize to KSPIN_CONNECT + KSDATAFORMAT + WAVEFORMATEX. This allows to proerly initialize additional extensible data and avoids kernel memory leakage when using extensible audio format.
- Remove format tag check which allowed WAVE_FORMAT_PCM to be opened correctly. So now all possible audio formats can be opened properly at least (although it does not mean they may work correctly).
This fixes the audio playback for all apps those are supporting extensible audio data and use it by default (e. g. AIMP 5.30, QMMP 0.12.17, all Chrome/Chromium-based browsers, GameDev Tycoon Demo game etc.).
CORE-10907, CORE-14783

* [KS] Allow passing additional extensible audio data when extensible audio format is used
- Append additional data size from WAVEFORMATEX.cbSize to pin connect size passed to KsCreatePin. If the tag is WAVE_FORMAT_PCM, then this member should always be zero. So in that case, no any additional data is passed to creation request, and the passed data size is correct for PCM too (KSDATAFORMAT + WAVEFORMATEX).
This fixes audio playback in several apps those are supporting extensibble audio and use it by default (e. g. AIMP 5.30, QMMP 0.12.17, all Chrome/Chromium based browsers, GameDev Tycoon Demo game etc.).
CORE-10907, CORE-14783.

* [WDMAUD.DRV] Pass the correct additional data size to I/O control request
Store a correct size of additional data in WAVEFORMATEX.cbSize when performing open of audio device, when WAVE_FORMAT_EXTENSIBLE audio format is used.
It allows to properly open audio device with Legacy APIs enabled too.
This fixes audio playback in several apps those are using extensible audio data (e. g. AIMP 5.30, QMMP 0.12.17, all Chrome/Chromium based browsers, GameDevTycoon Demo game etc.).
CORE-10907, CORE-14783
2024-04-11 11:59:14 +02:00
Timo Kreuzer
f5e54015ee [KS] Fix a bug found by GCC 13 2024-04-10 21:47:38 +02:00
Timo Kreuzer
109b84826e [UDFS] Remove packing around include of ntifs.h
This is not just wrong, it is criminal.
2024-04-10 21:46:34 +02:00
Dmitry Borisov
5070e8960a
[ACPI] Fix object evaluation (#6302)
CORE-17256

- Implement support for complex input buffers.
  This will enable the IDE driver with some hack
  to execute the _STM (channel timing settings) control method.
- Fix a memory leak.
- Fix returned status code.
- Correctly calculate the output buffer size.
- Improve buffer validation.
- Implement support for async control requests.
- Implement local reference conversion.
- Implement support for subpackage argument conversion.
- Place some code into INIT section.
2024-04-01 18:21:35 +02:00
Timo Kreuzer
752c64d152 [USBOHCI] Fix broken indentation 2024-03-23 23:08:01 +01:00
Timo Kreuzer
5869af7821 [USBUHCI] Fix broken indentation 2024-03-23 23:08:01 +01:00
Hermès Bélusca-Maïto
3b62a89d4d
[BOOTVID] Don't NTAPI non-exported functions; remove useless @implemented (#6650) 2024-03-23 15:16:00 +01:00
Hermès Bélusca-Maïto
ff790a9111
[BOOTVID] Add file copyright information headers (#6650) 2024-03-23 15:15:41 +01:00
Timo Kreuzer
2185848fc8 [HDAUDBUS] Silence debug spam
- Demote a DPRINT1 to a DPRINT
- Define NDEBUG
2024-03-19 07:43:39 +01:00
Hermès Bélusca-Maïto
14d3b53cc6
[NTFS] Typo fix: "Steam" -> "Stream" 2024-02-22 22:43:40 +01:00
Serge Gautherie
0086d05007
[EXT2FS] Ext2Read(): Complete request on VCB_VOLUME_LOCKED case (#4770)
CORE-10645

Co-authored-by: Victor Martinez Calvo <vicmarcal@gmail.com>
2024-02-21 07:31:09 -08:00
Dmitry Borisov
e6cd9de3f1
[DC21X4] Recognize all ports emulated by VPC 2007 (#6501) 2024-02-16 16:56:07 +01:00
Adam Słaboń
20efea8fa4
[USBSTOR] Fix PdoHandleQueryInstanceId and increase serial number descriptor size to MAXIMUM_USB_STRING_LENGTH (#6413)
Serial number on some USB devices might exceed the number of 100 characters
(e.g. 120 characters on "SanDisk Ultra 3.2Gen1" pendrive) and cause buffer
overflow, resulting in usbstor.sys crash.

- Use pool allocation for instance ID generation.
  Fixes stack overflow on USB storage devices with large serial number.
- Print the LUN number as a hexadecimal, not as a character.
- Verify the serial number descriptor before using it.
- Increase the max descriptor size for serial number to
  MAXIMUM_USB_STRING_LENGTH. This fixes serial number string truncation.

Based on suggestions by disean and ThFabba.

CORE-17625
2024-02-16 18:48:33 +03:00
Hervé Poussineau
0be4e4aa6d [CMBATT] Correctly print UNICODE_STRING 2024-02-05 18:04:01 +01:00
Hervé Poussineau
913235952c [ACPI] Return success even if AcpiInterfaceNotificationsRegister is not implemented
Drivers calling this function still won't be notified in case of event,
but they will at least succeed their initialization.

CORE-18309
2024-02-01 10:08:58 +01:00
Hervé Poussineau
7f1025dcce [CMBATT] Send correct tag on IoAcquireRemoveLock
This prevents an assert in IoReleaseRemoveLock in debug builds, which
already receives the 'Irp' tag.
2024-02-01 10:08:58 +01:00
Hervé Poussineau
6b5ee5ccc7 [BATTC] Make input buffer on IOCTL_BATTERY_QUERY_TAG optional
In that case, don't wait to get battery tag.
2024-02-01 10:08:51 +01:00
Adam Słaboń
823fdb19d7
[SDK][VIRTIO][NETKVM] Make VirtIO a separate library (#6280)
* [SDK][VIRTIO][NETKVM] Make VirtIO a separate library

This is to avoid code duplication when more VirtIO drivers are brought in. This will also be used on development of a VirtIO XDDM GPU Driver.

* [VIRTIO] Sync with upstream
2024-01-16 17:55:35 -08:00
Hervé Poussineau
382836f087 [TCPIP] Remove code duplication to get max link speed, MTU and max packet size
This is already done when link goes up, in ReconfigureAdapter() function.
2024-01-13 15:23:46 +01:00
Hervé Poussineau
89b685007a [TCPIP] Call netif_set_link_up/netif_set_link_down after link status change
- Update TCP cached information only after updating adapter information
  (so that TCPUpdateInterfaceIPInformation/TCPUpdateInterfaceLinkStatus
  gets new status)
- Call netif_set_link_up/netif_set_link_down in TCPUpdateInterfaceLinkStatus

This fixes a lwIP requirement:
  2007-07-13 Jared Grubb (integrated by Frédéric Bernon)
  * [...] Be carefull for port maintainers to add the NETIF_FLAG_LINK_UP
    flag (like in ethernetif.c) if you want to be sure to be compatible with
    future changes...
2024-01-13 15:23:46 +01:00
Hervé Poussineau
3e3d34d97b [TCPIP] Get max link speed, MTU and max packet size when adapter is connected 2024-01-13 15:23:46 +01:00
hpoussin
9cfd8dd918
[LWIP] Correctly synchronize to lwIP 1.4.1 (#6123)
* [TCPIP] Rename lwip library to lwipcore

* [TCPIP] Remove ReactOS-specific code from LWIP library

* [TCPIP] Synchronize LWIP code to 1.4.1

Update to LWIP 1.4.1 should have been done by bd3b0e8ef4
However, I was unable to find the exact revision used in this commit.

So, do the following
- take code from STABLE-1_4_1 commit on https://git.savannah.gnu.org/git/lwip.git
- cherry-pick LWIP 32aa9a41e2013e5ee6eee09317a848647e37badf (CORE-8978)
- cherry-pick LWIP c0b534e5318baf870e2152c70d4d11a3a86181f3
- add a ReactOS-specific change in src/api/tcpip.c (missing include)
- add ReactOS specific file CMakeLists.txt

NOTE: Changes are mostly in unit test files (not used) and CHANGELOG file.

CORE-7140
2023-12-29 13:05:41 +01:00
Hermès Bélusca-Maïto
7b956a0a1f
[BOOTVID] Fix definition of GetFontPtr(). 2023-12-24 21:41:09 +01:00
Adam Słaboń
fcaa38c705
[NETKVM] Don't restrict driver setup to x86 builds (#6221) 2023-12-23 22:00:34 +01:00
Ratin Gao
ffb20d3330
[REACTOS] Fix typos (#6198)
- Adress -> Address
- Currupted -> Corrupted

3rd-party files are not modified.
2023-12-23 21:37:08 +01:00
Serge Gautherie
3558b7b985
[VFATFS] FATGetNextDirEntry(): Fix 1 MSVC 'warning C4267' (#6179)
Fix `warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data`
by explicitly casting to USHORT.
This is OK as the line immediately before NULL-terminates the buffer within boundary.

Addendum to commit 096a69471 (r6279).
2023-12-23 21:24:51 +01:00
Dmitry Borisov
bbe6b07612
[DC21X4] Fix minor issues (#6161)
- The return value got lost when refactoring the setup function
- The check against 0xFFFFFFFF was meant to reject an empty EEPROM image
- Add missing PAGED_CODE(); macros

CORE-8724
2023-12-17 12:00:25 +03:00
Andrei Miloiu
9ecf552fe4
[DRIVERS][INF] Update Romanian (ro-RO) translation (#6088) 2023-12-09 20:19:54 +01:00
Thamatip Chitpong
2dd0c6c32b
[ACPI] Add acpi.rc to CMakeLists (#6089)
Fix missing version info.
2023-12-04 07:17:08 +07:00
Thamatip Chitpong
ea8a49d81f
[PORTCLS] Don't repeat "PORTCLS" module name in version info 2023-11-29 10:31:14 +07:00
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
c6c6c62cb5
[PORTCLS] Remove meaningless YDEBUG (#5858)
Addendum to b77ebc4 (r54584).
Follow-up of #5818.
2023-11-02 13:14:12 +01:00