> Thanks for your reminder!
Yes, I set following capabilities in the minipor driver:
MaximumTransferLength = 0x40000; //256KB
AlignmentMask = 0x3; // DWORD aligned
I don’t think the “MaximumTransferLength” make this error happen:
- this code works well at some time before, the code never change;
- This maximum transfer length tells the upper layer to spit the lager
IO;
And following is a snippet of the code:
SRB_IO_CONTROL *pSic = &srbIoctlHdr;
You have not indicated where srbIoctlHdr is allocated. It cannot be
static or global, so it must be on the stack, and if it is on the stack,
is it guaranteed to exist during the entire processing of the SRB? If
not, then by the time the SRB is examined, it can be complete garbage.
For that matter, why do you feel compelled to create a pointer variable,
if stack allocation is safe? You could easily have done this by simply
writing
srbIoctlHdr.HeaderLength = sizeof(SRB_IO_CONTROL);
srbIoctlHdr.Length = dataLen - sizeof(SRB_IO_CONTROL);
etc. and you don’t need to introduce a pointless pointer (pun intended)
whose sole purpose seems to be to allow you to write -> instead of ., at
least that’s the only reason I can see that it makes sense. Is, perhaps,
the “.” key on your keyboard broken?
dataLen = 0x80000;
pSic->HeaderLength = sizeof(SRB_IO_CONTROL);
pSic->Length = dataLen - sizeof(SRB_IO_CONTROL); //512KB
pSic->Timeout = 10000;
pSic->ControlCode = IOCTL_XXXXXXXX;
rc = DeviceIoControl(fdIoa,
IOCTL_SCSI_MINIPORT, // operation to
perform
pSic, dataLen, // input buffer
pSic, dataLen, // output buffer
(LPDWORD)&bytesReturned, // # bytes returned
(LPOVERLAPPED) NULL); // synchronous I/O
The return code is 1450(*ERROR_NO_SYSTEM_RESOURCES*).
And when this error occurred, the miniport driver didn’t get the IOCTL. So
maybe the Storport failed the request before sending it the miniport
driver.
On Thu, Oct 17, 2013 at 12:58 PM, wrote:
>
>> IOCTL_SCSI_GET_CAPABILITIES ?
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>>
>> OSR is HIRING!! See http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
>
>
> –
>
> Best regards,
> David Zeng
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer