ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2007
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
287 discussions
Start a n
N
ew thread
[dgorbachev] 26223: Fix the bug introduced in r26219.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sun Apr 1 02:18:16 2007 New Revision: 26223 URL:
http://svn.reactos.org/svn/reactos?rev=26223&view=rev
Log: Fix the bug introduced in r26219. Modified: trunk/reactos/drivers/filesystems/np/fsctrl.c Modified: trunk/reactos/drivers/filesystems/np/fsctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/np/fsc…
============================================================================== --- trunk/reactos/drivers/filesystems/np/fsctrl.c (original) +++ trunk/reactos/drivers/filesystems/np/fsctrl.c Sun Apr 1 02:18:16 2007 @@ -81,6 +81,9 @@ NpfsConnectPipe(PIRP Irp, PNPFS_CCB Ccb) { + PIO_STACK_LOCATION IoStack; + PFILE_OBJECT FileObject; + ULONG Flags; PLIST_ENTRY current_entry; PNPFS_FCB Fcb; PNPFS_CCB ClientCcb; @@ -100,6 +103,9 @@ DPRINT("Waiting for connection...\n"); Fcb = Ccb->Fcb; + IoStack = IoGetCurrentIrpStackLocation(Irp); + FileObject = IoStack->FileObject; + Flags = FileObject->Flags; /* search for a listening client fcb */ KeLockMutex(&Fcb->CcbListLock); @@ -157,17 +163,13 @@ KeUnlockMutex(&Fcb->CcbListLock); + if (Flags & FO_SYNCHRONOUS_IO) { - PIO_STACK_LOCATION IoStack = IoGetCurrentIrpStackLocation(Irp); - PFILE_OBJECT FileObject = IoStack->FileObject; - if (FileObject->Flags & FO_SYNCHRONOUS_IO) - { - KeWaitForSingleObject(&Ccb->ConnectEvent, - UserRequest, - KernelMode, - FALSE, - NULL); - } + KeWaitForSingleObject(&Ccb->ConnectEvent, + UserRequest, + KernelMode, + FALSE, + NULL); } DPRINT("NpfsConnectPipe() done (Status %lx)\n", Status);
17 years, 8 months
1
0
0
0
[fireball] 26222: - Fix a few obvious bugs (incorrect DeviceExtension pointer arithmetic, non-initialized field usage). - Packets are sequentially numbered. Now all devices are perfectly enumerated (SpBuildDeviceMap() may still need work, but later), and problem occurs later when servicing IOCTLs.
by fireball@svn.reactos.org
Author: fireball Date: Sun Apr 1 00:47:42 2007 New Revision: 26222 URL:
http://svn.reactos.org/svn/reactos?rev=26222&view=rev
Log: - Fix a few obvious bugs (incorrect DeviceExtension pointer arithmetic, non-initialized field usage). - Packets are sequentially numbered. Now all devices are perfectly enumerated (SpBuildDeviceMap() may still need work, but later), and problem occurs later when servicing IOCTLs. Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport.c (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport.c Sun Apr 1 00:47:42 2007 @@ -318,7 +318,10 @@ //DPRINT("ScsiPortFreeDeviceBase() called\n"); - DeviceExtension = ((PSCSI_PORT_DEVICE_EXTENSION)HwDeviceExtension) - 1; + DeviceExtension = CONTAINING_RECORD(HwDeviceExtension, + SCSI_PORT_DEVICE_EXTENSION, + MiniPortDeviceExtension); + /* Initialize our pointers */ NextMa = DeviceExtension->MappedAddressList; @@ -394,7 +397,9 @@ //DPRINT ("ScsiPortGetDeviceBase() called\n"); - DeviceExtension = ((PSCSI_PORT_DEVICE_EXTENSION)HwDeviceExtension) - 1; + DeviceExtension = CONTAINING_RECORD(HwDeviceExtension, + SCSI_PORT_DEVICE_EXTENSION, + MiniPortDeviceExtension); AddressSpace = (ULONG)InIoSpace; if (HalTranslateBusAddress(BusType, @@ -901,7 +906,7 @@ /* Fill Device Extension */ DeviceExtension = PortDeviceObject->DeviceExtension; - + DPRINT1("DeviceExtension: %p\n", DeviceExtension); DeviceExtension->Length = DeviceExtensionSize; DeviceExtension->DeviceObject = PortDeviceObject; DeviceExtension->PortNumber = SystemConfig->ScsiPortCount; @@ -1656,7 +1661,6 @@ Srb = (PSCSI_REQUEST_BLOCK) va_arg (ap, PSCSI_REQUEST_BLOCK); DPRINT("Notify: RequestComplete (Srb %p)\n", Srb); - // DeviceExtension->IrpFlags |= IRP_FLAG_COMPLETE; /* Make sure Srb is allright */ ASSERT(Srb->SrbStatus != SRB_STATUS_PENDING); @@ -2456,7 +2460,15 @@ Srb->QueueTag = SP_UNTAGGED; } - /* FIXME: Increase sequence number here of SRB, if it's ever needed */ + /* Increase sequence number of SRB */ + if (!SrbInfo->SequenceNumber) + { + /* Increase global sequence number */ + DeviceExtension->SequenceNumber++; + + /* Assign it */ + SrbInfo->SequenceNumber = DeviceExtension->SequenceNumber; + } /* Check some special SRBs */ if (Srb->Function == SRB_FUNCTION_ABORT_COMMAND) @@ -2656,7 +2668,7 @@ /* Call HwStartIo routine */ Result = DeviceExtension->HwStartIo(&DeviceExtension->MiniPortDeviceExtension, - Srb); + Srb); /* If notification is needed, then request a DPC */ if (DeviceExtension->InterruptData.Flags & SCSI_PORT_NOTIFICATION_NEEDED) @@ -2697,7 +2709,8 @@ /* Initialize timeout counter */ LunExtension->RequestTimeout = -1; - /* TODO: Initialize other fields */ + /* Set maximum queue size */ + LunExtension->MaxQueueCount = 256; /* Initialize request queue */ KeInitializeDeviceQueue (&LunExtension->DeviceQueue); Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h Sun Apr 1 00:47:42 2007 @@ -206,6 +206,7 @@ ULONG MaxLunCount; KSPIN_LOCK IrqLock; /* Used when there are 2 irqs */ + ULONG SequenceNumber; /* Global sequence number for packets */ KSPIN_LOCK SpinLock; PKINTERRUPT Interrupt; PIRP CurrentIrp;
17 years, 8 months
1
0
0
0
[fireball] 26221: - Implement timeouts / retrying after timeout.
by fireball@svn.reactos.org
Author: fireball Date: Sun Apr 1 00:03:07 2007 New Revision: 26221 URL:
http://svn.reactos.org/svn/reactos?rev=26221&view=rev
Log: - Implement timeouts / retrying after timeout. Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport.c (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport.c Sun Apr 1 00:03:07 2007 @@ -4221,6 +4221,74 @@ DPRINT("ScsiPortDpcForIsr() done\n"); } +BOOLEAN +STDCALL +SpiProcessTimeout(PVOID ServiceContext) +{ + PDEVICE_OBJECT DeviceObject = (PDEVICE_OBJECT)ServiceContext; + PSCSI_PORT_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension; + ULONG Bus; + + DPRINT("SpiProcessTimeout() entered\n"); + + DeviceExtension->TimerCount = -1; + + if (DeviceExtension->InterruptData.Flags & SCSI_PORT_RESET) + { + DeviceExtension->InterruptData.Flags &= ~SCSI_PORT_RESET; + + if (DeviceExtension->InterruptData.Flags & SCSI_PORT_RESET_REQUEST) + { + DeviceExtension->InterruptData.Flags &= ~SCSI_PORT_RESET_REQUEST; + ScsiPortStartPacket(ServiceContext); + } + + return FALSE; + } + else + { + DPRINT("Resetting the bus\n"); + + for (Bus = 0; Bus < DeviceExtension->BusNum; Bus++) + { + DeviceExtension->HwResetBus(DeviceExtension->MiniPortDeviceExtension, Bus); + + /* Reset flags and set reset timeout to 4 seconds */ + DeviceExtension->InterruptData.Flags |= SCSI_PORT_RESET; + DeviceExtension->TimerCount = 4; + } + + /* If miniport requested - request a dpc for it */ + if (DeviceExtension->InterruptData.Flags & SCSI_PORT_NOTIFICATION_NEEDED) + IoRequestDpc(DeviceExtension->DeviceObject, NULL, NULL); + } + + return TRUE; +} + + +BOOLEAN +STDCALL +SpiResetBus(PVOID ServiceContext) +{ + PRESETBUS_PARAMS ResetParams = (PRESETBUS_PARAMS)ServiceContext; + PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; + + /* Perform the bus reset */ + DeviceExtension = (PSCSI_PORT_DEVICE_EXTENSION)ResetParams->DeviceExtension; + DeviceExtension->HwResetBus(DeviceExtension->MiniPortDeviceExtension, + ResetParams->PathId); + + /* Set flags and start the timer */ + DeviceExtension->InterruptData.Flags |= SCSI_PORT_RESET; + DeviceExtension->TimerCount = 4; + + /* If miniport requested - give him a DPC */ + if (DeviceExtension->InterruptData.Flags & SCSI_PORT_NOTIFICATION_NEEDED) + IoRequestDpc(DeviceExtension->DeviceObject, NULL, NULL); + + return TRUE; +} // ScsiPortIoTimer // DESCRIPTION: @@ -4235,9 +4303,102 @@ // static VOID STDCALL ScsiPortIoTimer(PDEVICE_OBJECT DeviceObject, - PVOID Context) + PVOID Context) { - DPRINT1("ScsiPortIoTimer()\n"); + PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; + PSCSI_PORT_LUN_EXTENSION LunExtension; + ULONG Lun; + PIRP Irp; + + DPRINT("ScsiPortIoTimer()\n"); + + DeviceExtension = (PSCSI_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + /* Protect with the spinlock */ + KeAcquireSpinLockAtDpcLevel(&DeviceExtension->SpinLock); + + /* Check timeouts */ + if (DeviceExtension->TimerCount > 0) + { + /* Decrease the timeout counter */ + DeviceExtension->TimerCount--; + + if (DeviceExtension->TimerCount == 0) + { + /* Timeout, process it */ + if (KeSynchronizeExecution(DeviceExtension->Interrupt, + SpiProcessTimeout, + DeviceExtension->DeviceObject)) + { + DPRINT("Error happened during processing timeout, but nothing critical\n"); + } + } + + KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock); + + /* We should exit now, since timeout is processed */ + return; + } + + /* Per-Lun scanning of timeouts is needed... */ + for (Lun = 0; Lun < LUS_NUMBER; Lun++) + { + LunExtension = DeviceExtension->LunExtensionList[Lun]; + + while (LunExtension) + { + if (LunExtension->Flags & LUNEX_BUSY) + { + if (!(LunExtension->Flags & + (LUNEX_NEED_REQUEST_SENSE | LUNEX_FROZEN_QUEUE))) + { + DPRINT("Retrying busy request\n"); + + /* Clear flags, and retry busy request */ + LunExtension->Flags &= ~(LUNEX_BUSY | LUNEX_FULL_QUEUE); + Irp = LunExtension->BusyRequest; + + /* Clearing busy request */ + LunExtension->BusyRequest = NULL; + + KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock); + + IoStartPacket(DeviceObject, Irp, (PULONG)NULL, NULL); + + KeAcquireSpinLockAtDpcLevel(&DeviceExtension->SpinLock); + } + } + else if (LunExtension->RequestTimeout == 0) + { + RESETBUS_PARAMS ResetParams; + + LunExtension->RequestTimeout = -1; + + DPRINT("Request timed out, resetting bus\n"); + + /* Pass params to the bus reset routine */ + ResetParams.PathId = LunExtension->PathId; + ResetParams.DeviceExtension = DeviceExtension; + + if (!KeSynchronizeExecution(DeviceExtension->Interrupt, + SpiResetBus, + &ResetParams)) + { + DPRINT1("Reset failed\n"); + } + } + else if (LunExtension->RequestTimeout > 0) + { + /* Decrement the timeout counter */ + LunExtension->RequestTimeout--; + } + + LunExtension = LunExtension->Next; + } + } + + /* Release the spinlock */ + KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock); } #if 0 Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h Sun Apr 1 00:03:07 2007 @@ -277,3 +277,9 @@ UCHAR MiniPortDeviceExtension[1]; /* must be the last entry */ } SCSI_PORT_DEVICE_EXTENSION, *PSCSI_PORT_DEVICE_EXTENSION; + +typedef struct _RESETBUS_PARAMS +{ + ULONG PathId; + PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; +} RESETBUS_PARAMS, *PRESETBUS_PARAMS;
17 years, 8 months
1
0
0
0
[fireball] 26220: - Finish ScsiPortInitialize() refactoring / improving. Only DMA stuff and 2-interrupts case are missing now.
by fireball@svn.reactos.org
Author: fireball Date: Sat Mar 31 22:37:07 2007 New Revision: 26220 URL:
http://svn.reactos.org/svn/reactos?rev=26220&view=rev
Log: - Finish ScsiPortInitialize() refactoring / improving. Only DMA stuff and 2-interrupts case are missing now. Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport.c (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport.c Sat Mar 31 22:37:07 2007 @@ -193,6 +193,13 @@ SpiResourceToConfig(IN PHW_INITIALIZATION_DATA HwInitializationData, IN PCM_FULL_RESOURCE_DESCRIPTOR ResourceDescriptor, IN PPORT_CONFIGURATION_INFORMATION PortConfig); + +static PCM_RESOURCE_LIST +SpiConfigToResource(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, + PPORT_CONFIGURATION_INFORMATION PortConfig); + +static VOID +SpiCleanupAfterInit(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension); /* FUNCTIONS *****************************************************************/ @@ -780,7 +787,7 @@ { PDRIVER_OBJECT DriverObject = (PDRIVER_OBJECT)Argument1; PUNICODE_STRING RegistryPath = (PUNICODE_STRING)Argument2; - PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; + PSCSI_PORT_DEVICE_EXTENSION DeviceExtension = NULL; PCONFIGURATION_INFORMATION SystemConfig; PPORT_CONFIGURATION_INFORMATION PortConfig; PORT_CONFIGURATION_INFORMATION InitialPortConfig; @@ -793,7 +800,7 @@ ULONG Result; NTSTATUS Status; ULONG MaxBus; - ULONG BusNumber; + ULONG BusNumber = 0; PCI_SLOT_NUMBER SlotNumber; PDEVICE_OBJECT PortDeviceObject; @@ -806,6 +813,9 @@ KIRQL Dirql; KAFFINITY Affinity; + PCM_RESOURCE_LIST ResourceList; + BOOLEAN Conflict; + DPRINT ("ScsiPortInitialize() called!\n"); @@ -854,12 +864,8 @@ DeviceExtensionSize = sizeof(SCSI_PORT_DEVICE_EXTENSION) + HwInitializationData->DeviceExtensionSize; - MaxBus = (HwInitializationData->AdapterInterfaceType == PCIBus) ? 8 : 1; - DPRINT("MaxBus: %lu\n", MaxBus); - - PortDeviceObject = NULL; - BusNumber = 0; - SlotNumber.u.AsULONG = 0; + MaxBus = (HwInitializationData->AdapterInterfaceType == PCIBus) ? 8 : 1; + DPRINT("MaxBus: %lu\n", MaxBus); while (TRUE) { @@ -901,6 +907,7 @@ DeviceExtension->PortNumber = SystemConfig->ScsiPortCount; /* Driver's routines... */ + DeviceExtension->HwInitialize = HwInitializationData->HwInitialize; DeviceExtension->HwStartIo = HwInitializationData->HwStartIo; DeviceExtension->HwInterrupt = HwInitializationData->HwInterrupt; DeviceExtension->HwResetBus = HwInitializationData->HwResetBus; @@ -1022,188 +1029,547 @@ Again = FALSE; goto CreatePortConfig; } + + if (!PortConfig->BusInterruptLevel) + { + /* Bypass this slot, because no interrupt was assigned */ + DeviceExtension->PortConfig = NULL; + ExFreePool(PortConfig); + goto CreatePortConfig; + } } - - - - + else + { + DPRINT("Non-pci bus\n"); + } /* Note: HwFindAdapter is called once for each bus */ Again = FALSE; DPRINT("Calling HwFindAdapter() for Bus %lu\n", PortConfig->SystemIoBusNumber); Result = (HwInitializationData->HwFindAdapter)(&DeviceExtension->MiniPortDeviceExtension, - HwContext, - 0, /* BusInformation */ - "", /* ArgumentString */ - PortConfig, - &Again); + HwContext, + 0, /* BusInformation */ + ConfigInfo.Parameter, /* ArgumentString */ + PortConfig, + &Again); + DPRINT("HwFindAdapter() Result: %lu Again: %s\n", - Result, (Again) ? "True" : "False"); - - if (Result == SP_RETURN_FOUND) - { - DPRINT("ScsiPortInitialize(): Found HBA! (%x)\n", PortConfig->BusInterruptVector); - - /* Register an interrupt handler for this device */ - MappedIrq = HalGetInterruptVector(PortConfig->AdapterInterfaceType, - PortConfig->SystemIoBusNumber, - PortConfig->BusInterruptLevel, - PortConfig->BusInterruptVector, - &Dirql, - &Affinity); - Status = IoConnectInterrupt(&DeviceExtension->Interrupt, - ScsiPortIsr, - DeviceExtension, - &DeviceExtension->SpinLock, - MappedIrq, - Dirql, - Dirql, - PortConfig->InterruptMode, - TRUE, - Affinity, - FALSE); - if (!NT_SUCCESS(Status)) - { - DbgPrint("Could not connect interrupt %d\n", - PortConfig->BusInterruptVector); - goto ByeBye; - } - - /* Set flag that it's allowed to disconnect during this command */ - DeviceExtension->Flags |= SCSI_PORT_DISCONNECT_ALLOWED; - - /* Initialize counter of active requests (-1 means there are none) */ - DeviceExtension->ActiveRequestCounter = -1; - - if (!(HwInitializationData->HwInitialize)(&DeviceExtension->MiniPortDeviceExtension)) - { - DbgPrint("HwInitialize() failed!"); - Status = STATUS_UNSUCCESSFUL; - goto ByeBye; - } - - /* Initialize port capabilities */ - DeviceExtension->PortCapabilities = ExAllocatePool(NonPagedPool, - sizeof(IO_SCSI_CAPABILITIES)); - if (DeviceExtension->PortCapabilities == NULL) - { - DbgPrint("Failed to allocate port capabilities!\n"); - Status = STATUS_INSUFFICIENT_RESOURCES; - goto ByeBye; - } - - PortCapabilities = DeviceExtension->PortCapabilities; - PortCapabilities->Length = sizeof(IO_SCSI_CAPABILITIES); - PortCapabilities->MaximumTransferLength = - PortConfig->MaximumTransferLength; - PortCapabilities->MaximumPhysicalPages = - PortCapabilities->MaximumTransferLength / PAGE_SIZE; - PortCapabilities->SupportedAsynchronousEvents = 0; /* FIXME */ - PortCapabilities->AlignmentMask = - PortConfig->AlignmentMask; - PortCapabilities->TaggedQueuing = - PortConfig->TaggedQueuing; - PortCapabilities->AdapterScansDown = - PortConfig->AdapterScansDown; - PortCapabilities->AdapterUsesPio = TRUE; /* FIXME */ - - /* Initialize bus scanning information */ - DeviceExtension->BusesConfig = ExAllocatePool(PagedPool, - sizeof(PSCSI_BUS_SCAN_INFO) * DeviceExtension->PortConfig->NumberOfBuses - + sizeof(ULONG)); - - if (!DeviceExtension->BusesConfig) + Result, (Again) ? "True" : "False"); + + /* Free MapRegisterBase, it's not needed anymore */ + if (DeviceExtension->MapRegisterBase != NULL) + { + ExFreePool(DeviceExtension->MapRegisterBase); + DeviceExtension->MapRegisterBase = NULL; + } + + /* If result is nothing good... */ + if (Result != SP_RETURN_FOUND) + { + DPRINT("HwFindAdapter() Result: %lu\n", Result); + + if (Result == SP_RETURN_NOT_FOUND) { - DPRINT1("Out of resources!\n"); - Status = STATUS_INSUFFICIENT_RESOURCES; - goto ByeBye; + /* We can continue on the next bus */ + ConfigInfo.BusNumber++; + Again = FALSE; + + DeviceExtension->PortConfig = NULL; + ExFreePool(PortConfig); + goto CreatePortConfig; } - /* Zero it */ - RtlZeroMemory(DeviceExtension->BusesConfig, - sizeof(PSCSI_BUS_SCAN_INFO) * DeviceExtension->PortConfig->NumberOfBuses - + sizeof(ULONG)); - - /* Store number of buses there */ - DeviceExtension->BusesConfig->NumberOfBuses = DeviceExtension->PortConfig->NumberOfBuses; - - /* Scan the adapter for devices */ - SpiScanAdapter (DeviceExtension); - - /* Build the registry device map */ - SpiBuildDeviceMap (DeviceExtension, - (PUNICODE_STRING)Argument2); - - /* Create the dos device link */ - swprintf(DosNameBuffer, - L"\\??\\Scsi%lu:", - SystemConfig->ScsiPortCount); - RtlInitUnicodeString(&DosDeviceName, - DosNameBuffer); - IoCreateSymbolicLink(&DosDeviceName, - &DeviceName); - - /* Update the system configuration info */ - if (PortConfig->AtdiskPrimaryClaimed == TRUE) - SystemConfig->AtDiskPrimaryAddressClaimed = TRUE; - if (PortConfig->AtdiskSecondaryClaimed == TRUE) - SystemConfig->AtDiskSecondaryAddressClaimed = TRUE; - - SystemConfig->ScsiPortCount++; - PortDeviceObject = NULL; - DeviceFound = TRUE; - } + /* Otherwise, break */ + Status = STATUS_INTERNAL_ERROR; + break; + } + + DPRINT("ScsiPortInitialize(): Found HBA! (%x), adapter Id %d\n", + PortConfig->BusInterruptVector, PortConfig->InitiatorBusId[0]); + + /* If the SRB extension size was updated */ + if (!DeviceExtension->NonCachedExtension && + (PortConfig->SrbExtensionSize != DeviceExtension->SrbExtensionSize)) + { + /* Set it (rounding to LONGLONG again) */ + DeviceExtension->SrbExtensionSize = + (PortConfig->SrbExtensionSize + + sizeof(LONGLONG)) & ~(sizeof(LONGLONG) - 1); + } + + /* The same with LUN extension size */ + if (PortConfig->SpecificLuExtensionSize != DeviceExtension->LunExtensionSize) + DeviceExtension->LunExtensionSize = PortConfig->SpecificLuExtensionSize; + + + if (!((HwInitializationData->AdapterInterfaceType == PCIBus) && + (HwInitializationData->VendorIdLength > 0) && + (HwInitializationData->VendorId != NULL) && + (HwInitializationData->DeviceIdLength > 0) && + (HwInitializationData->DeviceId != NULL))) + { + /* Construct a resource list */ + ResourceList = SpiConfigToResource(DeviceExtension, + PortConfig); + + if (ResourceList) + { + UNICODE_STRING UnicodeString; + RtlInitUnicodeString(&UnicodeString, L"ScsiAdapter"); + DPRINT("Reporting resources\n"); + Status = IoReportResourceUsage(&UnicodeString, + DriverObject, + NULL, + 0, + PortDeviceObject, + ResourceList, + FIELD_OFFSET(CM_RESOURCE_LIST, + List[0].PartialResourceList.PartialDescriptors) + + ResourceList->List[0].PartialResourceList.Count + * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR), + FALSE, + &Conflict); + ExFreePool(ResourceList); + + /* In case of a failure or a conflict, break */ + if (Conflict || (!NT_SUCCESS(Status))) + { + if (Conflict) + Status = STATUS_CONFLICTING_ADDRESSES; + break; + } + } + } + + /* Reset the Conflict var */ + Conflict = FALSE; + + /* Copy all stuff which we ever need from PortConfig to the DeviceExtension */ + if (PortConfig->MaximumNumberOfTargets > SCSI_MAXIMUM_TARGETS_PER_BUS) + DeviceExtension->MaxTargedIds = SCSI_MAXIMUM_TARGETS_PER_BUS; else - { - DPRINT("HwFindAdapter() Result: %lu\n", Result); - - ExFreePool (PortConfig); - IoDeleteDevice (PortDeviceObject); - PortDeviceObject = NULL; - } + DeviceExtension->MaxTargedIds = PortConfig->MaximumNumberOfTargets; + + DeviceExtension->BusNum = PortConfig->NumberOfBuses; + DeviceExtension->CachesData = PortConfig->CachesData; + DeviceExtension->ReceiveEvent = PortConfig->ReceiveEvent; + DeviceExtension->SupportsTaggedQueuing = PortConfig->TaggedQueuing; + DeviceExtension->MultipleReqsPerLun = PortConfig->MultipleRequestPerLu; + + /* If something was disabled via registry - apply it */ + if (ConfigInfo.DisableMultipleLun) + DeviceExtension->MultipleReqsPerLun = PortConfig->MultipleRequestPerLu = FALSE; + + if (ConfigInfo.DisableTaggedQueueing) + DeviceExtension->SupportsTaggedQueuing = PortConfig->MultipleRequestPerLu = FALSE; + + /* Check if we need to alloc SRB data */ + if (DeviceExtension->SupportsTaggedQueuing || + DeviceExtension->MultipleReqsPerLun) + { + DeviceExtension->NeedSrbDataAlloc = TRUE; + } + else + { + DeviceExtension->NeedSrbDataAlloc = FALSE; + } + + /* Get a pointer to the port capabilities */ + PortCapabilities = &DeviceExtension->PortCapabilities; + + /* Copy one field there */ + DeviceExtension->MapBuffers = PortConfig->MapBuffers; + PortCapabilities->AdapterUsesPio = PortConfig->MapBuffers; + + if (DeviceExtension->AdapterObject == NULL && + (PortConfig->DmaChannel != SP_UNINITIALIZED_VALUE || PortConfig->Master)) + { + DPRINT1("DMA is not supported yet\n"); + ASSERT(FALSE); + } + + if (DeviceExtension->SrbExtensionBuffer == NULL && + (DeviceExtension->SrbExtensionSize != 0 || + PortConfig->AutoRequestSense)) + { + DeviceExtension->SupportsAutoSense = PortConfig->AutoRequestSense; + DeviceExtension->NeedSrbExtensionAlloc = TRUE; + + //Status = STATUS_UNSUCCESFUL; + /* TODO: Allocate common buffer */ + ASSERT(FALSE); + + /* Check for failure */ + if (!NT_SUCCESS(Status)) + break; + } + + /* Allocate SrbData, if needed */ + if (DeviceExtension->NeedSrbDataAlloc) + { + ULONG Count; + PSCSI_REQUEST_BLOCK_INFO SrbData; + + if (DeviceExtension->SrbDataCount != 0) + Count = DeviceExtension->SrbDataCount; + else + Count = DeviceExtension->RequestsNumber * 2; + + /* Allocate the data */ + SrbData = ExAllocatePool(NonPagedPool, Count * sizeof(SCSI_REQUEST_BLOCK_INFO)); + if (SrbData == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + RtlZeroMemory(SrbData, Count * sizeof(SCSI_REQUEST_BLOCK_INFO)); + + DeviceExtension->SrbInfo = SrbData; + DeviceExtension->FreeSrbInfo = SrbData; + DeviceExtension->SrbDataCount = Count; + + /* Link it to the list */ + while (Count > 0) + { + SrbData->Requests.Flink = (PLIST_ENTRY)(SrbData + 1); + SrbData++; + Count--; + } + + /* Mark the last entry of the list */ + SrbData--; + SrbData->Requests.Flink = NULL; + } + + /* Initialize port capabilities */ + PortCapabilities = &DeviceExtension->PortCapabilities; + PortCapabilities->Length = sizeof(IO_SCSI_CAPABILITIES); + PortCapabilities->MaximumTransferLength = PortConfig->MaximumTransferLength; + + if (PortConfig->ReceiveEvent) + PortCapabilities->SupportedAsynchronousEvents |= SRBEV_SCSI_ASYNC_NOTIFICATION; + + PortCapabilities->TaggedQueuing = DeviceExtension->SupportsTaggedQueuing; + PortCapabilities->AdapterScansDown = PortConfig->AdapterScansDown; + + if (PortConfig->AlignmentMask > PortDeviceObject->AlignmentRequirement) + PortDeviceObject->AlignmentRequirement = PortConfig->AlignmentMask; + + PortCapabilities->AlignmentMask = PortDeviceObject->AlignmentRequirement; + + if (PortCapabilities->MaximumPhysicalPages == 0) + { + PortCapabilities->MaximumPhysicalPages = + BYTES_TO_PAGES(PortCapabilities->MaximumTransferLength); + + /* Apply miniport's limits */ + if (PortConfig->NumberOfPhysicalBreaks < PortCapabilities->MaximumPhysicalPages) + { + PortCapabilities->MaximumPhysicalPages = PortConfig->NumberOfPhysicalBreaks; + } + } + + /* Deal with interrupts */ + if (DeviceExtension->HwInterrupt == NULL || + (PortConfig->BusInterruptLevel == 0 && PortConfig->BusInterruptVector == 0)) + { + /* No interrupts */ + KeInitializeSpinLock(&DeviceExtension->IrqLock); + + /* FIXME: Use synchronization routine */ + ASSERT("No interrupts branch requires changes in synchronization\n"); + + DeviceExtension->Interrupt = (PVOID)DeviceExtension; + DPRINT("No interrupts\n"); + + } + else + { + /* Are 2 interrupts needed? */ + if (DeviceExtension->HwInterrupt != NULL && + (PortConfig->BusInterruptLevel != 0 || PortConfig->BusInterruptVector != 0) && + (PortConfig->BusInterruptLevel2 != 0 || PortConfig->BusInterruptVector2 != 0)) + { + DPRINT1("2 interrupts requested! Not yet supported\n"); + ASSERT(FALSE); + } + else + { + BOOLEAN InterruptShareable; + + /* No, only 1 interrupt */ + DPRINT("1 interrupt, IRQ is %d\n", PortConfig->BusInterruptLevel); + + DeviceExtension->InterruptLevel = PortConfig->BusInterruptLevel; + + /* Register an interrupt handler for this device */ + MappedIrq = HalGetInterruptVector(PortConfig->AdapterInterfaceType, + PortConfig->SystemIoBusNumber, + PortConfig->BusInterruptLevel, + PortConfig->BusInterruptVector, + &Dirql, + &Affinity); + + /* Determing IRQ sharability as usual */ + if (PortConfig->AdapterInterfaceType == MicroChannel || + PortConfig->InterruptMode == LevelSensitive) + { + InterruptShareable = TRUE; + } + else + { + InterruptShareable = FALSE; + } + + Status = IoConnectInterrupt(&DeviceExtension->Interrupt, + (PKSERVICE_ROUTINE)ScsiPortIsr, + DeviceExtension, + NULL, + MappedIrq, + Dirql, + Dirql, + PortConfig->InterruptMode, + InterruptShareable, + Affinity, + FALSE); + + if (!(NT_SUCCESS(Status))) + { + DPRINT1("Could not connect interrupt %d\n", + PortConfig->BusInterruptVector); + DeviceExtension->Interrupt = NULL; + break; + } + + } + } + + /* Save IoAddress (from access ranges) */ + if (HwInitializationData->NumberOfAccessRanges != 0) + { + DeviceExtension->IoAddress = + ((*(PortConfig->AccessRanges))[0]).RangeStart.LowPart; + + DPRINT("Io Address %x\n", DeviceExtension->IoAddress); + } + + /* Set flag that it's allowed to disconnect during this command */ + DeviceExtension->Flags |= SCSI_PORT_DISCONNECT_ALLOWED; + + /* Initialize counter of active requests (-1 means there are none) */ + DeviceExtension->ActiveRequestCounter = -1; + + /* Analyze what we have about DMA */ + if (DeviceExtension->AdapterObject != NULL && + PortConfig->Master && + PortConfig->NeedPhysicalAddresses) + { + DeviceExtension->MapRegisters = TRUE; + } + else + { + DeviceExtension->MapRegisters = FALSE; + } + + /* Call HwInitialize at DISPATCH_LEVEL */ + KeRaiseIrql(DISPATCH_LEVEL, &Dirql); + + if (!KeSynchronizeExecution(DeviceExtension->Interrupt, + DeviceExtension->HwInitialize, + DeviceExtension->MiniPortDeviceExtension)) + { + DPRINT1("HwInitialize() failed!\n"); + KeLowerIrql(Dirql); + Status = STATUS_ADAPTER_HARDWARE_ERROR; + break; + } + + /* Check if a notification is needed */ + if (DeviceExtension->InterruptData.Flags & SCSI_PORT_NOTIFICATION_NEEDED) + { + /* Call DPC right away, because we're already at DISPATCH_LEVEL */ + ScsiPortDpcForIsr(NULL, + DeviceExtension->DeviceObject, + NULL, + NULL); + } + + /* Lower irql back to what it was */ + KeLowerIrql(Dirql); + + /* Start our timer */ + IoStartTimer(PortDeviceObject); + + /* Initialize bus scanning information */ + DeviceExtension->BusesConfig = ExAllocatePool(PagedPool, + sizeof(PSCSI_BUS_SCAN_INFO) * DeviceExtension->PortConfig->NumberOfBuses + + sizeof(ULONG)); + + if (!DeviceExtension->BusesConfig) + { + DPRINT1("Out of resources!\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + + /* Zero it */ + RtlZeroMemory(DeviceExtension->BusesConfig, + sizeof(PSCSI_BUS_SCAN_INFO) * DeviceExtension->PortConfig->NumberOfBuses + + sizeof(ULONG)); + + /* Store number of buses there */ + DeviceExtension->BusesConfig->NumberOfBuses = DeviceExtension->PortConfig->NumberOfBuses; + + /* Scan the adapter for devices */ + SpiScanAdapter (DeviceExtension); + + /* Build the registry device map */ + SpiBuildDeviceMap(DeviceExtension, + (PUNICODE_STRING)Argument2); + + /* Create the dos device link */ + swprintf(DosNameBuffer, + L"\\??\\Scsi%lu:", + SystemConfig->ScsiPortCount); + RtlInitUnicodeString(&DosDeviceName, DosNameBuffer); + IoCreateSymbolicLink(&DosDeviceName, &DeviceName); + + /* Increase the port count */ + SystemConfig->ScsiPortCount++; + FirstConfigCall = FALSE; + + /* Increase adapter number and bus number respectively */ + ConfigInfo.AdapterNumber++; + + if (!Again) + ConfigInfo.BusNumber++; DPRINT("Bus: %lu MaxBus: %lu\n", BusNumber, MaxBus); - if (BusNumber >= MaxBus) - { - DPRINT("Scanned all buses!\n"); - Status = STATUS_SUCCESS; - goto ByeBye; - } - - if (Again == FALSE) - { - BusNumber++; - SlotNumber.u.AsULONG = 0; - } - } - -ByeBye: - /* Clean up the mess */ - if (PortDeviceObject != NULL) - { - DPRINT("Delete device: %p\n", PortDeviceObject); - - DeviceExtension = PortDeviceObject->DeviceExtension; - - if (DeviceExtension->PortCapabilities != NULL) - { - IoDisconnectInterrupt (DeviceExtension->Interrupt); - ExFreePool (DeviceExtension->PortCapabilities); - } - - if (DeviceExtension->PortConfig != NULL) - { - ExFreePool (DeviceExtension->PortConfig); - } - - IoDeleteDevice (PortDeviceObject); - } - - DPRINT("ScsiPortInitialize() done, Status = 0x%08X, DeviceFound = %b!\n", - Status, DeviceFound); - - return (DeviceFound == FALSE) ? Status : STATUS_SUCCESS; + + DeviceFound = TRUE; + } + + /* Clean up the mess */ + SpiCleanupAfterInit(DeviceExtension); + + /* Close registry keys */ + if (ConfigInfo.ServiceKey != NULL) + ZwClose(ConfigInfo.ServiceKey); + + if (ConfigInfo.DeviceKey != NULL) + ZwClose(ConfigInfo.DeviceKey); + + if (ConfigInfo.BusKey != NULL) + ZwClose(ConfigInfo.BusKey); + + if (ConfigInfo.AccessRanges != NULL) + ExFreePool(ConfigInfo.AccessRanges); + + if (ConfigInfo.Parameter != NULL) + ExFreePool(ConfigInfo.Parameter); + + DPRINT("ScsiPortInitialize() done, Status = 0x%08X, DeviceFound = %b!\n", + Status, DeviceFound); + + return (DeviceFound == FALSE) ? Status : STATUS_SUCCESS; } + +static VOID +SpiCleanupAfterInit(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension) +{ + PSCSI_LUN_INFO LunInfo; + PVOID Ptr; + ULONG Bus, Lun; + + /* Check if we have something to clean up */ + if (DeviceExtension == NULL) + return; + + /* Stop the timer and disconnect the interrupt */ + if (DeviceExtension->Interrupt) + { + IoStopTimer(DeviceExtension->DeviceObject); + IoDisconnectInterrupt(DeviceExtension->Interrupt); + } + + /* Delete ConfigInfo */ + if (DeviceExtension->BusesConfig) + { + for (Bus = 0; Bus < DeviceExtension->BusNum; Bus++) + { + if (!DeviceExtension->BusesConfig->BusScanInfo[Bus]) + continue; + + LunInfo = DeviceExtension->BusesConfig->BusScanInfo[Bus]->LunInfo; + + while (!LunInfo) + { + /* Free current, but save pointer to the next one */ + Ptr = LunInfo->Next; + ExFreePool(LunInfo); + LunInfo = Ptr; + } + + ExFreePool(DeviceExtension->BusesConfig->BusScanInfo[Bus]); + } + + ExFreePool(DeviceExtension->BusesConfig); + } + + /* Free PortConfig */ + if (DeviceExtension->PortConfig) + ExFreePool(DeviceExtension->PortConfig); + + /* Free LUNs*/ + for(Lun = 0; Lun < LUS_NUMBER; Lun++) + { + while (DeviceExtension->LunExtensionList[Lun]) + { + Ptr = DeviceExtension->LunExtensionList[Lun]; + DeviceExtension->LunExtensionList[Lun] = DeviceExtension->LunExtensionList[Lun]->Next; + + ExFreePool(Ptr); + } + } + + /* Free common buffer (if it exists) */ + if (DeviceExtension->SrbExtensionBuffer != NULL && + DeviceExtension->CommonBufferSize != 0) + { + if (!DeviceExtension->AdapterObject) + { + ExFreePool(DeviceExtension->SrbExtensionBuffer); + } + else + { +#if 0 + HalFreeCommonBuffer(DeviceExtension->AdapterObject, + DeviceExtension->CommonBufferSize, + DeviceExtension->PhysicalCommonBuffer, + DeviceExtension->SrbExtensionBuffer, + FALSE); +#endif + } + } + + /* Free SRB info */ + if (DeviceExtension->SrbInfo != NULL) + ExFreePool(DeviceExtension->SrbInfo); + + /* Unmap mapped addresses */ + while (DeviceExtension->MappedAddressList != NULL) + { + MmUnmapIoSpace(DeviceExtension->MappedAddressList->MappedAddress, + DeviceExtension->MappedAddressList->NumberOfBytes); + + Ptr = DeviceExtension->MappedAddressList; + DeviceExtension->MappedAddressList = DeviceExtension->MappedAddressList->NextMappedAddress; + + ExFreePool(Ptr); + } + + /* Finally delete the device object */ + IoDeleteDevice(DeviceExtension->DeviceObject); +} + /* @@ -1491,6 +1857,187 @@ } } +static PCM_RESOURCE_LIST +SpiConfigToResource(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, + PPORT_CONFIGURATION_INFORMATION PortConfig) +{ + PCONFIGURATION_INFORMATION ConfigInfo; + PCM_RESOURCE_LIST ResourceList; + PCM_PARTIAL_RESOURCE_DESCRIPTOR ResourceDescriptor; + PACCESS_RANGE AccessRange; + BOOLEAN Dma; + ULONG ListLength = 0, i, FullSize; + ULONG Interrupt; + + /* Get current Atdisk usage from the system */ + ConfigInfo = IoGetConfigurationInformation(); + + if (PortConfig->AtdiskPrimaryClaimed) + ConfigInfo->AtDiskPrimaryAddressClaimed = TRUE; + + if (PortConfig->AtdiskSecondaryClaimed) + ConfigInfo->AtDiskSecondaryAddressClaimed = TRUE; + + /* Do we use DMA? */ + if (PortConfig->DmaChannel != SP_UNINITIALIZED_VALUE || + PortConfig->DmaPort != SP_UNINITIALIZED_VALUE) + { + Dma = TRUE; + ListLength++; + } + else + { + Dma = FALSE; + } + + /* How many interrupts to we have? */ + if (DeviceExtension->HwInterrupt == NULL || + (PortConfig->BusInterruptLevel == 0 && + PortConfig->BusInterruptVector == 0)) + { + Interrupt = 0; + } + else + { + Interrupt = 1; + ListLength++; + } + + if (DeviceExtension->HwInterrupt != NULL && + (PortConfig->BusInterruptLevel2 != 0 || + PortConfig->BusInterruptVector2 != 0)) + { + Interrupt++; + ListLength++; + } + + /* How many access ranges do we use? */ + AccessRange = &((*(PortConfig->AccessRanges))[0]); + for (i = 0; i < PortConfig->NumberOfAccessRanges; i++) + { + if (AccessRange->RangeLength != 0) + ListLength++; + + AccessRange++; + } + + /* Allocate the resource list, since we know its size now */ + FullSize = sizeof(CM_RESOURCE_LIST) + (ListLength - 1) * + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); + + ResourceList = (PCM_RESOURCE_LIST)ExAllocatePool(PagedPool, FullSize); + + if (!ResourceList) + return NULL; + + /* Zero it */ + RtlZeroMemory(ResourceList, FullSize); + + /* Initialize it */ + ResourceList->Count = 1; + ResourceList->List[0].InterfaceType = PortConfig->AdapterInterfaceType; + ResourceList->List[0].BusNumber = PortConfig->SystemIoBusNumber; + ResourceList->List[0].PartialResourceList.Count = ListLength; + ResourceDescriptor = ResourceList->List[0].PartialResourceList.PartialDescriptors; + + /* Copy access ranges array over */ + for (i = 0; i < PortConfig->NumberOfAccessRanges; i++) + { + AccessRange = &((*(PortConfig->AccessRanges))[i]); + + /* If the range is empty - skip it */ + if (AccessRange->RangeLength == 0) + continue; + + if (AccessRange->RangeInMemory) + { + ResourceDescriptor->Type = CmResourceTypeMemory; + ResourceDescriptor->Flags = CM_RESOURCE_MEMORY_READ_WRITE; + } + else + { + ResourceDescriptor->Type = CmResourceTypePort; + ResourceDescriptor->Flags = CM_RESOURCE_PORT_IO; + } + + ResourceDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; + + ResourceDescriptor->u.Memory.Start = AccessRange->RangeStart; + ResourceDescriptor->u.Memory.Length = AccessRange->RangeLength; + + ResourceDescriptor++; + } + + /* If we use interrupt(s), copy them */ + if (Interrupt) + { + ResourceDescriptor->Type = CmResourceTypeInterrupt; + + if (PortConfig->AdapterInterfaceType == MicroChannel || + PortConfig->InterruptMode == LevelSensitive) + { + ResourceDescriptor->ShareDisposition = CmResourceShareShared; + ResourceDescriptor->Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE; + } + else + { + ResourceDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; + ResourceDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; + } + + ResourceDescriptor->u.Interrupt.Level = PortConfig->BusInterruptLevel; + ResourceDescriptor->u.Interrupt.Vector = PortConfig->BusInterruptVector; + ResourceDescriptor->u.Interrupt.Affinity = 0; + + ResourceDescriptor++; + Interrupt--; + } + + /* Copy 2nd interrupt + FIXME: Stupid code duplication, remove */ + if (Interrupt) + { + ResourceDescriptor->Type = CmResourceTypeInterrupt; + + if (PortConfig->AdapterInterfaceType == MicroChannel || + PortConfig->InterruptMode == LevelSensitive) + { + ResourceDescriptor->ShareDisposition = CmResourceShareShared; + ResourceDescriptor->Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE; + } + else + { + ResourceDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; + ResourceDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; + } + + ResourceDescriptor->u.Interrupt.Level = PortConfig->BusInterruptLevel; + ResourceDescriptor->u.Interrupt.Vector = PortConfig->BusInterruptVector; + ResourceDescriptor->u.Interrupt.Affinity = 0; + + ResourceDescriptor++; + } + + /* Copy DMA data */ + if (Dma) + { + ResourceDescriptor->Type = CmResourceTypeDma; + ResourceDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; + ResourceDescriptor->u.Dma.Channel = PortConfig->DmaChannel; + ResourceDescriptor->u.Dma.Port = PortConfig->DmaPort; + ResourceDescriptor->Flags = 0; + + if (PortConfig->DmaChannel == SP_UNINITIALIZED_VALUE) + ResourceDescriptor->u.Dma.Channel = 0; + + if (PortConfig->DmaPort == SP_UNINITIALIZED_VALUE) + ResourceDescriptor->u.Dma.Port = 0; + } + + return ResourceList; +} + + static BOOLEAN SpiGetPciConfigData(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject, @@ -1838,7 +2385,7 @@ DPRINT(" IOCTL_SCSI_GET_CAPABILITIES\n"); *((PIO_SCSI_CAPABILITIES *)Irp->AssociatedIrp.SystemBuffer) = - DeviceExtension->PortCapabilities; + &DeviceExtension->PortCapabilities; Irp->IoStatus.Information = sizeof(PIO_SCSI_CAPABILITIES); } @@ -3843,7 +4390,7 @@ */ /* Set 'DMA Enabled' (REG_DWORD) value */ - UlongData = (ULONG)!DeviceExtension->PortCapabilities->AdapterUsesPio; + UlongData = (ULONG)!DeviceExtension->PortCapabilities.AdapterUsesPio; DPRINT(" DMA Enabled = %s\n", (UlongData) ? "TRUE" : "FALSE"); RtlInitUnicodeString(&ValueName, L"DMA Enabled"); Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h Sat Mar 31 22:37:07 2007 @@ -194,6 +194,7 @@ ULONG MiniPortExtensionSize; PPORT_CONFIGURATION_INFORMATION PortConfig; PBUSES_CONFIGURATION_INFORMATION BusesConfig; + PVOID NonCachedExtension; ULONG PortNumber; LONG ActiveRequestCounter; @@ -223,6 +224,7 @@ SCSI_PORT_INTERRUPT_DATA InterruptData; + ULONG CommonBufferSize; /* SRB extension stuff*/ ULONG SrbExtensionSize; PVOID SrbExtensionBuffer; @@ -231,12 +233,14 @@ /* SRB information */ PSCSI_REQUEST_BLOCK_INFO SrbInfo; PSCSI_REQUEST_BLOCK_INFO FreeSrbInfo; - - PIO_SCSI_CAPABILITIES PortCapabilities; + ULONG SrbDataCount; + + IO_SCSI_CAPABILITIES PortCapabilities; PDEVICE_OBJECT DeviceObject; PCONTROLLER_OBJECT ControllerObject; + PHW_INITIALIZE HwInitialize; PHW_STARTIO HwStartIo; PHW_INTERRUPT HwInterrupt; PHW_RESET_BUS HwResetBus; @@ -254,13 +258,17 @@ PVOID MapRegisterBase; /* Features */ + BOOLEAN CachesData; BOOLEAN SupportsTaggedQueuing; BOOLEAN SupportsAutoSense; - + BOOLEAN MultipleReqsPerLun; + BOOLEAN ReceiveEvent; PHYSICAL_ADDRESS PhysicalAddress; PVOID VirtualAddress; ULONG CommonBufferLength; + ULONG InterruptLevel; + ULONG IoAddress; BOOLEAN NeedSrbExtensionAlloc; BOOLEAN NeedSrbDataAlloc;
17 years, 8 months
1
0
0
0
[dgorbachev] 26219: Do not wait for explorer startup. Hack.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sat Mar 31 15:52:24 2007 New Revision: 26219 URL:
http://svn.reactos.org/svn/reactos?rev=26219&view=rev
Log: Do not wait for explorer startup. Hack. Modified: trunk/reactos/drivers/filesystems/np/create.c trunk/reactos/drivers/filesystems/np/fsctrl.c Modified: trunk/reactos/drivers/filesystems/np/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/np/cre…
============================================================================== --- trunk/reactos/drivers/filesystems/np/create.c (original) +++ trunk/reactos/drivers/filesystems/np/create.c Sat Mar 31 15:52:24 2007 @@ -290,6 +290,7 @@ ServerCcb->OtherSide = ClientCcb; ClientCcb->PipeState = FILE_PIPE_CONNECTED_STATE; ServerCcb->PipeState = FILE_PIPE_CONNECTED_STATE; + KeSetEvent(&ServerCcb->ConnectEvent, IO_NO_INCREMENT, FALSE); } KeUnlockMutex(&Fcb->CcbListLock); Modified: trunk/reactos/drivers/filesystems/np/fsctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/np/fsc…
============================================================================== --- trunk/reactos/drivers/filesystems/np/fsctrl.c (original) +++ trunk/reactos/drivers/filesystems/np/fsctrl.c Sat Mar 31 15:52:24 2007 @@ -156,6 +156,19 @@ Status = NpfsAddListeningServerInstance(Irp, Ccb); KeUnlockMutex(&Fcb->CcbListLock); + + { + PIO_STACK_LOCATION IoStack = IoGetCurrentIrpStackLocation(Irp); + PFILE_OBJECT FileObject = IoStack->FileObject; + if (FileObject->Flags & FO_SYNCHRONOUS_IO) + { + KeWaitForSingleObject(&Ccb->ConnectEvent, + UserRequest, + KernelMode, + FALSE, + NULL); + } + } DPRINT("NpfsConnectPipe() done (Status %lx)\n", Status);
17 years, 8 months
1
0
0
0
[greatlrd] 26218: more compatible fix betwin reactos ddk and ms DDK version 3790.1830
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sat Mar 31 02:58:02 2007 New Revision: 26218 URL:
http://svn.reactos.org/svn/reactos?rev=26218&view=rev
Log: more compatible fix betwin reactos ddk and ms DDK version 3790.1830 Modified: trunk/reactos/include/ddk/kcom.h Modified: trunk/reactos/include/ddk/kcom.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/kcom.h?rev=262…
============================================================================== --- trunk/reactos/include/ddk/kcom.h (original) +++ trunk/reactos/include/ddk/kcom.h Sat Mar 31 02:58:02 2007 @@ -1,43 +1,261 @@ -/* - ReactOS - Kernel-Mode COM for Kernel Streaming - - Author: - Andrew Greenwood - - Notes: - This is untested, and is for internal use by Kernel Streaming. The - functions here are documented on MSDN. Does this even compile?? - Implementation should be in KS.SYS -*/ - -#ifndef KCOM_H -#define KCOM_H - -#include <ntddk.h> - -COMDDKAPI NTSTATUS NTAPI -KoCreateInstance( - IN REFCLSID ClassId, - IN IUnknown* UnkOuter OPTIONAL, - IN ULONG ClsContext, - IN REFIID InterfaceId, - OUT PVOID* Interface); - -/* Add a kernel COM Create-item entry to a device object */ -COMDDKAPI NTSTATUS NTAPI -KoDeviceInitialize( - IN PDEVICE_OBJECT DeviceObject); - -COMDDKAPI NTSTATUS NTAPI -KoDriverInitialize( - IN PDRIVER_OBJECT DriverObject, - IN PUNICODE_STRING RegistryPathName, - IN KoCreateObjectHandler CreateObjectHandler); - -/* Decrements refcount for calling interface on an object */ -COMDDKAPI NTSTATUS NTAPI -KoRelease( - IN REFCLSID ClassId); - -#endif + + +#if !defined(_KS_) +#error KS.H must be included before KCOM.H +#endif + +#if !defined(_KCOM_) +#define _KCOM_ + +#if defined(__cplusplus) +extern "C" { +#endif + +#define STATIC_KoCreateObject 0x72CF721CL, 0x525A, 0x11D1, 0x9A, 0xA1, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 +DEFINE_GUIDSTRUCT("72CF721C-525A-11D1-9AA1-00A0C9223196", KoCreateObject); +#define KOSTRING_CreateObject L"{72CF721C-525A-11D1-9AA1-00A0C9223196}" + +#ifndef CLSCTX_KERNEL_SERVER +#define CLSCTX_KERNEL_SERVER 0x00000200 +#endif + +#if !defined(__cplusplus) || _MSC_VER < 1100 +#define STATIC_IID_IKoInitializeParentDeviceObject 0x21B36996, 0x8DE3, 0x11D1, 0x8A, 0xE0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 +DEFINE_GUIDEX(IID_IKoInitializeParentDeviceObject); +#else +interface __declspec(uuid("21B36996-8DE3-11D1-8AE0-00A0C9223196")) IKoInitializeParentDeviceObject; +#endif + +#ifndef COMDDKMETHOD +#ifdef _COMDDK_ +#define COMDDKMETHOD +#else +#define COMDDKMETHOD DECLSPEC_IMPORT +#endif +#endif + +#ifdef _COMDDK_ +#define COMDDKAPI +#else +#define COMDDKAPI DECLSPEC_IMPORT +#endif + +typedef +NTSTATUS +(*KoCreateObjectHandler)( IN REFCLSID ClassId, + IN IUnknown* UnkOuter OPTIONAL, + IN REFIID InterfaceId, + OUT PVOID* Interface); + +#undef INTERFACE +#define INTERFACE INonDelegatedUnknown +DECLARE_INTERFACE(INonDelegatedUnknown) +{ + STDMETHOD(NonDelegatedQueryInterface) + ( + THIS_ + IN REFIID InterfaceId, + OUT PVOID* Interface + ) PURE; + + STDMETHOD_(ULONG,NonDelegatedAddRef) + ( + THIS + ) PURE; + + STDMETHOD_(ULONG,NonDelegatedRelease) + ( + THIS + ) PURE; +}; + +#undef INTERFACE +#define INTERFACE IIndirectedUnknown +DECLARE_INTERFACE(IIndirectedUnknown) +{ + STDMETHOD(IndirectedQueryInterface) + ( + THIS_ + IN REFIID InterfaceId, + OUT PVOID* Interface + ) PURE; + + STDMETHOD_(ULONG,IndirectedAddRef) + ( + THIS + ) PURE; + + STDMETHOD_(ULONG,IndirectedRelease) + ( + THIS + ) PURE; +}; + + +#undef INTERFACE +#define INTERFACE IKoInitializeParentDeviceObject +DECLARE_INTERFACE_(IKoInitializeParentDeviceObject, IUnknown) +{ + STDMETHOD(SetParentDeviceObject) + ( + THIS_ + IN PDEVICE_OBJECT ParentDeviceObject + ) PURE; +}; + + + +#if defined(__cplusplus) + + +class CBaseUnknown : public INonDelegatedUnknown, public IIndirectedUnknown +{ + protected: + LONG m_RefCount; + private: + BOOLEAN m_UsingClassId; + CLSID m_ClassId; + protected: + IUnknown* m_UnknownOuter; + public: + COMDDKMETHOD CBaseUnknown (IN REFCLSID ClassId, IN IUnknown* UnknownOuter OPTIONAL = NULL); + COMDDKMETHOD CBaseUnknown(IN IUnknown* UnknownOuter OPTIONAL = NULL); + COMDDKMETHOD virtual ~CBaseUnknown(); + COMDDKMETHOD STDMETHODIMP_(ULONG) NonDelegatedAddRef(); + COMDDKMETHOD STDMETHODIMP_(ULONG) NonDelegatedRelease(); + COMDDKMETHOD STDMETHODIMP NonDelegatedQueryInterface(IN REFIID InterfaceId,OUT PVOID* Interface); + COMDDKMETHOD STDMETHODIMP_(ULONG) IndirectedAddRef(); + COMDDKMETHOD STDMETHODIMP_(ULONG) IndirectedRelease(); + COMDDKMETHOD STDMETHODIMP IndirectedQueryInterface(IN REFIID InterfaceId, OUT PVOID* Interface); +}; + + +#if !defined(DEFINE_ABSTRACT_UNKNOWN) + +#define DEFINE_ABSTRACT_UNKNOWN() \ + STDMETHOD(QueryInterface)(THIS_ REFIID InterfaceId, PVOID* Interface) PURE; \ + STDMETHOD_(ULONG,AddRef)(THIS) PURE; \ + STDMETHOD_(ULONG,Release)(THIS) PURE; + +#endif + +#define DEFINE_STD_UNKNOWN() \ + STDMETHODIMP NonDelegatedQueryInterface( REFIID InterfaceId, PVOID* Interface); \ + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); \ + STDMETHODIMP_(ULONG) AddRef(); \ + STDMETHODIMP_(ULONG) Release(); + +#define IMPLEMENT_STD_UNKNOWN(Class) \ + STDMETHODIMP Class::QueryInterface( REFIID InterfaceId, PVOID* Interface) \ + { \ + return m_UnknownOuter->QueryInterface(InterfaceId, Interface);\ + } \ + STDMETHODIMP_(ULONG) Class::AddRef() \ + { \ + return m_UnknownOuter->AddRef(); \ + } \ + STDMETHODIMP_(ULONG) Class::Release() \ + { \ + return m_UnknownOuter->Release(); \ + } +#else + +COMDDKAPI +void +NTAPI +KoRelease( IN REFCLSID ClassId); +#endif // !__cplusplus + +COMDDKAPI +NTSTATUS +NTAPI +KoCreateInstance( IN REFCLSID ClassId, + IN IUnknown* UnkOuter OPTIONAL, + IN ULONG ClsContext, + IN REFIID InterfaceId, + OUT PVOID* Interface); + +COMDDKAPI +NTSTATUS +NTAPI +KoDeviceInitialize( IN PDEVICE_OBJECT DeviceObject); + +COMDDKAPI +NTSTATUS +NTAPI +KoDriverInitialize( IN PDRIVER_OBJECT DriverObject, + IN PUNICODE_STRING RegistryPathName, + IN KoCreateObjectHandler CreateObjectHandler); + + +#if defined(__cplusplus) +} +#endif + +#ifdef __cplusplus + +#ifndef _NEW_DELETE_OPERATORS_ +#define _NEW_DELETE_OPERATORS_ + +inline PVOID operator new +( + size_t iSize, + POOL_TYPE poolType +) +{ + PVOID result = ExAllocatePoolWithTag(poolType,iSize,'wNCK'); + if (result) + { + RtlZeroMemory(result,iSize); + } + return result; +} + +inline PVOID operator new +( + size_t iSize, + POOL_TYPE poolType, + ULONG tag +) +{ + PVOID result = ExAllocatePoolWithTag(poolType,iSize,tag); + if (result) + { + RtlZeroMemory(result,iSize); + } + return result; +} + +inline void __cdecl operator delete +( + PVOID pVoid +) +{ + ExFreePool(pVoid); +} + +#endif + +#if defined(_SYS_GUID_OPERATOR_EQ_) +#define _GUID_OPERATORS_ +#pragma message("WARNING: Using system operator==/!= for GUIDs") +#endif + +#ifndef _GUID_OPERATORS_ +#define _GUID_OPERATORS_ + +__inline BOOL operator==(const GUID& guidOne, const GUID& guidOther) +{ + return IsEqualGUIDAligned(guidOne,guidOther); +} +__inline BOOL operator!=(const GUID& guidOne, const GUID& guidOther) +{ + return !(guidOne == guidOther); +} + +#endif + +#endif + +#endif +
17 years, 8 months
1
0
0
0
[greatlrd] 26217: more compatible fix betwin reactos ddk and ms DDK version 3790.1830
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sat Mar 31 01:17:33 2007 New Revision: 26217 URL:
http://svn.reactos.org/svn/reactos?rev=26217&view=rev
Log: more compatible fix betwin reactos ddk and ms DDK version 3790.1830 Added: trunk/reactos/include/ddk/stierr.h (with props) Added: trunk/reactos/include/ddk/stierr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/stierr.h?rev=2…
============================================================================== --- trunk/reactos/include/ddk/stierr.h (added) +++ trunk/reactos/include/ddk/stierr.h Sat Mar 31 01:17:33 2007 @@ -1,0 +1,39 @@ + + + +#ifndef _STIERR_ +#define _STIERR_ + +#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) +#define NT_INFORMATION(Status) ((ULONG)(Status) >> 30 == 1) +#define NT_WARNING(Status) ((ULONG)(Status) >> 30 == 2) +#define NT_ERROR(Status) ((ULONG)(Status) >> 30 == 3) +#define STI_OK S_OK +#define STI_ERROR_NO_ERROR STI_OK +#define STI_NOTCONNECTED S_FALSE +#define STI_CHANGENOEFFECT S_FALSE +#define STIERR_OLD_VERSION MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_OLD_WIN_VERSION) +#define STIERR_BETA_VERSION MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_RMODE_APP) +#define STIERR_BADDRIVER MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_BAD_DRIVER_LEVEL) +#define STIERR_DEVICENOTREG REGDB_E_CLASSNOTREG +#define STIERR_OBJECTNOTFOUND MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_FILE_NOT_FOUND) +#define STIERR_INVALID_PARAM E_INVALIDARG +#define STIERR_NOINTERFACE E_NOINTERFACE +#define STIERR_GENERIC E_FAIL +#define STIERR_OUTOFMEMORY E_OUTOFMEMORY +#define STIERR_UNSUPPORTED E_NOTIMPL +#define STIERR_NOT_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_NOT_READY) +#define STIERR_ALREADY_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_ALREADY_INITIALIZED) +#define STIERR_DEVICE_LOCKED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_LOCK_VIOLATION) +#define STIERR_READONLY E_ACCESSDENIED +#define STIERR_NOTINITIALIZED E_ACCESSDENIED +#define STIERR_NEEDS_LOCK MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_NOT_LOCKED) +#define STIERR_SHARING_VIOLATION MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_SHARING_VIOLATION) +#define STIERR_HANDLEEXISTS MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_ALREADY_EXISTS) +#define STIERR_INVALID_DEVICE_NAME MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_INVALID_NAME) +#define STIERR_INVALID_HW_TYPE MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_INVALID_DATA) +#define STIERR_INVALID_HW_TYPE MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_INVALID_DATA) +#define STIERR_NOEVENTS MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_NO_MORE_ITEMS) +#define STIERR_DEVICE_NOTREADY MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_NOT_READY) +#endif + Propchange: trunk/reactos/include/ddk/stierr.h ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 8 months
1
0
0
0
[dgorbachev] 26216: Fix a bug.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sat Mar 31 01:08:23 2007 New Revision: 26216 URL:
http://svn.reactos.org/svn/reactos?rev=26216&view=rev
Log: Fix a bug. Modified: trunk/reactos/base/services/eventlog/eventlog.c Modified: trunk/reactos/base/services/eventlog/eventlog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/eve…
============================================================================== --- trunk/reactos/base/services/eventlog/eventlog.c (original) +++ trunk/reactos/base/services/eventlog/eventlog.c Sat Mar 31 01:08:23 2007 @@ -218,18 +218,18 @@ LoadLogFiles(elogKey); } - StartServiceCtrlDispatcher(ServiceTable); + StartServiceCtrlDispatcher(ServiceTable); bye_bye: - DeleteCriticalSection(&LogListCs); - // Close all log files. for(pLogf = LogListHead; pLogf; pLogf = ((PLOGFILE)pLogf)->Next) LogfClose(pLogf); - + + DeleteCriticalSection(&LogListCs); + if(MyHeap) HeapDestroy(MyHeap); - return RetCode; + return RetCode; } VOID EventTimeToSystemTime(DWORD EventTime,
17 years, 8 months
1
0
0
0
[greatlrd] 26215: more compatible fix betwin reactos ddk and ms DDK version 3790.1830
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sat Mar 31 01:08:09 2007 New Revision: 26215 URL:
http://svn.reactos.org/svn/reactos?rev=26215&view=rev
Log: more compatible fix betwin reactos ddk and ms DDK version 3790.1830 Added: trunk/reactos/include/ddk/d3dhalex.h (with props) Added: trunk/reactos/include/ddk/d3dhalex.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/d3dhalex.h?rev…
============================================================================== --- trunk/reactos/include/ddk/d3dhalex.h (added) +++ trunk/reactos/include/ddk/d3dhalex.h Sat Mar 31 01:08:09 2007 @@ -1,0 +1,10 @@ + + +#ifndef _D3DHALEX_H +#define _D3DHALEX_H +#define D3DGDI_IS_GDI2(pData) ((((DD_GETDRIVERINFO2DATA*)(pData->lpvData))->dwMagic) == D3DGDI2_MAGIC) +#define D3DGDI_IS_STEREOMODE(pData) ((((DD_STEREOMODE*) (pData->lpvData))->dwHeight) != D3DGDI2_MAGIC) +#define D3DGDI_GET_GDI2_DATA(pData) (D3DGDI_IS_GDI2(pData) ? (((DD_GETDRIVERINFO2DATA*)(pData->lpvData))) : NULL) +#define D3DGDI_GET_STEREOMODE_DATA(pData) (D3DGDI_IS_STEREOMODE(pData) ? (((DD_STEREOMODE*)(pData->lpvData))) : NULL) + +#endif Propchange: trunk/reactos/include/ddk/d3dhalex.h ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 8 months
1
0
0
0
[greatlrd] 26214: more compatible fix betwin reactos ddk and ms DDK version 3790.1830
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sat Mar 31 00:49:26 2007 New Revision: 26214 URL:
http://svn.reactos.org/svn/reactos?rev=26214&view=rev
Log: more compatible fix betwin reactos ddk and ms DDK version 3790.1830 Added: trunk/reactos/include/ddk/ksuuids.h (with props) Modified: trunk/reactos/include/ddk/tvout.h Added: trunk/reactos/include/ddk/ksuuids.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ksuuids.h?rev=…
============================================================================== --- trunk/reactos/include/ddk/ksuuids.h (added) +++ trunk/reactos/include/ddk/ksuuids.h Sat Mar 31 00:49:26 2007 @@ -1,0 +1,53 @@ + + +OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PACK, 0x36523B13, 0x8EE5, 0x11D1, 0x8C, 0xA3, 0x00, 0x60, 0xB0, 0x57, 0x66, 0x4A) +OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PES, 0xE06D8020, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY( MEDIATYPE_MPEG2_SECTIONS, 0x455F176C, 0x4B06, 0x47CE, 0x9A, 0xEF, 0x8c, 0xAE, 0xF7, 0x3D, 0xF7, 0xB5) +OUR_GUID_ENTRY(MEDIASUBTYPE_ATSC_SI, 0xB3C7397C, 0xD303, 0x414D, 0xB3, 0x3C, 0x4E, 0xD2, 0xC9, 0xD2, 0x97, 0x33) +OUR_GUID_ENTRY(MEDIASUBTYPE_DVB_SI, 0xE9dD31A3, 0x221D, 0x4ADB, 0x85, 0x32, 0x9A, 0xF3, 0x9, 0xC1, 0xA4, 0x8) +OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2DATA, 0xC892E55B, 0x252D, 0x42B5, 0xA3, 0x16, 0xD9, 0x97, 0xE7, 0xA5, 0xD9, 0x95) +OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VIDEO, 0xE06D8026, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(FORMAT_MPEG2_VIDEO, 0xE06D80E3, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(FORMAT_VIDEOINFO2, 0xF72A76A0, 0xEB0A, 0x11D0, 0xAC, 0xE4, 0x0, 0x0, 0xC0, 0xcc, 0x16, 0xBA) +OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PROGRAM, 0xE06D8022, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT, 0xE06D8023, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT_STRIDE, 0x138AA9A4, 0x1EE2, 0x4C5B, 0x98, 0x8E, 0x19, 0xAB, 0xFD, 0xBC, 0x8A, 0x11) +OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_AUDIO, 0xE06D802B, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3, 0xE06D802C, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_SUBPICTURE, 0xE06D802D, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_LPCM_AUDIO, 0xE06D8032, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIASUBTYPE_DTS, 0xE06D8033, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIASUBTYPE_SDDS, 0xE06D8034, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIATYPE_DVD_ENCRYPTED_PACK, 0xED0B916A, 0x044D, 0x11D1, 0xAA, 0x78, 0x00, 0xc0, 0x04F, 0xC3, 0x1D, 0x60) +OUR_GUID_ENTRY(MEDIATYPE_DVD_NAVIGATION, 0xE06D802E, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PCI, 0xE06D802F, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_DSI, 0xE06D8030, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PROVIDER, 0xE06D8031, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(FORMAT_MPEG2Video, 0xE06D80E3, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(FORMAT_DolbyAC3, 0xE06D80E4, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(FORMAT_MPEG2Audio, 0xE06D80E5, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(FORMAT_DVD_LPCMAudio, 0xE06D80E6, 0xDB46, 0x11CF, 0xB4, 0xD1, 0x00, 0x80, 0x05F, 0x6C, 0xBB, 0xEA) +OUR_GUID_ENTRY(AM_KSPROPSETID_AC3, 0xBFABE720, 0x6E1F, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00) +OUR_GUID_ENTRY(AM_KSPROPSETID_DvdSubPic, 0xAC390460, 0x43AF, 0x11D0, 0xBD, 0x6A, 0x00, 0x35, 0x05, 0xC1, 0x03, 0xA9) +OUR_GUID_ENTRY(AM_KSPROPSETID_CopyProt, 0x0E8A0A40, 0x6AEF, 0x11D0, 0x9E, 0xD0, 0x00, 0xA0, 0x24, 0xCA, 0x19, 0xB3) +OUR_GUID_ENTRY(AM_KSPROPSETID_TSRateChange, 0xA503C5C0, 0x1D1D, 0x11D1, 0xAD, 0x80, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0) +OUR_GUID_ENTRY(AM_KSPROPSETID_DVD_RateChange, 0x3577EB09, 0x9582, 0x477F, 0xB2, 0x9C, 0xB0, 0xC4, 0x52, 0xA4, 0xFF, 0x9A) +OUR_GUID_ENTRY(AM_KSPROPSETID_DvdKaraoke, 0xAE4720AE, 0xAA71, 0x42D8, 0xB8, 0x2A, 0xFF, 0xFD, 0xF5, 0x8B, 0x76, 0xFD) +OUR_GUID_ENTRY(AM_KSPROPSETID_FrameStep, 0xC830ACBD, 0xAB07, 0x492F, 0x88, 0x52, 0x45, 0xB6, 0x98, 0x7C, 0x29, 0x79) +OUR_GUID_ENTRY(AM_KSCATEGORY_CAPTURE, 0x65E8773D, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) +OUR_GUID_ENTRY(AM_KSCATEGORY_RENDER, 0x65E8773E, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) +OUR_GUID_ENTRY(AM_KSCATEGORY_DATACOMPRESSOR, 0x1E84C900, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00) +OUR_GUID_ENTRY(AM_KSCATEGORY_AUDIO, 0x6994AD04, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) +OUR_GUID_ENTRY(AM_KSCATEGORY_VIDEO, 0x6994AD05, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) +OUR_GUID_ENTRY(AM_KSCATEGORY_TVTUNER, 0xA799A800, 0xA46D, 0x11D0, 0xA1, 0x8C, 0x00, 0xa0, 0x24, 0x01, 0xDC, 0xD4) +OUR_GUID_ENTRY(AM_KSCATEGORY_CROSSBAR, 0xA799A801, 0xA46D, 0x11D0, 0xA1, 0x8C, 0x00, 0xa0, 0x24, 0x01, 0xDC, 0xD4) +OUR_GUID_ENTRY(AM_KSCATEGORY_TVAUDIO, 0xA799A802, 0xA46D, 0x11D0, 0xA1, 0x8C, 0x00, 0xa0, 0x24, 0x01, 0xDC, 0xD4) +OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC, 0x07DAD660, 0x22F1, 0x11D1, 0xa9, 0xF4, 0x00, 0xc0, 0x4F, 0xBB, 0xDE, 0x8F) +OUR_GUID_ENTRY(AM_KSCATEGORY_SPLITTER, 0x0A4252A0, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00) +OUR_GUID_ENTRY(IID_IKsInterfACeHandler, 0xD3ABC7E0, 0x9A61, 0x11D0, 0xA4, 0x0D, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) +OUR_GUID_ENTRY(IID_IKsDataTypeHandler, 0x5FFBAA02, 0x49A3, 0x11D0, 0x9F, 0x36, 0x00, 0xAA, 0x00, 0xA2, 0x16, 0xA1) +OUR_GUID_ENTRY(IID_IKsPin, 0xB61178D1, 0xA2D9, 0x11CF, 0x9E, 0x53, 0x00, 0xAA, 0x00, 0xA2, 0x16, 0xa1) +OUR_GUID_ENTRY(IID_IKsControl, 0x28F54685, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) +OUR_GUID_ENTRY(IID_IKsPinFACtory, 0xCD5EBE6B, 0x8B6E, 0x11D1, 0x8A, 0xE0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) +OUR_GUID_ENTRY(AM_INTERFACESETID_Standard, 0x1A8766A0, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00) + Propchange: trunk/reactos/include/ddk/ksuuids.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/include/ddk/tvout.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/tvout.h?rev=26…
============================================================================== --- trunk/reactos/include/ddk/tvout.h (original) +++ trunk/reactos/include/ddk/tvout.h Sat Mar 31 00:49:26 2007 @@ -23,12 +23,18 @@ #ifndef __TVOUT_H #define __TVOUT_H + #if __GNUC__ >=3 #pragma GCC system_header #endif -#ifdef __cplusplus -extern "C" { +#if _MSC_VER > 1000 +#pragma once +#endif + + +#ifndef GUID_DEFINED +#include <guiddef.h> #endif /* VIDEOPARAMETERS.dwCommand constants */ @@ -107,8 +113,5 @@ BYTE bOEMCopyProtection[256]; } VIDEOPARAMETERS, *PVIDEOPARAMETERS, FAR *LPVIDEOPARAMETERS; -#ifdef __cplusplus -} -#endif #endif /* __TVOUT_H */
17 years, 8 months
1
0
0
0
← Newer
1
2
3
4
...
29
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Results per page:
10
25
50
100
200