{
NTSTATUS Status;
PKNORMAL_ROUTINE NormalRoutine;
- PVOID NormalContext;
+ PVOID NormalContext = NULL;
KIRQL OldIrql;
PAGED_CODE();
IOTRACE(IO_API_DEBUG, "IRP: %p. DO: %p. FO: %p \n",
Executive,
PreviousMode,
(FileObject->Flags &
- FO_ALERTABLE_IO),
+ FO_ALERTABLE_IO) != 0,
NULL);
if ((Status == STATUS_ALERTED) || (Status == STATUS_USER_APC))
{
Status = KeWaitForSingleObject(&FileObject->Event,
Executive,
KernelMode,
- FileObject->Flags & FO_ALERTABLE_IO,
+ (FileObject->Flags &
+ FO_ALERTABLE_IO) != 0,
NULL);
if (Status == STATUS_ALERTED)
{
}
/* Return the Length and Status. ReturnedLength is NOT optional */
- *ReturnedLength = IoStatusBlock.Information;
+ *ReturnedLength = (ULONG)IoStatusBlock.Information;
return Status;
}
Status = KeWaitForSingleObject(&FileObject->Event,
Executive,
KernelMode,
- FileObject->Flags & FO_ALERTABLE_IO,
+ (FileObject->Flags &
+ FO_ALERTABLE_IO) != 0,
NULL);
if (Status == STATUS_ALERTED)
{
{
/* Allocating failed, clean up and return the exception code */
IopCleanupAfterException(FileObject, Irp, Event, NULL);
- if (LocalLength) ExFreePool(LocalLength);
+ if (LocalLength) ExFreePoolWithTag(LocalLength, TAG_LOCK);
/* Return the exception code */
_SEH2_YIELD(return _SEH2_GetExceptionCode());
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
/* Free buffer and return the exception code */
- if (AuxBuffer) ExFreePool(AuxBuffer);
+ if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
_SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
if (!NT_SUCCESS(Status))
{
/* Fail */
- if (AuxBuffer) ExFreePool(AuxBuffer);
+ if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
return Status;
}
{
/* Allocating failed, clean up and return the exception code */
IopCleanupAfterException(FileObject, Irp, Event, NULL);
- if (AuxBuffer) ExFreePool(AuxBuffer);
+ if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
/* Return the exception code */
_SEH2_YIELD(return _SEH2_GetExceptionCode());
_SEH2_END;
/* Free the event */
- ExFreePool(Event);
+ ExFreePoolWithTag(Event, TAG_IO);
}
else
{
Status = KeWaitForSingleObject(&FileObject->Event,
Executive,
PreviousMode,
- FileObject->Flags & FO_ALERTABLE_IO,
+ (FileObject->Flags &
+ FO_ALERTABLE_IO) != 0,
NULL);
if ((Status == STATUS_USER_APC) || (Status == STATUS_ALERTED))
{
* Someone else set the completion port in the
* meanwhile, so dereference the port and fail.
*/
- ExFreePool(Context);
+ ExFreePoolWithTag(Context, IOC_TAG);
ObDereferenceObject(Queue);
Status = STATUS_INVALID_PARAMETER;
}
_SEH2_END;
/* Free the event */
- ExFreePool(Event);
+ ExFreePoolWithTag(Event, TAG_IO);
}
else
{
Status = KeWaitForSingleObject(&FileObject->Event,
Executive,
PreviousMode,
- FileObject->Flags & FO_ALERTABLE_IO,
+ (FileObject->Flags &
+ FO_ALERTABLE_IO) != 0,
NULL);
if ((Status == STATUS_USER_APC) || (Status == STATUS_ALERTED))
{
{
/* Clear it in the IRP for completion */
Irp->UserEvent = NULL;
- ExFreePool(Event);
+ ExFreePoolWithTag(Event, TAG_IO);
}
/* Set the caller IOSB */
/* Allocate a buffer */
LocalLength = ExAllocatePoolWithTag(NonPagedPool,
sizeof(LARGE_INTEGER),
- TAG_LOCK);
+ TAG_LOCK);
/* Set the length */
*LocalLength = CapturedLength;
{
/* Allocating failed, clean up and return the exception code */
IopCleanupAfterException(FileObject, Irp, NULL, Event);
- if (LocalLength) ExFreePool(LocalLength);
+ if (LocalLength) ExFreePoolWithTag(LocalLength, TAG_LOCK);
/* Return the exception code */
_SEH2_YIELD(return _SEH2_GetExceptionCode());