Weird Windows XP storage drivers behavior, continued

I continued analysis of Windows XP’s behavior on read commands, under administrator account, changing the handling opening method to the device.

 

Doing a CreateFile with parameters "\\\\.\\CdRom0", GENERIC_READ, FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL, ("\\GLOBAL??\\CdRom0" did not work although osr object viewer lists it as symbolic link for \Device\CdRom0), I can use ReadFile to read sectors from the cd/dvd-rom device (1.46 Gb DVD-RW inserted) and SetFilePointer to change the file pointer. IOCTL_DISK_GET_DRIVE_GEOMETRY give a size of 0xAE000 – this is matching the rounded down to 0x800 mutiple approximation of Read Capacity response 0xAE42F. The filesystem mounted reports 0xAE300 blocks available within the volume (loosing 0x12F blocks for file system metadata and reserved blocks seems a reasonnable value).

A set file pointer to 0xAE000 * 0x800 works, and ReadFile there returns data for this block, the previous block and the next block, read commands are transmitted to the drive.

A set file pointer to 0xAE300 * 0x800 works, and ReadFile there returns data for this block, the previous block and the next block, read commands are transmitted to the drive.

A set file pointer to 0xAE420 * 0x800 works, but ReadFile there returns no data (incorrectly success return value 0), read command is not transmitted to the drive. This seems bogus, this should be a valid read.

A set file pointer to 0xAE42F * 0x800 works, but ReadFile there returns no data (incorrectly success return value 0), read command is not transmitted to the drive. This seems bogus, this should be a valid read.

A set file pointer to 0x7FFFE000 works, but ReadFile there returns no data (incorrectly success return value 0), read command is not transmitted to the drive.

 

BusTRACE shows classpnp.sys as driver talking to the device. I was explained that this is only a ‘best guess’, but still another driver might be the intiator, classpnp.sys getting involved for some other reason.

Advertisements
This entry was posted in Ordinateurs et Internet. Bookmark the permalink.

2 Responses to Weird Windows XP storage drivers behavior, continued

  1. Unknown says:

    Good call.
    I get a similar problem when I try to access a multi-session CD – I can access all the data in the first session, but I can\’t access any data past that.
    I do a SetFilePosition to the beginning of the second session, which returns ERROR_SUCCESS, and a ReadFile of 0x800 bytes which returns ERROR_SUCCESS, but the nNumberOfBytesRead value has the value zero in it.
    What do I have to do to the file handle to tell Windows "let me past the first session"?
    I tried FSCTL_ALLOW_EXTENDED_DASD_IO and FSCTL_EXTEND_VOLUME, not expecting either to work, and sure enough they didn\’t. I\’m running out of hair to pull out!

  2. David says:

    You can try two approaches.
     
    First, the end user way: looks for multi-session system tools, such as Nero\’s multimounter. This used to be a freely downloadable tool, although their support behavior may have changed recently. More info at http://ww2.nero.com/nero6/us/Multimounter_for_Win9.x_2K_XP.html This will provide you access to the data directly in Windows Explorer.
     
    Second, you can join OSR\’s ntfsd alias and expose your issue to the Windows NT file system driver community. Microsoft\’s file system team actively participates to this alias. See http://www.osronline.com/page.cfm?name=ListServer for more information. This should help you for programming your own application or driver access to the other sessions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s