EndpointMoved == TRUE could never be true, because BOOL is a signed type,
and the only two values in a signed one-bit type are 0 and -1.
Courtesy of VS analysis warning C6299:
Explicitly comparing a bit field to a Boolean type will yield unexpected results.
The source code is licensed under MIT license, taken from
"MSDN Code Gallery Microsoft Samples" repository
(https://github.com/microsoftarchive/msdn-code-gallery-microsoft)
The original license was MS-PL, but the driver was later relicensed
as MIT.
Adopted to ReactOS code base by Michael Stamper.
Co-authored-by: Michael Stamper <michaelstamper1@gmail.com>
Also generate processor identifier properly based on this value
on the Configuration Manager machine-dependent initialization.
Update processor driver INF file accordingly.
CORE-17970 CORE-14922
- Split buffers on page to prevent non-contiguous memory being passed to driver.
- Protect CIrpQueue::GetMappingWithTag, ReleaseMappingWithTag with spinlock to prevent race conditions
(GetMapping, ReleaseMapping do not need spinlock, they are only called from a service routine).
- Remove ASSERT in CIrpQueue::ReleaseMappingWithTag, when mappings are released out of order. Just ignore
the tag argument and release the next one in the list. This is what windows does, confirmed by calling
PortWavePciStream::ReleaseMapping() with tag argument set to 0, absolutly no difference observed.
Allowing out of order release is essential given that a driver is not permitted to hold a spinlock when calling
ReleaseMapping().
- Remove IIrpQueue::HasLastMappingFailed(), it never worked and there is no way it could work.
CPortPinWavePci::HandleKsStream() call MappingAvailable() non-conditionally, this is what Windows does,
verified by debug prints in ac97 driver.
- Implement CIrpQueue::NumData().
- Remove incorrect interlocked operations/volatile variables and several (now unused) class fields.
Changes to specific files and their effects are as follows:
create.cpp - Allows booting past second stage with UDFS media inserted without BSOD
close.cpp - Allows shutdown without hang
dircntrl.cpp - Allows New Hardware Wizard not to hang on initial third phase install
UNIATA is converting IDE identify data into SCSI identify data.
However, IDE model is described with a unique field of 20 chars,
while SCSI model is described with 2 fields of 16 + 8 chars.
When displaying SCSI model, a space is added between vendor and product
fields.
Try to split model into vendor and product on a space if possible.
CORE-17400
Since VS 16.11 the compiler sometimes emits calls to _RTC_UninitUse, when parts of a bitfield are initialized (See https://developercommunity.visualstudio.com/t/Broken-runtime-checks-with-CL-19293013/1503629). Fix this by using an ULONG instead of a bitfield.
Note: The structure uses a 24 bit bitfield plus an UCHAR, which is supposed to form a 32 bit field, but that doesn't work anyway.