diff options
| author | visvel <[email protected]> | 2022-05-11 08:58:53 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-11 08:58:53 -0700 |
| commit | cf17d8df1a423a7ee616bf8179e8e102fe674a57 (patch) | |
| tree | b4e52917e7bd18f77e4eb7d0c2f91226489be6f0 | |
| parent | a423bafcdcf7a58de7d3abd284f6107e4cce329f (diff) | |
Using ExAllocatePool2 for deferred API change (#719)
| -rw-r--r-- | serial/serenum/serenum.h | 5 | ||||
| -rw-r--r-- | storage/class/cdrom/src/autorun.c | 30 | ||||
| -rw-r--r-- | storage/class/cdrom/src/cdrom.c | 6 | ||||
| -rw-r--r-- | storage/class/cdrom/src/common.c | 38 | ||||
| -rw-r--r-- | storage/class/cdrom/src/init.c | 59 | ||||
| -rw-r--r-- | storage/class/cdrom/src/ioctl.c | 43 | ||||
| -rw-r--r-- | storage/class/cdrom/src/mmc.c | 6 | ||||
| -rw-r--r-- | storage/class/cdrom/src/scratch.c | 25 | ||||
| -rw-r--r-- | storage/class/cdrom/src/zpodd.c | 8 | ||||
| -rw-r--r-- | storage/class/disk/src/disk.h | 1 | ||||
| -rw-r--r-- | storage/sfloppy/src/floppy.c | 9 |
11 files changed, 110 insertions, 120 deletions
diff --git a/serial/serenum/serenum.h b/serial/serenum/serenum.h index 500d5f31..a3853f49 100644 --- a/serial/serenum/serenum.h +++ b/serial/serenum/serenum.h @@ -63,11 +63,6 @@ Revision History: #define SERENUM_POOL_TAG (ULONG)'mneS' -/*#undef ExAllocatePool -#define ExAllocatePool(type, size) \ - ExAllocatePoolWithTag(type, size, SERENUM_POOL_TAG)*/ - - #pragma warning(error:4100) // Unreferenced formal parameter #pragma warning(error:4705) // Statement has no effect // disable warnings diff --git a/storage/class/cdrom/src/autorun.c b/storage/class/cdrom/src/autorun.c index a1c6d9d9..57bacec5 100644 --- a/storage/class/cdrom/src/autorun.c +++ b/storage/class/cdrom/src/autorun.c @@ -1296,18 +1296,14 @@ Return Value: DeviceExtension->KernelModeMcnContext.LockCount = 0; DeviceExtension->KernelModeMcnContext.McnDisableCount = 0; - mediaChangeInfo = ExAllocatePoolWithTag(NonPagedPoolNx, - sizeof(MEDIA_CHANGE_DETECTION_INFO), - CDROM_TAG_MEDIA_CHANGE_DETECTION); + mediaChangeInfo = ExAllocatePool2(POOL_FLAG_NON_PAGED, + sizeof(MEDIA_CHANGE_DETECTION_INFO), + CDROM_TAG_MEDIA_CHANGE_DETECTION); if (mediaChangeInfo == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; } - else - { - RtlZeroMemory(mediaChangeInfo, sizeof(MEDIA_CHANGE_DETECTION_INFO)); - } if (NT_SUCCESS(status)) { @@ -1354,9 +1350,9 @@ Return Value: if (NT_SUCCESS(status)) { - senseBuffer = ExAllocatePoolWithTag(NonPagedPoolNxCacheAligned, - SENSE_BUFFER_SIZE, - CDROM_TAG_MEDIA_CHANGE_DETECTION); + senseBuffer = ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED, + SENSE_BUFFER_SIZE, + CDROM_TAG_MEDIA_CHANGE_DETECTION); if (senseBuffer == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; @@ -1531,9 +1527,9 @@ Return Value: { if (info->Gesn.Buffer == NULL) { - info->Gesn.Buffer = ExAllocatePoolWithTag(NonPagedPoolNxCacheAligned, - GESN_BUFFER_SIZE, - CDROM_TAG_GESN); + info->Gesn.Buffer = ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED, + GESN_BUFFER_SIZE, + CDROM_TAG_GESN); } if (info->Gesn.Buffer == NULL) @@ -2281,10 +2277,10 @@ Return Value: // allocate a buffer for the string deviceString.Length = (USHORT)( length ); deviceString.MaximumLength = deviceString.Length + 1; - deviceString.Buffer = (PCHAR)ExAllocatePoolWithTag( NonPagedPoolNx, - deviceString.MaximumLength, - CDROM_TAG_AUTORUN_DISABLE - ); + deviceString.Buffer = (PCHAR)ExAllocatePool2(POOL_FLAG_NON_PAGED, + deviceString.MaximumLength, + CDROM_TAG_AUTORUN_DISABLE + ); if (deviceString.Buffer == NULL) { TracePrint((TRACE_LEVEL_INFORMATION, TRACE_FLAG_MCN, diff --git a/storage/class/cdrom/src/cdrom.c b/storage/class/cdrom/src/cdrom.c index a93646ba..fccf4a0e 100644 --- a/storage/class/cdrom/src/cdrom.c +++ b/storage/class/cdrom/src/cdrom.c @@ -439,9 +439,9 @@ Return Value: // 7. Now, the device can be created. { - wideDeviceName = ExAllocatePoolWithTag(NonPagedPoolNx, - 64 * sizeof(WCHAR), - CDROM_TAG_STRINGS); + wideDeviceName = ExAllocatePool2(POOL_FLAG_NON_PAGED, + 64 * sizeof(WCHAR), + CDROM_TAG_STRINGS); if (wideDeviceName == NULL) { diff --git a/storage/class/cdrom/src/common.c b/storage/class/cdrom/src/common.c index b1ab41ec..13312ac6 100644 --- a/storage/class/cdrom/src/common.c +++ b/storage/class/cdrom/src/common.c @@ -523,9 +523,9 @@ BufferLength and WriteToDevice to control the data direction of the device Srb->SenseInfoBufferLength = SENSE_BUFFER_SIZE; // Sense buffer is in aligned nonpaged pool. - senseInfoBuffer = ExAllocatePoolWithTag(NonPagedPoolNxCacheAligned, - SENSE_BUFFER_SIZE, - CDROM_TAG_SENSE_INFO); + senseInfoBuffer = ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED, + SENSE_BUFFER_SIZE, + CDROM_TAG_SENSE_INFO); if (senseInfoBuffer == NULL) { @@ -838,9 +838,9 @@ Return Value: return; } - notification = ExAllocatePoolWithTag(NonPagedPoolNx, - requiredSize, - CDROM_TAG_NOTIFICATION); + notification = ExAllocatePool2(POOL_FLAG_NON_PAGED, + requiredSize, + CDROM_TAG_NOTIFICATION); // if none allocated, exit if (notification == NULL) @@ -919,9 +919,9 @@ Return Value: if (NT_SUCCESS(status)) { // Allocate Srb from nonpaged pool. - context = ExAllocatePoolWithTag(NonPagedPoolNx, - sizeof(COMPLETION_CONTEXT), - CDROM_TAG_COMPLETION_CONTEXT); + context = ExAllocatePool2(POOL_FLAG_NON_PAGED, + sizeof(COMPLETION_CONTEXT), + CDROM_TAG_COMPLETION_CONTEXT); if (context == NULL) { @@ -2272,7 +2272,7 @@ Return Value: ); dvdReadStructure = (PDVD_READ_STRUCTURE) - ExAllocatePoolWithTag(PagedPool, bufferLen, DVD_TAG_DVD_REGION); + ExAllocatePool2(POOL_FLAG_PAGED, bufferLen, DVD_TAG_DVD_REGION); if (dvdReadStructure == NULL) { @@ -2656,9 +2656,9 @@ Return Value: TracePrint((TRACE_LEVEL_INFORMATION, TRACE_FLAG_IOCTL, "DeviceRestoreDefaultSpeed: Restore device speed for %p\n", device)); - perfDescriptor = ExAllocatePoolWithTag(NonPagedPoolNxCacheAligned, - transferLength, - CDROM_TAG_STREAM); + perfDescriptor = ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED, + transferLength, + CDROM_TAG_STREAM); if (perfDescriptor == NULL) { return; @@ -2765,9 +2765,9 @@ Return Value: PCDROM_REQUEST_CONTEXT requestContext = RequestGetContext(Request); PKEVENT syncEvent = NULL; - syncEvent = ExAllocatePoolWithTag(NonPagedPoolNx, - sizeof(KEVENT), - CDROM_TAG_SYNC_EVENT); + syncEvent = ExAllocatePool2(POOL_FLAG_NON_PAGED, + sizeof(KEVENT), + CDROM_TAG_SYNC_EVENT); if (syncEvent == NULL) { @@ -3832,10 +3832,10 @@ Return Value: // send request and check status // Disable SDV warning about infinitely waiting in caller's context: - // 1. Some requests (such as SCSI_PASS_THROUGH, contains buffer from user space) need to be sent down in caller�s context. - // Consequently, these requests wait in caller�s context until they are allowed to be sent down. + // 1. Some requests (such as SCSI_PASS_THROUGH, contains buffer from user space) need to be sent down in callers context. + // Consequently, these requests wait in callers context until they are allowed to be sent down. // 2. Considering the situation that during sleep, a request can be hold by storage port driver. When system resumes, any time out value (if we set using KMDF time out value) might be expires. - // This will cause the waiting request being failed (behavior change). We�d rather not set time out value. + // This will cause the waiting request being failed (behavior change). Wed rather not set time out value. _Analysis_assume_(options.Timeout != 0); requestSent = WdfRequestSend(Request, IoTarget, &options); diff --git a/storage/class/cdrom/src/init.c b/storage/class/cdrom/src/init.c index 2c8bbd38..0dc176fd 100644 --- a/storage/class/cdrom/src/init.c +++ b/storage/class/cdrom/src/init.c @@ -698,9 +698,9 @@ Return Value: // Save away the symbolic link name in the driver data block. We need // it so we can delete the link when the device is removed. - savedName = ExAllocatePoolWithTag(PagedPool, - unicodeLinkName.MaximumLength, - CDROM_TAG_STRINGS); + savedName = ExAllocatePool2(POOL_FLAG_PAGED, + unicodeLinkName.MaximumLength, + CDROM_TAG_STRINGS); if (savedName == NULL) { @@ -818,9 +818,9 @@ Return Value: // allocate a private extension for class data if (DeviceExtension->PrivateFdoData == NULL) { - DeviceExtension->PrivateFdoData = ExAllocatePoolWithTag(NonPagedPoolNx, - sizeof(CDROM_PRIVATE_FDO_DATA), - CDROM_TAG_PRIVATE_DATA); + DeviceExtension->PrivateFdoData = ExAllocatePool2(POOL_FLAG_NON_PAGED, + sizeof(CDROM_PRIVATE_FDO_DATA), + CDROM_TAG_PRIVATE_DATA); } if (DeviceExtension->PrivateFdoData == NULL) @@ -834,9 +834,9 @@ Return Value: } // Allocate request sense buffer. - senseData = ExAllocatePoolWithTag(NonPagedPoolNxCacheAligned, - SENSE_BUFFER_SIZE, - CDROM_TAG_SENSE_INFO); + senseData = ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED, + SENSE_BUFFER_SIZE, + CDROM_TAG_SENSE_INFO); if (senseData == NULL) { @@ -1068,7 +1068,7 @@ Return Value: NT_ASSERT(bufferLength >= sizeof(STORAGE_PROPERTY_QUERY)); bufferLength = max(bufferLength, sizeof(STORAGE_PROPERTY_QUERY)); - descriptor = ExAllocatePoolWithTag(NonPagedPoolNx, bufferLength, CDROM_TAG_DESCRIPTOR); + descriptor = ExAllocatePool2(POOL_FLAG_NON_PAGED, bufferLength, CDROM_TAG_DESCRIPTOR); if(descriptor == NULL) { @@ -1795,9 +1795,9 @@ Return Value: // from the PC-standard 2K to 512. Change the block transfer size // back to the PC-standard 2K by using a mode select command. - modeParameters = ExAllocatePoolWithTag(NonPagedPoolNx, - sizeof(MODE_PARM_READ_WRITE_DATA), - CDROM_TAG_MODE_DATA); + modeParameters = ExAllocatePool2(POOL_FLAG_NON_PAGED, + sizeof(MODE_PARM_READ_WRITE_DATA), + CDROM_TAG_MODE_DATA); if (modeParameters == NULL) { return; @@ -1919,9 +1919,9 @@ Return Value: // 1. retrieve the inquiry data length // 1.1 allocate inquiry data buffer - tmpInquiry = ExAllocatePoolWithTag(NonPagedPoolNx, - requestedInquiryTransferBytes, - CDROM_TAG_INQUIRY); + tmpInquiry = ExAllocatePool2(POOL_FLAG_NON_PAGED, + requestedInquiryTransferBytes, + CDROM_TAG_INQUIRY); if (tmpInquiry == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; @@ -1987,9 +1987,9 @@ Return Value: FREE_POOL(tmpInquiry); RtlZeroMemory(&srb, sizeof(SCSI_REQUEST_BLOCK)); - tmpInquiry = ExAllocatePoolWithTag(NonPagedPoolNx, - requestedInquiryTransferBytes, - CDROM_TAG_INQUIRY); + tmpInquiry = ExAllocatePool2(POOL_FLAG_NON_PAGED, + requestedInquiryTransferBytes, + CDROM_TAG_INQUIRY); if (tmpInquiry == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; @@ -2025,9 +2025,9 @@ Return Value: FREE_POOL(tmpInquiry); RtlZeroMemory(&srb, sizeof(SCSI_REQUEST_BLOCK)); - tmpInquiry = ExAllocatePoolWithTag(NonPagedPoolNx, - requestedInquiryTransferBytes, - CDROM_TAG_INQUIRY); + tmpInquiry = ExAllocatePool2(POOL_FLAG_NON_PAGED, + requestedInquiryTransferBytes, + CDROM_TAG_INQUIRY); if (tmpInquiry == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; @@ -2283,10 +2283,9 @@ Return Value: ULONG featureSize = sizeof(GET_CONFIGURATION_HEADER)+sizeof(FEATURE_HEADER); ULONG usable = 0; - PGET_CONFIGURATION_HEADER configBuffer = ExAllocatePoolWithTag( - NonPagedPoolNx, - featureSize, - CDROM_TAG_GET_CONFIG); + PGET_CONFIGURATION_HEADER configBuffer = ExAllocatePool2(POOL_FLAG_NON_PAGED, + featureSize, + CDROM_TAG_GET_CONFIG); if (configBuffer == NULL) { @@ -2462,7 +2461,7 @@ Return Value: // Set timeout value from device extension. srb.TimeOutValue = DeviceExtension->TimeOutValue; - buffer = ExAllocatePoolWithTag(NonPagedPoolNx, bufferLength, CDROM_TAG_MODE_DATA); + buffer = ExAllocatePool2(POOL_FLAG_NON_PAGED, bufferLength, CDROM_TAG_MODE_DATA); if (buffer == NULL) { @@ -2608,9 +2607,9 @@ Return Value: // we got a DVD drive. bufferLen = DVD_RPC_KEY_LENGTH; - copyProtectKey = (PDVD_COPY_PROTECT_KEY)ExAllocatePoolWithTag(PagedPool, - bufferLen, - DVD_TAG_RPC2_CHECK); + copyProtectKey = (PDVD_COPY_PROTECT_KEY)ExAllocatePool2(POOL_FLAG_PAGED, + bufferLen, + DVD_TAG_RPC2_CHECK); if (copyProtectKey == NULL) { diff --git a/storage/class/cdrom/src/ioctl.c b/storage/class/cdrom/src/ioctl.c index 590f1419..f0a540fc 100644 --- a/storage/class/cdrom/src/ioctl.c +++ b/storage/class/cdrom/src/ioctl.c @@ -224,9 +224,9 @@ Return Value: // Allocate the required memory NT_ASSERT(sizeof(SUB_Q_CURRENT_POSITION) >= sizeof(CDROM_SUB_Q_DATA_FORMAT)); - currentBuffer = ExAllocatePoolWithTag(NonPagedPoolNxCacheAligned, - sizeof(SUB_Q_CURRENT_POSITION), - CDROM_TAG_PLAY_ACTIVE); + currentBuffer = ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED, + sizeof(SUB_Q_CURRENT_POSITION), + CDROM_TAG_PLAY_ACTIVE); if (currentBuffer == NULL) { return FALSE; @@ -553,9 +553,9 @@ Return Value: // could this be to deal with device alignment issues? keyLength += sizeof(ULONGLONG) - (keyLength & (sizeof(ULONGLONG) - 1)); - readStructure = ExAllocatePoolWithTag(NonPagedPoolNx, - keyLength, - DVD_TAG_READ_KEY); + readStructure = ExAllocatePool2(POOL_FLAG_NON_PAGED, + keyLength, + DVD_TAG_READ_KEY); if (readStructure == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; @@ -3071,10 +3071,10 @@ Return Value: if (NT_SUCCESS(status)) { - srb = ExAllocatePoolWithTag(NonPagedPoolNx, - sizeof(SCSI_REQUEST_BLOCK) + - (sizeof(ULONG_PTR) * 2), - CDROM_TAG_SRB); + srb = ExAllocatePool2(POOL_FLAG_NON_PAGED, + sizeof(SCSI_REQUEST_BLOCK) + + (sizeof(ULONG_PTR) * 2), + CDROM_TAG_SRB); if (srb == NULL) { @@ -3127,9 +3127,9 @@ Return Value: status = STATUS_SUCCESS; } - modeData = ExAllocatePoolWithTag(NonPagedPoolNxCacheAligned, - MODE_PAGE_DATA_SIZE, - CDROM_TAG_MODE_DATA); + modeData = ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED, + MODE_PAGE_DATA_SIZE, + CDROM_TAG_MODE_DATA); if (modeData == NULL) { @@ -4130,9 +4130,9 @@ Return Value: if (NT_SUCCESS(status)) { - valueName = ExAllocatePoolWithTag(PagedPool, - DeviceExtension->DeviceName.Length + sizeof(WCHAR), - CDROM_TAG_STRINGS); + valueName = ExAllocatePool2(POOL_FLAG_PAGED, + DeviceExtension->DeviceName.Length + sizeof(WCHAR), + CDROM_TAG_STRINGS); if (valueName == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; @@ -6622,7 +6622,7 @@ Return Value: *DataLength = 0; - srb = ExAllocatePoolWithTag(NonPagedPoolNx, + srb = ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(SCSI_REQUEST_BLOCK) + (sizeof(ULONG_PTR) * 2), CDROM_TAG_SRB); @@ -6636,7 +6636,6 @@ Return Value: { ioctlCode = RequestParameters.Parameters.DeviceIoControl.IoControlCode; cdb = (PCDB)srb->Cdb; - RtlZeroMemory(srb, sizeof(SCSI_REQUEST_BLOCK)); if (TEST_FLAG(DeviceExtension->PrivateFdoData->HackFlags, FDO_HACK_NO_RESERVE6)) { @@ -6895,7 +6894,7 @@ Return Value: NULL); if (NT_SUCCESS(status)) { - srb = ExAllocatePoolWithTag(NonPagedPoolNx, + srb = ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(SCSI_REQUEST_BLOCK) + (sizeof(ULONG_PTR) * 2), CDROM_TAG_SRB); @@ -8538,9 +8537,9 @@ Return Value: PDVD_READ_STRUCTURE readStructureRequest = (PDVD_READ_STRUCTURE)keyParameters; // save the key header so we can restore the interesting parts later - keyHeader = ExAllocatePoolWithTag(NonPagedPoolNx, - sizeof(DVD_COPY_PROTECT_KEY), - DVD_TAG_READ_KEY); + keyHeader = ExAllocatePool2(POOL_FLAG_NON_PAGED, + sizeof(DVD_COPY_PROTECT_KEY), + DVD_TAG_READ_KEY); if(keyHeader == NULL) { diff --git a/storage/class/cdrom/src/mmc.c b/storage/class/cdrom/src/mmc.c index 3887cc2f..5f96726c 100644 --- a/storage/class/cdrom/src/mmc.c +++ b/storage/class/cdrom/src/mmc.c @@ -469,9 +469,9 @@ NOTE: does not handle case where more than 65000 bytes are returned, if (NT_SUCCESS(status)) { // allocate the memory - buffer = (PGET_CONFIGURATION_HEADER)ExAllocatePoolWithTag(NonPagedPoolNxCacheAligned, - size, - CDROM_TAG_FEATURE); + buffer = (PGET_CONFIGURATION_HEADER)ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED, + size, + CDROM_TAG_FEATURE); if (buffer == NULL) { diff --git a/storage/class/cdrom/src/scratch.c b/storage/class/cdrom/src/scratch.c index fdd37f5f..fe82049a 100644 --- a/storage/class/cdrom/src/scratch.c +++ b/storage/class/cdrom/src/scratch.c @@ -178,9 +178,9 @@ Return Value: // allocate the buffer if (NT_SUCCESS(status)) { - DeviceExtension->ScratchContext.ScratchBuffer = ExAllocatePoolWithTag(NonPagedPoolNx, - DeviceExtension->ScratchContext.ScratchBufferSize, - CDROM_TAG_SCRATCH); + DeviceExtension->ScratchContext.ScratchBuffer = ExAllocatePool2(POOL_FLAG_NON_PAGED, + DeviceExtension->ScratchContext.ScratchBufferSize, + CDROM_TAG_SCRATCH); if (DeviceExtension->ScratchContext.ScratchBuffer == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; @@ -243,9 +243,9 @@ Return Value: // allocate the srb if (NT_SUCCESS(status)) { - DeviceExtension->ScratchContext.ScratchSrb = ExAllocatePoolWithTag(NonPagedPoolNx, - sizeof(SCSI_REQUEST_BLOCK), - CDROM_TAG_SCRATCH); + DeviceExtension->ScratchContext.ScratchSrb = ExAllocatePool2(POOL_FLAG_NON_PAGED, + sizeof(SCSI_REQUEST_BLOCK), + CDROM_TAG_SCRATCH); if (DeviceExtension->ScratchContext.ScratchSrb == NULL) { @@ -258,9 +258,9 @@ Return Value: // allocate the sense buffer if (NT_SUCCESS(status)) { - DeviceExtension->ScratchContext.ScratchSense = ExAllocatePoolWithTag(NonPagedPoolNx, - sizeof(SENSE_DATA), - CDROM_TAG_SCRATCH); + DeviceExtension->ScratchContext.ScratchSense = ExAllocatePool2(POOL_FLAG_NON_PAGED, + sizeof(SENSE_DATA), + CDROM_TAG_SCRATCH); if (DeviceExtension->ScratchContext.ScratchSense == NULL) { @@ -277,9 +277,9 @@ Return Value: size_t allocationSize = sizeof(SRB_HISTORY) - sizeof(SRB_HISTORY_ITEM); allocationSize += 20 * sizeof(SRB_HISTORY_ITEM); - DeviceExtension->ScratchContext.ScratchHistory = ExAllocatePoolWithTag(NonPagedPoolNx, - allocationSize, - CDROM_TAG_SCRATCH); + DeviceExtension->ScratchContext.ScratchHistory = ExAllocatePool2(POOL_FLAG_NON_PAGED, + allocationSize, + CDROM_TAG_SCRATCH); if (DeviceExtension->ScratchContext.ScratchHistory == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; @@ -290,7 +290,6 @@ Return Value: else { // must be initialized here... - RtlZeroMemory(DeviceExtension->ScratchContext.ScratchHistory, allocationSize); DeviceExtension->ScratchContext.ScratchHistory->TotalHistoryCount = 20; } } diff --git a/storage/class/cdrom/src/zpodd.c b/storage/class/cdrom/src/zpodd.c index 59434896..9e729143 100644 --- a/storage/class/cdrom/src/zpodd.c +++ b/storage/class/cdrom/src/zpodd.c @@ -126,9 +126,9 @@ Return Value: goto Cleanup; } - zpoddInfo = ExAllocatePoolWithTag(NonPagedPoolNx, - sizeof(ZERO_POWER_ODD_INFO), - CDROM_TAG_ZERO_POWER_ODD); + zpoddInfo = ExAllocatePool2(POOL_FLAG_NON_PAGED, + sizeof(ZERO_POWER_ODD_INFO), + CDROM_TAG_ZERO_POWER_ODD); if (zpoddInfo == NULL) { @@ -137,8 +137,6 @@ Return Value: goto Cleanup; } - RtlZeroMemory(zpoddInfo, sizeof (ZERO_POWER_ODD_INFO)); - // // Check the system for the following prerequisites: // diff --git a/storage/class/disk/src/disk.h b/storage/class/disk/src/disk.h index 91427ba3..48aa71d7 100644 --- a/storage/class/disk/src/disk.h +++ b/storage/class/disk/src/disk.h @@ -44,7 +44,6 @@ Revision History: #define WPP_CONTROL_GUIDS WPP_CONTROL_GUIDS_NORMAL_FLAGS(WPP_GUID_DISK) #endif - #ifdef ExAllocatePool #undef ExAllocatePool #define ExAllocatePool #NT_ASSERT(FALSE) diff --git a/storage/sfloppy/src/floppy.c b/storage/sfloppy/src/floppy.c index fc084f7c..282885a6 100644 --- a/storage/sfloppy/src/floppy.c +++ b/storage/sfloppy/src/floppy.c @@ -45,6 +45,7 @@ Revision History: #define MODE_DATA_SIZE 192 #define SCSI_FLOPPY_TIMEOUT 20 #define SFLOPPY_SRB_LIST_SIZE 4 +#define SFLOPPY_TAG 'poFS' // // Define all possible drive/media combinations, given drives listed above // and media types in ntdddisk.h. @@ -779,7 +780,9 @@ ScsiFlopInitDevice( // Allocate request sense buffer. // - senseData = ExAllocatePool(NonPagedPoolNxCacheAligned, SENSE_BUFFER_SIZE); + senseData = ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED, + SENSE_BUFFER_SIZE, + SFLOPPY_TAG); if (senseData == NULL) { @@ -1089,7 +1092,9 @@ Return Value: // Irp->IoStatus.Information = 0; - srb = ExAllocatePool(NonPagedPoolNx, SCSI_REQUEST_BLOCK_SIZE); + srb = ExAllocatePool2(POOL_FLAG_NON_PAGED, + SCSI_REQUEST_BLOCK_SIZE, + SFLOPPY_TAG); if (srb == NULL) { |
