阅读:1717回复:1
用tdi发包,速度超级慢,帮忙看看怎么解决
我用tdi发包,发一个包要0.2秒,
从服务器上接收一个大的多的包,只要0.01秒 我看主要时间都是在waitforsingleobject了 |
|
|
沙发#
发布于:2009-12-04 22:56
DeviceObject = IoGetRelatedDeviceObject(FileObject);
Irp = TdiBuildInternalDeviceControlIrp(TDI_SEND, DeviceObject, FileObject, Event, IoStatus); if (Irp == 0) return STATUS_INSUFFICIENT_RESOURCES; Mdl = IoAllocateMdl(Data, Length, FALSE, FALSE, Irp); if (Mdl == 0) return STATUS_INSUFFICIENT_RESOURCES; MmProbeAndLockPages(Mdl, KernelMode, IoModifyAccess); Mdl->Next = NULL; TdiBuildSend(Irp, DeviceObject, FileObject, 0, 0, Mdl, 0, Length); Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) Status = KeWaitForSingleObject(Event, UserRequest, KernelMode, FALSE, 0); |
|
|