阅读:1327回复:0
这个例程序大概讲了什么功能?NTSTATUS DispatchReadWrite ( IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp ) { #if DBG>=1 DbgPrint(\"THREADDMA: Read/Write Operation requested (DispatchWrite)\\n\"); #endif PIO_STACK_LOCATION pIrpStack = IoGetCurrentIrpStackLocation( pIrp ); PDEVICE_EXTENSION pDE = (PDEVICE_EXTENSION) pDevObj->DeviceExtension; // Check for zero-length transfers if ( pIrpStack->Parameters.Read.Length == 0 ) { pIrp->IoStatus.Status = STATUS_SUCCESS; pIrp->IoStatus.Information = 0; IoCompleteRequest( pIrp, IO_NO_INCREMENT ); return STATUS_SUCCESS; } // Start device operation IoMarkIrpPending( pIrp ); // Add the IRP to the thread\'s work queue ExInterlockedInsertTailList ( &pDE->IrpQueueListHead, &pIrp->Tail.Overlay.ListEntry, &pDE->lkIrpQueue ); KeReleaseSemaphore( &pDE->semIrpQueue, 0, // No priority boost 1, // Increment semaphore by 1 FALSE ); // No WaitForXxx after this call return STATUS_PENDING; } |
|