mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
[CDROM_NEW]
- Misc build fixes for mingw and msvc with cmake svn path=/trunk/; revision=55669
This commit is contained in:
parent
3fec97b52e
commit
c0f7614fb0
6 changed files with 90 additions and 25 deletions
|
@ -1,5 +1,5 @@
|
|||
|
||||
add_subdirectory(cdrom)
|
||||
add_subdirectory(cdrom_new)
|
||||
add_subdirectory(class2)
|
||||
add_subdirectory(disk)
|
||||
add_subdirectory(disk_new)
|
||||
|
|
15
reactos/drivers/storage/class/cdrom_new/CMakeLists.txt
Normal file
15
reactos/drivers/storage/class/cdrom_new/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
include_directories(..)
|
||||
|
||||
add_library(cdrom_new SHARED cdrom.c data.c ioctl.c mmc.c sec.c)
|
||||
|
||||
target_link_libraries(cdrom_new libcntpr wdmguid)
|
||||
if(ARCH MATCHES i386)
|
||||
if(MSVC)
|
||||
add_target_compile_flags(cdrom_new "/Gz")
|
||||
else()
|
||||
add_target_compile_flags(cdrom_new "-mrtd -fno-builtin -Wno-unused-variable -Wno-pointer-sign")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_module_type(cdrom_new kernelmodedriver)
|
||||
add_importlibs(cdrom_new classpnp ntoskrnl hal)
|
|
@ -114,7 +114,7 @@ Return Value:
|
|||
status = IoAllocateDriverObjectExtension(DriverObject,
|
||||
CDROM_DRIVER_EXTENSION_ID,
|
||||
sizeof(CDROM_DRIVER_EXTENSION),
|
||||
&driverExtension);
|
||||
(PVOID*)&driverExtension);
|
||||
|
||||
if (!NT_SUCCESS(status)) {
|
||||
TraceLog((CdromDebugWarning,
|
||||
|
@ -555,7 +555,7 @@ Return Value:
|
|||
PVOID senseData = NULL;
|
||||
|
||||
ULONG timeOut;
|
||||
PCDROM_DATA cddata;
|
||||
PCDROM_DATA cddata = NULL;
|
||||
|
||||
BOOLEAN changerDevice;
|
||||
BOOLEAN isMmcDevice = FALSE;
|
||||
|
@ -3366,7 +3366,7 @@ Return Value:
|
|||
}
|
||||
|
||||
if ((startingOffset.QuadPart > commonExtension->PartitionLength.QuadPart) ||
|
||||
(transferByteCount & fdoExtension->DiskGeometry.BytesPerSector - 1)) {
|
||||
(transferByteCount & (fdoExtension->DiskGeometry.BytesPerSector - 1))) {
|
||||
|
||||
//
|
||||
// Fail request with status of invalid parameters.
|
||||
|
@ -3390,18 +3390,18 @@ CdRomSwitchModeCompletion(
|
|||
IN PVOID Context
|
||||
)
|
||||
{
|
||||
PFUNCTIONAL_DEVICE_EXTENSION fdoExtension = DeviceObject->DeviceExtension;
|
||||
PCOMMON_DEVICE_EXTENSION commonExtension = DeviceObject->DeviceExtension;
|
||||
|
||||
PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
PCDROM_DATA cdData = (PCDROM_DATA)(commonExtension->DriverData);
|
||||
BOOLEAN use6Byte = TEST_FLAG(cdData->XAFlags, XA_USE_6_BYTE);
|
||||
PIO_STACK_LOCATION realIrpStack;
|
||||
PIO_STACK_LOCATION realIrpNextStack;
|
||||
PSCSI_REQUEST_BLOCK srb = Context;
|
||||
PIRP realIrp = NULL;
|
||||
NTSTATUS status;
|
||||
BOOLEAN retry;
|
||||
PSCSI_REQUEST_BLOCK srb = Context;
|
||||
PFUNCTIONAL_DEVICE_EXTENSION fdoExtension = DeviceObject->DeviceExtension;
|
||||
PCOMMON_DEVICE_EXTENSION commonExtension = DeviceObject->DeviceExtension;
|
||||
PCDROM_DATA cdData = (PCDROM_DATA)(commonExtension->DriverData);
|
||||
PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
BOOLEAN use6Byte = TEST_FLAG(cdData->XAFlags, XA_USE_6_BYTE);
|
||||
ULONG retryCount;
|
||||
|
||||
//
|
||||
// Extract the 'real' irp from the irpstack.
|
||||
|
@ -3454,7 +3454,17 @@ CdRomSwitchModeCompletion(
|
|||
retry = TRUE;
|
||||
}
|
||||
|
||||
if (retry && realIrpNextStack->Parameters.Others.Argument1--) {
|
||||
//
|
||||
// get current retry count
|
||||
//
|
||||
retryCount = PtrToUlong(realIrpNextStack->Parameters.Others.Argument1);
|
||||
|
||||
if (retry && retryCount) {
|
||||
|
||||
//
|
||||
// decrement retryCount and update
|
||||
//
|
||||
realIrpNextStack->Parameters.Others.Argument1 = UlongToPtr(retryCount-1);
|
||||
|
||||
if (((ULONG)(ULONG_PTR)realIrpNextStack->Parameters.Others.Argument1)) {
|
||||
|
||||
|
@ -5923,6 +5933,8 @@ Return Value:
|
|||
ULONG pickDvdRegion;
|
||||
ULONG defaultDvdRegion;
|
||||
ULONG dvdRegion;
|
||||
ULONG a, b;
|
||||
|
||||
|
||||
PAGED_CODE();
|
||||
|
||||
|
@ -5948,8 +5960,7 @@ Return Value:
|
|||
}
|
||||
|
||||
|
||||
ULONG a, b;
|
||||
|
||||
|
||||
a = max(sizeof(DVD_DESCRIPTOR_HEADER) +
|
||||
sizeof(DVD_COPYRIGHT_DESCRIPTOR),
|
||||
sizeof(DVD_READ_STRUCTURE)
|
||||
|
@ -6434,7 +6445,9 @@ Return Value:
|
|||
NTSTATUS
|
||||
|
||||
--*/
|
||||
NTSTATUS
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
CdRomMmcErrorHandler(
|
||||
IN PDEVICE_OBJECT Fdo,
|
||||
IN PSCSI_REQUEST_BLOCK Srb,
|
||||
|
@ -6600,8 +6613,6 @@ CdRomMmcErrorHandler(
|
|||
} // end of SenseKey switch
|
||||
|
||||
} // end of SRB_STATUS_AUTOSENSE_VALID
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*++
|
||||
|
@ -6748,6 +6759,7 @@ Return Value:
|
|||
|
||||
--*/
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
CdRomShutdownFlushCompletion(
|
||||
IN PDEVICE_OBJECT Fdo,
|
||||
IN PIRP NewIrp,
|
||||
|
@ -6836,7 +6848,7 @@ CdRomShutdownFlushCompletion(
|
|||
newIrpStack = IoGetCurrentIrpStackLocation(newIrp);
|
||||
newIrpStack->DeviceObject = Fdo;
|
||||
IoSetCompletionRoutine(newIrp,
|
||||
CdRomShutdownFlushCompletion,
|
||||
(PIO_COMPLETION_ROUTINE)CdRomShutdownFlushCompletion,
|
||||
OriginalIrp,
|
||||
TRUE, TRUE, TRUE);
|
||||
IoSetNextIrpStackLocation(newIrp);
|
||||
|
|
|
@ -45,7 +45,7 @@ typedef enum {
|
|||
CdromDebug = z, // set bit 0x00000000 in nt!kd_cdrom_mask
|
||||
#endif
|
||||
CdromDebugFeatures = 32 // set bit 0x80000000 in nt!kd_cdrom_mask
|
||||
};
|
||||
}CdromError;
|
||||
|
||||
#define CDROM_GET_CONFIGURATION_TIMEOUT (0x4)
|
||||
|
||||
|
@ -744,7 +744,8 @@ CdRomIsDeviceMmcDevice(
|
|||
OUT PBOOLEAN IsMmc
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
VOID
|
||||
NTAPI
|
||||
CdRomMmcErrorHandler(
|
||||
IN PDEVICE_OBJECT Fdo,
|
||||
IN PSCSI_REQUEST_BLOCK Srb,
|
||||
|
|
|
@ -2086,6 +2086,7 @@ CdRomDeviceControlCompletion(
|
|||
|
||||
NTSTATUS status;
|
||||
BOOLEAN retry;
|
||||
ULONG retryCount;
|
||||
|
||||
//
|
||||
// Extract the 'real' irp from the irpstack.
|
||||
|
@ -2231,7 +2232,17 @@ CdRomDeviceControlCompletion(
|
|||
|
||||
}
|
||||
|
||||
if (retry && realIrpNextStack->Parameters.Others.Argument1--) {
|
||||
//
|
||||
// get current retry count
|
||||
//
|
||||
retryCount = PtrToUlong(realIrpNextStack->Parameters.Others.Argument1);
|
||||
|
||||
if (retry && retryCount) {
|
||||
|
||||
//
|
||||
// update retry count
|
||||
//
|
||||
realIrpNextStack->Parameters.Others.Argument1 = UlongToPtr(retryCount-1);
|
||||
|
||||
if (((ULONG)(ULONG_PTR)realIrpNextStack->Parameters.Others.Argument1)) {
|
||||
|
||||
|
@ -2844,6 +2855,7 @@ CdRomSetVolumeIntermediateCompletion(
|
|||
PIRP realIrp = NULL;
|
||||
NTSTATUS status;
|
||||
BOOLEAN retry;
|
||||
ULONG retryCount;
|
||||
|
||||
//
|
||||
// Extract the 'real' irp from the irpstack.
|
||||
|
@ -2901,7 +2913,18 @@ CdRomSetVolumeIntermediateCompletion(
|
|||
retry = TRUE;
|
||||
}
|
||||
|
||||
if (retry && realIrpNextStack->Parameters.Others.Argument1--) {
|
||||
//
|
||||
// get current retry count
|
||||
//
|
||||
retryCount = PtrToUlong(realIrpNextStack->Parameters.Others.Argument1);
|
||||
|
||||
if (retry && retryCount) {
|
||||
|
||||
//
|
||||
// update retry count
|
||||
//
|
||||
realIrpNextStack->Parameters.Others.Argument1 = UlongToPtr(retryCount-1);
|
||||
|
||||
|
||||
if (((ULONG)(ULONG_PTR)realIrpNextStack->Parameters.Others.Argument1)) {
|
||||
|
||||
|
|
|
@ -837,6 +837,7 @@ CdRompPrintAllFeaturePages(
|
|||
}
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
CdRomUpdateMmcDriveCapabilitiesCompletion(
|
||||
IN PDEVICE_OBJECT Unused,
|
||||
IN PIRP Irp,
|
||||
|
@ -851,6 +852,9 @@ CdRomUpdateMmcDriveCapabilitiesCompletion(
|
|||
PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
NTSTATUS status = STATUS_UNSUCCESSFUL;
|
||||
PIRP delayedIrp;
|
||||
ULONG retryCount;
|
||||
LARGE_INTEGER delay;
|
||||
|
||||
|
||||
// completion routine should retry as neccessary.
|
||||
// when success, clear the flag to allow startio to proceed.
|
||||
|
@ -910,9 +914,19 @@ CdRomUpdateMmcDriveCapabilitiesCompletion(
|
|||
retry = TRUE;
|
||||
}
|
||||
|
||||
if (retry && irpStack->Parameters.Others.Argument4--) {
|
||||
//
|
||||
// get current retry count
|
||||
//
|
||||
retryCount = PtrToUlong(irpStack->Parameters.Others.Argument1);
|
||||
|
||||
if (retry && retryCount) {
|
||||
|
||||
//
|
||||
// update retry count
|
||||
//
|
||||
irpStack->Parameters.Others.Argument1 = UlongToPtr(retryCount-1);
|
||||
|
||||
|
||||
LARGE_INTEGER delay;
|
||||
delay.QuadPart = retryInterval;
|
||||
delay.QuadPart *= (LONGLONG)1000 * 1000 * 10;
|
||||
|
||||
|
@ -1038,7 +1052,7 @@ CdRomPrepareUpdateCapabilitiesIrp(
|
|||
nextStack->Parameters.Scsi.Srb = srb;
|
||||
irp->MdlAddress = mmcData->CapabilitiesMdl;
|
||||
irp->AssociatedIrp.SystemBuffer = mmcData->CapabilitiesBuffer;
|
||||
IoSetCompletionRoutine(irp, CdRomUpdateMmcDriveCapabilitiesCompletion, Fdo,
|
||||
IoSetCompletionRoutine(irp, (PIO_COMPLETION_ROUTINE)CdRomUpdateMmcDriveCapabilitiesCompletion, Fdo,
|
||||
TRUE, TRUE, TRUE);
|
||||
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue