mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 20:36:35 +00:00
-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:
parent
01b3f0d7cf
commit
8b8021bbb9
4 changed files with 24 additions and 9 deletions
|
@ -9,7 +9,9 @@
|
||||||
|
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
#endif
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
/*** PRIVATE *****************************************************************/
|
/*** PRIVATE *****************************************************************/
|
||||||
|
@ -122,7 +124,7 @@ FdoEnumerateDevices(
|
||||||
Status = FdoLocateChildDevice(&Device, DeviceExtension, SlotNumber, &PciConfig);
|
Status = FdoLocateChildDevice(&Device, DeviceExtension, SlotNumber, &PciConfig);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
Device = (PPCI_DEVICE)ExAllocatePool(NonPagedPool, sizeof(PCI_DEVICE));
|
Device = (PPCI_DEVICE)ExAllocatePoolWithTag(NonPagedPool, sizeof(PCI_DEVICE),TAG_PCI);
|
||||||
if (!Device)
|
if (!Device)
|
||||||
{
|
{
|
||||||
/* FIXME: Cleanup resources for already discovered devices */
|
/* FIXME: Cleanup resources for already discovered devices */
|
||||||
|
@ -204,7 +206,7 @@ FdoQueryBusRelations(
|
||||||
|
|
||||||
Size = sizeof(DEVICE_RELATIONS) + sizeof(Relations->Objects) *
|
Size = sizeof(DEVICE_RELATIONS) + sizeof(Relations->Objects) *
|
||||||
(DeviceExtension->DeviceListCount - 1);
|
(DeviceExtension->DeviceListCount - 1);
|
||||||
Relations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, Size);
|
Relations = (PDEVICE_RELATIONS)ExAllocatePoolWithTag(PagedPool, Size, TAG_PCI);
|
||||||
if (!Relations)
|
if (!Relations)
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
#define INITGUID
|
#define INITGUID
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
#endif
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -280,7 +282,7 @@ PciCreateHardwareIDsString(PUNICODE_STRING HardwareIDs,
|
||||||
|
|
||||||
Buffer[Index] = UNICODE_NULL;
|
Buffer[Index] = UNICODE_NULL;
|
||||||
|
|
||||||
BufferU.Length = BufferU.MaximumLength = Index * sizeof(WCHAR);
|
BufferU.Length = BufferU.MaximumLength = (USHORT) Index * sizeof(WCHAR);
|
||||||
BufferU.Buffer = Buffer;
|
BufferU.Buffer = Buffer;
|
||||||
|
|
||||||
return RtlDuplicateUnicodeString(0, &BufferU, HardwareIDs);
|
return RtlDuplicateUnicodeString(0, &BufferU, HardwareIDs);
|
||||||
|
@ -344,7 +346,7 @@ PciCreateCompatibleIDsString(PUNICODE_STRING CompatibleIDs,
|
||||||
|
|
||||||
Buffer[Index] = UNICODE_NULL;
|
Buffer[Index] = UNICODE_NULL;
|
||||||
|
|
||||||
BufferU.Length = BufferU.MaximumLength = Index * sizeof(WCHAR);
|
BufferU.Length = BufferU.MaximumLength = (USHORT)Index * sizeof(WCHAR);
|
||||||
BufferU.Buffer = Buffer;
|
BufferU.Buffer = Buffer;
|
||||||
|
|
||||||
return RtlDuplicateUnicodeString(0, &BufferU, CompatibleIDs);
|
return RtlDuplicateUnicodeString(0, &BufferU, CompatibleIDs);
|
||||||
|
|
|
@ -4,6 +4,15 @@
|
||||||
#include <ntifs.h>
|
#include <ntifs.h>
|
||||||
#include <wdmguid.h>
|
#include <wdmguid.h>
|
||||||
#include <stdio.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
|
typedef struct _PCI_DEVICE
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
|
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
#endif
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
/*** PRIVATE *****************************************************************/
|
/*** PRIVATE *****************************************************************/
|
||||||
|
@ -134,7 +136,7 @@ PdoQueryBusInformation(
|
||||||
|
|
||||||
DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceExtension->Fdo->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;
|
Irp->IoStatus.Information = (ULONG_PTR)BusInformation;
|
||||||
if (BusInformation != NULL)
|
if (BusInformation != NULL)
|
||||||
{
|
{
|
||||||
|
@ -397,8 +399,8 @@ PdoQueryResourceRequirements(
|
||||||
DPRINT("ListSize %lu (0x%lx)\n", ListSize, ListSize);
|
DPRINT("ListSize %lu (0x%lx)\n", ListSize, ListSize);
|
||||||
|
|
||||||
/* Allocate the resource requirements list */
|
/* Allocate the resource requirements list */
|
||||||
ResourceList = ExAllocatePool(PagedPool,
|
ResourceList = ExAllocatePoolWithTag(PagedPool,
|
||||||
ListSize);
|
ListSize, TAG_PCI);
|
||||||
if (ResourceList == NULL)
|
if (ResourceList == NULL)
|
||||||
{
|
{
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
|
@ -702,8 +704,8 @@ PdoQueryResources(
|
||||||
+ ResCount * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
|
+ ResCount * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
|
||||||
|
|
||||||
/* Allocate the resource list */
|
/* Allocate the resource list */
|
||||||
ResourceList = ExAllocatePool(PagedPool,
|
ResourceList = ExAllocatePoolWithTag(PagedPool,
|
||||||
ListSize);
|
ListSize, TAG_PCI);
|
||||||
if (ResourceList == NULL)
|
if (ResourceList == NULL)
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue