{
KeCancelTimer( &Poll->Timer );
RemoveEntryList( &Poll->ListEntry );
- ExFreePool( Poll );
+ ExFreePoolWithTag(Poll, TAG_AFD_ACTIVE_POLL);
}
Irp->IoStatus.Status = Status;
PAFD_ACTIVE_POLL Poll = NULL;
- Poll = ExAllocatePool( NonPagedPool, sizeof(AFD_ACTIVE_POLL) );
+ Poll = ExAllocatePoolWithTag(NonPagedPool,
+ sizeof(AFD_ACTIVE_POLL),
+ TAG_AFD_ACTIVE_POLL);
if (Poll){
Poll->Irp = Irp;
return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 );
}
- Status = ObReferenceObjectByHandle(EnumReq->Event,
- EVENT_ALL_ACCESS,
- *ExEventObjectType,
- UserMode,
- (PVOID *)&UserEvent,
- NULL);
- if (!NT_SUCCESS(Status))
+ /* An event may optionally be provided for us to clear */
+ if (EnumReq->Event != NULL)
{
- AFD_DbgPrint(MIN_TRACE,("Unable to reference event %x\n", Status));
- return UnlockAndMaybeComplete(FCB, Status, Irp, 0);
- }
+ Status = ObReferenceObjectByHandle(EnumReq->Event,
+ EVENT_ALL_ACCESS,
+ *ExEventObjectType,
+ UserMode,
+ (PVOID *)&UserEvent,
+ NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ AFD_DbgPrint(MIN_TRACE,("Unable to reference event %x\n", Status));
+ return UnlockAndMaybeComplete(FCB, Status, Irp, 0);
+ }
- /* Clear the event */
- KeClearEvent(UserEvent);
- ObDereferenceObject(UserEvent);
+ /* Clear the event */
+ KeClearEvent(UserEvent);
+ ObDereferenceObject(UserEvent);
+ }
/* Copy the poll state, masking out disabled events */
EnumReq->PollEvents = (FCB->PollState & ~FCB->EventSelectDisabled);