Problem in accessing the URB TransferBuffer....

Hi All,

We are writing a virtual usb bus driver. We were checking with USB2.0 VGA extender device. When we started getting the bulk requests we got a crash. We noticed that the buffer specified in TransferBuffer is a paged memory. We are running at dispatch level. So when we try to access this we are running in to problem. It is observed that this particular request is a bulk out of size 300KB. When we tested it by plugging the device locally, it is working fine even though the USB2.0 VGA extender client drivers have violated the DDK specifications.

As per DDK Buffers specified in TransferBuffer or described in TransferBufferMDL of URB, must be nonpageable. The USB bus driver processes this URB at DISPATCH_LEVEL.

How the Microsoft stack may be handling this particular case?
What can be done to access this TransferBuffer?

Thanks

xxxxx@gmail.com wrote:

We are writing a virtual usb bus driver. We were checking with USB2.0 VGA extender device. When we started getting the bulk requests we got a crash. We noticed that the buffer specified in TransferBuffer is a paged memory. We are running at dispatch level. So when we try to access this we are running in to problem. It is observed that this particular request is a bulk out of size 300KB. When we tested it by plugging the device locally, it is working fine even though the USB2.0 VGA extender client drivers have violated the DDK specifications.

As per DDK Buffers specified in TransferBuffer or described in TransferBufferMDL of URB, must be nonpageable. The USB bus driver processes this URB at DISPATCH_LEVEL.

How the Microsoft stack may be handling this particular case?
What can be done to access this TransferBuffer?

Haven’t we already had this conversation? Or was that on the newsgroups?

The standard USB driver needs physical addresses so it can do DMA. My
guess is that it does a probe-and-lock if the URB did not specify an MDL.

This VGA extender driver is broken. Have you complained to the
manufacturer? You should.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

>The standard USB driver needs physical addresses so it can do DMA. My

guess is that it does a probe-and-lock if the URB did not specify an MDL.

If the URB TransferBufferMDL is NULL then IoAllocateMdl() and then MmBuildMdlForNonPagedPool() are used to create an MDL based on the URB TransferBuffer and TransferBufferLength.

Then AdapterObject->DmaOperations->GetScatterGatherList is used to create the SG list for DMA operations.