-some minor changes to be able to build the driver with PREfast

-use ExAllocatePoolWithTag instead of ExAllocatePool

svn path=/trunk/; revision=27434
This commit is contained in:
Christoph von Wittich 2007-07-06 20:25:40 +00:00
parent 01b3f0d7cf
commit 8b8021bbb9
4 changed files with 24 additions and 9 deletions

View file

@ -9,7 +9,9 @@
#include "pci.h"
#ifndef NDEBUG
#define NDEBUG
#endif
#include <debug.h>
/*** 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;

View file

@ -10,7 +10,9 @@
#define INITGUID
#include "pci.h"
#ifndef NDEBUG
#define NDEBUG
#endif
#include <debug.h>
@ -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);

View file

@ -4,6 +4,15 @@
#include <ntifs.h>
#include <wdmguid.h>
#include <stdio.h>
#include <ntddk.h>
#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
{

View file

@ -9,7 +9,9 @@
#include "pci.h"
#ifndef NDEBUG
#define NDEBUG
#endif
#include <debug.h>
/*** 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;