阅读:1178回复:2
DS开发驱程问题。20分奉送!
下面是用DS2.6生成端点2的BULK写。一调用计算机就自动重起。
谁能告诉我哪错了。20分。上回有人跟我说是因为DS2.6有bug,是不是真的? NTSTATUS D12testDevice::Write(KIrp I) { t << "Entering D12testDevice::Write, " << I << EOL; // TODO: Check the incoming request. Replace "FALSE" in the following // line with a check that returns TRUE if the request is not valid. if (I.IoctlInputBufferSize()<=0) { // Invalid parameter in the Write request I.Information() = 0; return I.PnpComplete(this, STATUS_INVALID_PARAMETER); } ULONG dwTotalSize = I.IoctlInputBufferSize(); ULONG dwMaxSize = m_Endpoint2OUT.MaximumTransferSize(); if (dwTotalSize > dwMaxSize) { ASSERT(dwMaxSize); dwTotalSize = dwMaxSize; } PUCHAR pBuffer = (PUCHAR)I.IoctlBuffer(); KMemory Mem(pBuffer, dwTotalSize); Mem.SetPageArray(); // Allocate a new context structure for Irp completion USB_COMPLETION_INFO* pCompInfo = new (NonPagedPool) USB_COMPLETION_INFO; if (pCompInfo == NULL) { I.Information() = 0; return I.PnpComplete(this, STATUS_INSUFFICIENT_RESOURCES); } // TODO: Select the correct pipe to write to // Create an URB to do actual Bulk write to the pipe PURB pUrb = m_Endpoint2OUT.BuildBulkTransfer( Mem, // Where is data coming from? dwTotalSize, // How much data to read? FALSE, // direction (FALSE = OUT) NULL // Link to next URB ); if (pUrb == NULL) { delete pCompInfo; I.Information() = 0; return I.PnpComplete(this, STATUS_INSUFFICIENT_RESOURCES); } // Initialize context structure pCompInfo->m_pClass = this; pCompInfo->m_pUrb = pUrb; // Submit the URB to our USB device NTSTATUS status; status = m_Endpoint2OUT.SubmitUrb(I, pUrb, LinkTo(WriteComplete), pCompInfo, 0); return status; } |
|
沙发#
发布于:2004-11-05 08:13
http://www.driverdevelop.com/forum/html_8374.html?1099034906
//////////// 解 |
|
板凳#
发布于:2004-11-05 08:14
但我不知道你的问题是否是这个原因/
|
|