diff --git a/reactos/drivers/bus/pci/fdo.c b/reactos/drivers/bus/pci/fdo.c index 7f3d7420d9e..1f041c55a41 100644 --- a/reactos/drivers/bus/pci/fdo.c +++ b/reactos/drivers/bus/pci/fdo.c @@ -9,7 +9,9 @@ #include "pci.h" +#ifndef NDEBUG #define NDEBUG +#endif #include /*** PRIVATE *****************************************************************/ @@ -122,7 +124,7 @@ FdoEnumerateDevices( Status = FdoLocateChildDevice(&Device, DeviceExtension, SlotNumber, &PciConfig); if (!NT_SUCCESS(Status)) { - Device = (PPCI_DEVICE)ExAllocatePool(NonPagedPool, sizeof(PCI_DEVICE)); + Device = (PPCI_DEVICE)ExAllocatePoolWithTag(NonPagedPool, sizeof(PCI_DEVICE),TAG_PCI); if (!Device) { /* FIXME: Cleanup resources for already discovered devices */ @@ -204,7 +206,7 @@ FdoQueryBusRelations( Size = sizeof(DEVICE_RELATIONS) + sizeof(Relations->Objects) * (DeviceExtension->DeviceListCount - 1); - Relations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, Size); + Relations = (PDEVICE_RELATIONS)ExAllocatePoolWithTag(PagedPool, Size, TAG_PCI); if (!Relations) return STATUS_INSUFFICIENT_RESOURCES; diff --git a/reactos/drivers/bus/pci/pci.c b/reactos/drivers/bus/pci/pci.c index f5590a086d4..6bb2e9f7e54 100644 --- a/reactos/drivers/bus/pci/pci.c +++ b/reactos/drivers/bus/pci/pci.c @@ -10,7 +10,9 @@ #define INITGUID #include "pci.h" +#ifndef NDEBUG #define NDEBUG +#endif #include @@ -280,7 +282,7 @@ PciCreateHardwareIDsString(PUNICODE_STRING HardwareIDs, Buffer[Index] = UNICODE_NULL; - BufferU.Length = BufferU.MaximumLength = Index * sizeof(WCHAR); + BufferU.Length = BufferU.MaximumLength = (USHORT) Index * sizeof(WCHAR); BufferU.Buffer = Buffer; return RtlDuplicateUnicodeString(0, &BufferU, HardwareIDs); @@ -344,7 +346,7 @@ PciCreateCompatibleIDsString(PUNICODE_STRING CompatibleIDs, Buffer[Index] = UNICODE_NULL; - BufferU.Length = BufferU.MaximumLength = Index * sizeof(WCHAR); + BufferU.Length = BufferU.MaximumLength = (USHORT)Index * sizeof(WCHAR); BufferU.Buffer = Buffer; return RtlDuplicateUnicodeString(0, &BufferU, CompatibleIDs); diff --git a/reactos/drivers/bus/pci/pci.h b/reactos/drivers/bus/pci/pci.h index 4fee9a49c6a..78fca73b24d 100644 --- a/reactos/drivers/bus/pci/pci.h +++ b/reactos/drivers/bus/pci/pci.h @@ -4,6 +4,15 @@ #include #include #include +#include + +#ifdef _MSC_VER + #define STDCALL + #define DDKAPI +#endif + +#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) +#define TAG_PCI TAG('P', 'C', 'I', '0') typedef struct _PCI_DEVICE { diff --git a/reactos/drivers/bus/pci/pdo.c b/reactos/drivers/bus/pci/pdo.c index a8e6271bf24..e858c96f767 100644 --- a/reactos/drivers/bus/pci/pdo.c +++ b/reactos/drivers/bus/pci/pdo.c @@ -9,7 +9,9 @@ #include "pci.h" +#ifndef NDEBUG #define NDEBUG +#endif #include /*** PRIVATE *****************************************************************/ @@ -134,7 +136,7 @@ PdoQueryBusInformation( DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceExtension->Fdo->DeviceExtension; - BusInformation = ExAllocatePool(PagedPool, sizeof(PNP_BUS_INFORMATION)); + BusInformation = ExAllocatePoolWithTag(PagedPool, sizeof(PNP_BUS_INFORMATION), TAG_PCI); Irp->IoStatus.Information = (ULONG_PTR)BusInformation; if (BusInformation != NULL) { @@ -397,8 +399,8 @@ PdoQueryResourceRequirements( DPRINT("ListSize %lu (0x%lx)\n", ListSize, ListSize); /* Allocate the resource requirements list */ - ResourceList = ExAllocatePool(PagedPool, - ListSize); + ResourceList = ExAllocatePoolWithTag(PagedPool, + ListSize, TAG_PCI); if (ResourceList == NULL) { Irp->IoStatus.Information = 0; @@ -702,8 +704,8 @@ PdoQueryResources( + ResCount * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); /* Allocate the resource list */ - ResourceList = ExAllocatePool(PagedPool, - ListSize); + ResourceList = ExAllocatePoolWithTag(PagedPool, + ListSize, TAG_PCI); if (ResourceList == NULL) return STATUS_INSUFFICIENT_RESOURCES;