技术的乐趣在于分享,欢迎多多交流,多多沟通。
全部博文(877)
分类: Windows平台
2015-05-15 18:52:10
NTSTATUS WdfRequestCreate(IN OPTIONAL PWDF_OBJECT_ATTRIBUTES RequestAttributes, IN OPTIONAL WDFIOTARGET IoTarget, OUT WDFREQUEST* Request);参数RequestAttribtues用来配置将被创建的框架对象,这个类型的参数并不是仅针对于WDFREQUEST对象,所有继承自WDFOBJECT的框架对象都使用WDF_OBJECT_ATTRIBUTES结构体进行对象配置。
WdfIoTargetFormatRequestForIoctl WdfIoTargetFormatRequestForInternalIoctl WdfIoTargetFormatRequestForInternalIoctlothers WdfIoTargetFormatRequestForRead WdfIoTargetFormatRequestForWrite第一个函数将WDFREQUEST对象格式化为IRP_MJ_DEVICE_CONTROL命令;第二第三个函数将WDFREQUEST对象格式化为IRP_MJ_INTERNAL_DEVICE_CONTROL命令,这两个函数使用了不同的参数;第四个函数将WDFREQUEST对象格式化为IRP_MJ_READ命令;第五个函数将WDFREQUEST对象格式化为IRP_MJ_WRITE命令。
NTSTATUS WdfIoTargetFormatRequestForRead(IN WDFIOTARGET IoTarget, IN OUT WDFREQUEST Request, IN OPTIONAL WDFMEMORY OutputBuffer, IN OPTIONAL PWDFMEMORY_OFFSET OutputBufferOffset, IN OPTIONAL PLONGLONG DeviceOffset);
NTSTATUS WdfRequestCreateFromIrp(IN OPTIONAL PWDF_OBJECT_ATTRIBUTES RequestAttributes, IN PIRP Irp, IN BOOLEAN RequestFreesIrp, OUT WDFREQUEST* Request);!!参数RequestFreesIrp为TRUE时,则WDFREQUEST对象被删除时,将负责调用IoFreeIrp释放irp,否则用户必须手动释放他
BOOLEAN WdfRequestSend(IN WDFREQUEST Request, IN WDFIOTARGET Target, IN OPTIONAL PWDF_REQUEST_SEND_OPTIONS RequestOptions);重点是RequestOptions
typedef struct _WDF_REQUEST_SEND_OPTIONS{ IN ULONG Size; IN ULONG Flags; IN LONGLONG Timeout; }WDF_REQUEST_SEND_OPTIONS,*PWDF_REQUEST_SEND_OPTIONS;Flags是标志值,其实重要的两个是: