EvtDmaTransactionConfigureDmaChannel
EvtDmaTransactionDmaTransferComplete
EvtReserveDma
WDF_DMA_ENABLER_CONFIG_FLAGS
WDF_DMA_SYSTEM_PROFILE_CONFIG
WDF_DMA_SYSTEM_PROFILE_CONFIG_INIT
WdfDmaEnablerConfigureSystemProfile method
WdfDmaTransactionAllocateResources method
WdfDmaTransactionCancel method
WdfDmaTransactionFreeResources method
WdfDmaTransactionGetTransferInfo method
WdfDmaTransactionInitializeUsingOffset method
WdfDmaTransactionSetChannelConfigurationCallback method
WdfDmaTransactionSetDeviceAddressOffset method
WdfDmaTransactionSetImmediateExecution method
WdfDmaTransactionSetTransferCompleteCallback method
WdfDmaTransactionStopSystemTransfer method
WdfDmaTransactionWdmGetTransferContext method
展开 最小化

WdfDmaTransactionInitializeUsingRequest 方法

The WdfDmaTransactionInitializeUsingRequest method initializes a specified DMA transaction by using the parameters of a specified I/O request.

语法

NTSTATUS WdfDmaTransactionInitializeUsingRequest(
  [in]  WDFDMATRANSACTION DmaTransaction,
  [in]  WDFREQUEST Request,
  [in]  PFN_WDF_PROGRAM_DMA EvtProgramDmaFunction,
  [in]  WDF_DMA_DIRECTION DmaDirection
);

参数

DmaTransaction [in]

A handle to a DMA transaction object that the driver obtained from a previous call to WdfDmaTransactionCreate.

Request [in]

A handle to a framework request object.

EvtProgramDmaFunction [in]

A pointer to the driver's EvtProgramDma event callback function.

DmaDirection [in]

A WDF_DMA_DIRECTION-typed value that specifies the direction of the DMA transfer.

返回值

WdfDmaTransactionInitializeUsingRequest returns STATUS_SUCCESS if the operation succeeds. Otherwise, the method returns one of the following values:

返回代码说明
STATUS_INVALID_PARAMETER

An invalid parameter was detected.

STATUS_INVALID_DEVICE_REQUEST

The request object that the Request parameter specified contained an invalid memory descriptor list (MDL), or the DmaDirection parameter specifies a direction that is invalid for type of request that the request object contains.

STATUS_WDF_TOO_FRAGMENTED

The number of scatter/gather elements that were needed to handle the transaction was greater than the value that the driver's call to WdfDmaEnablerSetMaximumScatterGatherElements specified. For more information, see the following Remarks section.

 

This method also might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

评论

The WdfDmaTransactionInitializeUsingRequest method prepares a DMA operation for execution, by performing initialization operations such as setting up a transaction's scatter/gather list. After your driver calls WdfDmaTransactionInitializeUsingRequest, the driver must call WdfDmaTransactionExecute.

The driver can call WdfRequestGetParameters to obtain a request's type. The value that the driver specifies for the DmaDirection parameter must be appropriate for the request type, as follows:

  • The DmaDirection value must be WdfDmaDirectionReadFromDevice if:
    • The request type is WdfRequestTypeRead
    • The request type is WdfRequestTypeDeviceControl or WdfRequestTypeDeviceControlInternal and the I/O control code specifies a transfer type of METHOD_OUT_DIRECT
  • The DmaDirection value must be WdfDmaDirectionWriteToDevice if:

    • The request type is WdfRequestTypeWrite

    • The request type is WdfRequestTypeDeviceControl or WdfRequestTypeDeviceControlInternal and the I/O control code specifies a transfer type of METHOD_IN_DIRECT

For more information about transfer types for I/O control codes, see Defining I/O Control Codes.

Framework-based drivers typically call WdfDmaTransactionInitializeUsingRequest from within an I/O queue event callback function.

Your driver should call WdfDmaTransactionInitializeUsingRequest if you are creating a DMA transaction that is based on information that a framework request object contains. Use WdfDmaTransactionInitialize if you are creating a DMA transaction that is not based on a request object.

If the buffer that the request object describes is larger than the maximum transfer length that your driver specified when it called WdfDmaEnablerCreate or WdfDmaTransactionSetMaximumLength, the framework breaks the transaction into multiple transfers.

If the buffer that the request object describes is too fragmented (that is, it requires more scatter/gather elements than the device can handle), WdfDmaTransactionInitializeUsingRequest returns STATUS_WDF_TOO_FRAGMENTED. The driver can specify a smaller memory buffer and call WdfDmaTransactionInitializeUsingRequest again.

For more information about DMA transactions, see Creating and Initializing a DMA Transaction.

示例

For a code example that uses WdfDmaTransactionInitializeUsingRequest, see WdfDmaTransactionExecute.

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdfdmatransaction.h (包括Wdf.h)

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

<=DISPATCH_LEVEL

另请参见

EvtProgramDma
WDF_DMA_DIRECTION
WdfDmaEnablerSetMaximumScatterGatherElements
WdfDmaTransactionCreate
WdfDmaTransactionExecute
WdfDmaTransactionInitialize

 

 

社区附加资源

添加
显示:
© 2015 Microsoft