Dump the callstack when you are presented the TUR. It might give you a clue as to which component (user or kernel) is sending it
d
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Charansing Rajput
Sent: Tuesday, September 16, 2008 11:15 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Why so many SCSIOP_TEST_UNIT_READY
I Dont know the reason why TEST_UNIT_READY is getting called so many times.
About disk capacity:
The code looks just fine.
You dont see disk capacity in my computer is because maybe you have set your device as Removable Media in SCSIOP_INQUIRY (InquiryData.RemovableMedia = 1). Set it to 0.
(Just a trivial thing - You might have overlooked explorer view which doesn't show disk usages. Set it to Details)
In property page you can see the disk capacity correct but not the disk usage. Because Disk capacity is reported correctly by your driver, hence you can see correct disk capacity. And disk usage has nothing to do with disk capacity. This is file systems job to report disk usage. May be the format is going wrong somewhere, of course because of some corner case in SCSIOP_READ or SCSIOP_WRITE.
Check that first.
--
Thanks and Regards,
Charansing D Deore
Sr. Software Developer,
CalSoft Pvt Ltd.
Baner Road, Pune-411045
Office: +91 20 39853000 Ext: 3055
Cell: +91 9850960550
On Wed, Sep 17, 2008 at 8:21 AM, Wayne Gong > wrote:
Hi folks,
I am designing a virtual SCSI miniport driver. When this driver services a block device. START_IO routine will receive a lot of SCSIOP_TEST_UNIT_READY and SCSI_READ command. I know that file system will read some data block to get some info. But why my miniport driver receive so many SCSIOP_TEST_UNIT_READY command. When such driver services a boot disk, it receives about more than 130 SCSIOP_TEST_UNIT_READY commands, even after can read and write data from/to disk which miniport driver serviced. In my driver, for SCSIOP_TEST_UNIT_READY command , I just return success with Srb->SrbStatus = SRB_STATUS_SUCCESS and Srb->ScsiStatus = 0. Is that correct?
Another issue is about disk capacity. In 'My computer', I cannot see disk capacity and disk usage which my miniport driver serviced. But I can get them from 'disk property'. Disk capacity is OK but usage is not correctly. Why?
Here is the code of READ_CAPACITY
PVOID buffer = Srb->DataBuffer;
ULONG BytePerBlock = disk->sectorSize;// disk sector size
ULONG LogicalBlockAddress = disk->sectors -1; // disk capacity
REVERSE_BYTES(&(((PREAD_CAPACITY_DATA)buffer)->BytesPerBlock), &BytePerBlock);
REVERSE_BYTES(&(((PREAD_CAPACITY_DATA)buffer)->LogicalBlockAddress), &LogicalBlockAddress);
Best regards -- Wayne
---
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit: OSR Seminars – OSR
To unsubscribe, visit the List Server section of OSR Online at ListServer/Forum
--- NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: OSR Seminars – OSR To unsubscribe, visit the List Server section of OSR Online at ListServer/Forum