Author: tkreuzer
Date: Wed Aug 24 22:09:04 2011
New Revision: 53429
URL:
http://svn.reactos.org/svn/reactos?rev=53429&view=rev
Log:
[KSPROXY/KS/SCSIPORT]
- Use sizeof(PVOID) instead of sizeof(PFOO) just for clarity that we really want a pointer
size
[SCSIPORT]
- Don't initialize a pointer with RtlZeromemory
Modified:
trunk/reactos/dll/directx/ksproxy/output_pin.cpp
trunk/reactos/drivers/ksfilter/ks/filter.c
trunk/reactos/drivers/storage/scsiport/scsiport.c
Modified: trunk/reactos/dll/directx/ksproxy/output_pin.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/output…
==============================================================================
--- trunk/reactos/dll/directx/ksproxy/output_pin.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksproxy/output_pin.cpp [iso-8859-1] Wed Aug 24 22:09:04
2011
@@ -1035,7 +1035,7 @@
return NOERROR;
}
-IMemAllocator *
+IMemAllocator *
STDMETHODCALLTYPE
COutputPin::KsPeekAllocator(KSPEEKOPERATION Operation)
{
@@ -1318,7 +1318,7 @@
HRESULT
STDMETHODCALLTYPE
COutputPin::Backout(
- IPin *ppinOut,
+ IPin *ppinOut,
IGraphBuilder *pGraph)
{
#ifdef KSPROXY_TRACE
@@ -2428,7 +2428,7 @@
assert(NumHandles);
//allocate stream segment array
- StreamSegment = (PKSSTREAM_SEGMENT*)CoTaskMemAlloc(sizeof(PKSSTREAM_SEGMENT) *
NumHandles);
+ StreamSegment = (PKSSTREAM_SEGMENT*)CoTaskMemAlloc(sizeof(PVOID) * NumHandles);
if (!StreamSegment)
{
OutputDebugStringW(L"COutputPin::IoProcessRoutine out of memory\n");
@@ -2444,7 +2444,7 @@
}
// zero handles array
- ZeroMemory(StreamSegment, sizeof(PKSSTREAM_SEGMENT) * NumHandles);
+ ZeroMemory(StreamSegment, sizeof(PVOID) * NumHandles);
ZeroMemory(Samples, sizeof(IMediaSample*) * NumHandles);
// first wait for the start event to signal
@@ -2536,7 +2536,7 @@
}
//circular stream segment array
- RtlMoveMemory(StreamSegment, &StreamSegment[1], sizeof(PKSSTREAM_SEGMENT) *
(NumHandles - 1));
+ RtlMoveMemory(StreamSegment, &StreamSegment[1], sizeof(PVOID) * (NumHandles -
1));
RtlMoveMemory(Samples, &Samples[1], sizeof(IMediaSample*) * (NumHandles -
1));
}while(TRUE);
Modified: trunk/reactos/drivers/ksfilter/ks/filter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] Wed Aug 24 22:09:04 2011
@@ -203,7 +203,7 @@
}
/* does the filter require explicit deferred processing */
- if ((This->Filter.Descriptor->Flags &
(KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING | KSFILTER_FLAG_CRITICAL_PROCESSING |
KSFILTER_FLAG_HYPERCRITICAL_PROCESSING)) &&
+ if ((This->Filter.Descriptor->Flags &
(KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING | KSFILTER_FLAG_CRITICAL_PROCESSING |
KSFILTER_FLAG_HYPERCRITICAL_PROCESSING)) &&
KeGetCurrentIrql() > PASSIVE_LEVEL)
{
/* queue work item */
@@ -512,8 +512,8 @@
/* allocate new process pin array */
Status = _KsEdit(This->Filter.Bag,
(PVOID*)&This->ProcessPinIndex[ProcessPin->Pin->Id].Pins,
- (This->Filter.Descriptor->PinDescriptorsCount + 1) *
sizeof(PKSPROCESSPIN),
- This->Filter.Descriptor->PinDescriptorsCount *
sizeof(PKSPROCESSPIN),
+ (This->Filter.Descriptor->PinDescriptorsCount + 1) *
sizeof(PVOID),
+ This->Filter.Descriptor->PinDescriptorsCount * sizeof(PVOID),
0);
if (NT_SUCCESS(Status))
@@ -556,7 +556,7 @@
{
if (Pins[Index] == ProcessPin)
{
- RtlMoveMemory(&Pins[Index], &Pins[Index + 1], (Count - (Index + 1)) *
sizeof(PKSPROCESSPIN));
+ RtlMoveMemory(&Pins[Index], &Pins[Index + 1], (Count - (Index + 1)) *
sizeof(PVOID));
break;
}
@@ -755,7 +755,7 @@
}
/* ignore custom structs for now */
- ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
+ ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
ASSERT(This->Filter.Descriptor->PinDescriptorsCount > Pin->PinId);
Instances = (KSPIN_CINSTANCES*)Data;
@@ -787,7 +787,7 @@
}
/* ignore custom structs for now */
- ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
+ ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
ASSERT(This->Filter.Descriptor->PinDescriptorsCount > Pin->PinId);
Result = (PULONG)Data;
@@ -835,7 +835,7 @@
}
/* ignore custom structs for now */
- ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
+ ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
ASSERT(This->Filter.Descriptor->PinDescriptorsCount > Pin->PinId);
if (This->Filter.Descriptor->PinDescriptors[Pin->PinId].IntersectHandler ==
NULL ||
@@ -1147,8 +1147,8 @@
}
/* store instantiated pin arrays */
- Status = _KsEdit(This->Filter.Bag, (PVOID*)&This->FirstPin,
sizeof(PKSPIN) * FilterDescriptor->PinDescriptorsCount,
- sizeof(PKSPIN) * FilterDescriptor->PinDescriptorsCount, 0);
+ Status = _KsEdit(This->Filter.Bag, (PVOID*)&This->FirstPin,
sizeof(PVOID) * FilterDescriptor->PinDescriptorsCount,
+ sizeof(PVOID) * FilterDescriptor->PinDescriptorsCount, 0);
if (!NT_SUCCESS(Status))
{
@@ -1395,7 +1395,7 @@
/* sanity check */
ASSERT(Connect->PinId <
This->Filter.Descriptor->PinDescriptorsCount);
- DPRINT("IKsFilter_DispatchCreatePin KsValidateConnectRequest PinId %lu
CurrentInstanceCount %lu MaxPossible %lu\n", Connect->PinId,
+ DPRINT("IKsFilter_DispatchCreatePin KsValidateConnectRequest PinId %lu
CurrentInstanceCount %lu MaxPossible %lu\n", Connect->PinId,
This->PinInstanceCount[Connect->PinId],
This->Filter.Descriptor->PinDescriptors[Connect->PinId].InstancesPossible);
@@ -1922,7 +1922,7 @@
}
/* modify first pin array */
- Status = _KsEdit(This->Filter.Bag,(PVOID*)&This->FirstPin, sizeof(PKSPIN) *
Count, sizeof(PKSPIN) * This->Filter.Descriptor->PinDescriptorsCount, 0);
+ Status = _KsEdit(This->Filter.Bag,(PVOID*)&This->FirstPin, sizeof(PVOID) *
Count, sizeof(PVOID) * This->Filter.Descriptor->PinDescriptorsCount, 0);
if (!NT_SUCCESS(Status))
{
/* failed */
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/s…
==============================================================================
--- trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] Wed Aug 24 22:09:04
2011
@@ -1537,12 +1537,12 @@
&Dirql[i],
&Affinity[i]);
}
-
+
if (DeviceExtension->InterruptCount == 1 || Dirql[0] > Dirql[1])
MaxDirql = Dirql[0];
else
MaxDirql = Dirql[1];
-
+
for (i = 0; i < DeviceExtension->InterruptCount; i++)
{
/* Determing IRQ sharability as usual */
@@ -1576,7 +1576,7 @@
break;
}
}
-
+
if (!NT_SUCCESS(Status))
break;
}
@@ -1639,7 +1639,7 @@
/* Initialize bus scanning information */
DeviceExtension->BusesConfig = ExAllocatePoolWithTag(PagedPool,
- sizeof(PSCSI_BUS_SCAN_INFO) * DeviceExtension->PortConfig->NumberOfBuses
+ sizeof(PVOID) * DeviceExtension->PortConfig->NumberOfBuses
+ sizeof(ULONG), TAG_SCSIPORT);
if (!DeviceExtension->BusesConfig)
@@ -1651,7 +1651,7 @@
/* Zero it */
RtlZeroMemory(DeviceExtension->BusesConfig,
- sizeof(PSCSI_BUS_SCAN_INFO) * DeviceExtension->PortConfig->NumberOfBuses
+ sizeof(PVOID) * DeviceExtension->PortConfig->NumberOfBuses
+ sizeof(ULONG));
/* Store number of buses there */
@@ -2008,7 +2008,7 @@
case BusChangeDetected:
DPRINT1("UNIMPLEMENTED SCSI Notification called:
BusChangeDetected!\n");
break;
-
+
default:
DPRINT1 ("Unsupported notification from WMI: %lu\n", NotificationType);
break;
@@ -2183,7 +2183,7 @@
PortConfig->DmaPort != SP_UNINITIALIZED_VALUE)
{
Dma = 1;
-
+
if (PortConfig->DmaChannel2 != SP_UNINITIALIZED_VALUE ||
PortConfig->DmaPort2 != SP_UNINITIALIZED_VALUE)
Dma++;
@@ -2288,7 +2288,7 @@
ResourceDescriptor->u.Dma.Channel = (Dma == 2) ? PortConfig->DmaChannel2 :
PortConfig->DmaChannel;
ResourceDescriptor->u.Dma.Port = (Dma == 2) ? PortConfig->DmaPort2 :
PortConfig->DmaPort;
ResourceDescriptor->Flags = 0;
-
+
if (((Dma == 2) ? PortConfig->DmaWidth2 : PortConfig->DmaWidth) ==
Width8Bits)
ResourceDescriptor->Flags |= CM_RESOURCE_DMA_8;
else if (((Dma == 2) ? PortConfig->DmaWidth2 : PortConfig->DmaWidth) ==
Width16Bits)
@@ -2301,7 +2301,7 @@
if (((Dma == 2) ? PortConfig->DmaPort2 : PortConfig->DmaPort) ==
SP_UNINITIALIZED_VALUE)
ResourceDescriptor->u.Dma.Port = 0;
-
+
ResourceDescriptor++;
Dma--;
}
@@ -2327,12 +2327,11 @@
CHAR VendorIdString[8];
CHAR DeviceIdString[8];
UNICODE_STRING UnicodeStr;
- PCM_RESOURCE_LIST ResourceList;
+ PCM_RESOURCE_LIST ResourceList = NULL;
NTSTATUS Status;
DPRINT ("SpiGetPciConfiguration() called\n");
- RtlZeroMemory(&ResourceList, sizeof(PCM_RESOURCE_LIST));
SlotNumber.u.AsULONG = 0;
/* Loop through all devices */
@@ -5943,7 +5942,7 @@
UNICODE_STRING UnicodeString;
ANSI_STRING AnsiString;
NTSTATUS Status = STATUS_SUCCESS;
-
+
KeyValueInformation = (PKEY_VALUE_FULL_INFORMATION) Buffer;
@@ -6232,7 +6231,7 @@
break;
case CmResourceTypeInterrupt:
-
+
if (Interrupt == 0)
{
ConfigInfo->BusInterruptLevel =
@@ -6253,7 +6252,7 @@
ConfigInfo->InterruptMode2 = (PartialDescriptor->Flags
& CM_RESOURCE_INTERRUPT_LATCHED) ? Latched : LevelSensitive;
}
-
+
Interrupt++;
break;
@@ -6263,7 +6262,7 @@
{
ConfigInfo->DmaChannel = PartialDescriptor->u.Dma.Channel;
ConfigInfo->DmaPort = PartialDescriptor->u.Dma.Port;
-
+
if (PartialDescriptor->Flags & CM_RESOURCE_DMA_8)
ConfigInfo->DmaWidth = Width8Bits;
else if ((PartialDescriptor->Flags & CM_RESOURCE_DMA_16)
||
@@ -6276,7 +6275,7 @@
{
ConfigInfo->DmaChannel2 =
PartialDescriptor->u.Dma.Channel;
ConfigInfo->DmaPort2 = PartialDescriptor->u.Dma.Port;
-
+
if (PartialDescriptor->Flags & CM_RESOURCE_DMA_8)
ConfigInfo->DmaWidth2 = Width8Bits;
else if ((PartialDescriptor->Flags & CM_RESOURCE_DMA_16)
||
@@ -6285,7 +6284,7 @@
else if (PartialDescriptor->Flags & CM_RESOURCE_DMA_32)
ConfigInfo->DmaWidth2 = Width32Bits;
}
-
+
Dma++;
break;