mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 05:12:55 +00:00
[RAMDISK]
- Fix DeviceRelations allocation bug - Code style: Use sizeof(UNICODE_NULL) where needed; use sizeof(*ptr) for size of type pointed by ptr, when allocating space for ptr. svn path=/trunk/; revision=66020
This commit is contained in:
parent
64f6189e30
commit
79f472a422
1 changed files with 11 additions and 12 deletions
|
@ -1345,7 +1345,7 @@ RamdiskQueryDeviceRelations(IN DEVICE_RELATION_TYPE Type,
|
|||
|
||||
/* Allocate a buffer big enough to contain only one DO */
|
||||
DeviceRelations = ExAllocatePoolWithTag(PagedPool,
|
||||
sizeof(DeviceRelations),
|
||||
sizeof(*DeviceRelations),
|
||||
'dmaR');
|
||||
if (DeviceRelations != NULL)
|
||||
{
|
||||
|
@ -1795,7 +1795,7 @@ RamdiskQueryBusInformation(IN PDEVICE_OBJECT DeviceObject,
|
|||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
/* Allocate output memory */
|
||||
PnpBusInfo = ExAllocatePoolWithTag(PagedPool, sizeof(PNP_BUS_INFORMATION), 'dmaR');
|
||||
PnpBusInfo = ExAllocatePoolWithTag(PagedPool, sizeof(*PnpBusInfo), 'dmaR');
|
||||
if (PnpBusInfo == NULL)
|
||||
{
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
@ -2301,8 +2301,7 @@ RamdiskAddDevice(IN PDRIVER_OBJECT DriverObject,
|
|||
{
|
||||
/* Initialize the bus FDO extension */
|
||||
DeviceExtension = DeviceObject->DeviceExtension;
|
||||
RtlZeroMemory(DeviceObject->DeviceExtension,
|
||||
sizeof(RAMDISK_BUS_EXTENSION));
|
||||
RtlZeroMemory(DeviceExtension, sizeof(*DeviceExtension));
|
||||
|
||||
/* Set bus FDO flags */
|
||||
DeviceObject->Flags |= DO_POWER_PAGABLE | DO_DIRECT_IO;
|
||||
|
@ -2378,7 +2377,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
|
|||
DriverRegistryPath = *RegistryPath;
|
||||
DriverRegistryPath.Buffer = ExAllocatePoolWithTag(PagedPool,
|
||||
RegistryPath->Length +
|
||||
sizeof(WCHAR),
|
||||
sizeof(UNICODE_NULL),
|
||||
'dmaR');
|
||||
if (!DriverRegistryPath.Buffer) return STATUS_INSUFFICIENT_RESOURCES;
|
||||
RtlCopyUnicodeString(&DriverRegistryPath, RegistryPath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue