Re: Modify the return value of IOCTL in disk.sys

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



First, you won't, or typically you shouldn't, be dealing with
ReadFile\WriteFile. Though those two can munge their way, incrementally,
through a harddrive, it is by far easier to use raw READS and WRITES and
increment the LBA that is used for the associated TFR or CDB. That means you
will be using either ATA or SCSI passthrough, which means you have acquired
a handle to the physical drive. To acquire the handle to the physical drive
your application MUST be elevated to Admin, but then that restriction also
applies to XP. Be aware, you will not do this on anything less than XP SP2,
Server 2003, or Vista, since Microsoft bork'd ATA pass through in XP and XP
SP1. You will be writing to every LBA of the drive, zero to MaxLBA. If your
requirement is that this functionality MUST work from non-admin users, then
you simply write a service and provide an application interface that permits
a non-admin user to tell the service to open a handle to a disk and then
munge it's way through every LBA.

You do NOT need a filter driver You do NOT need to modify disk.sys. Disk.sys
is fragile enough without the inexperienced tramping though it.

You need to look at IOCTL_SCSI_PASS_THROUGH and IOCTL_ATA_PASS_THROUGH, and
understand what an LBA is, and how it is used in a TFR (which you have to
know) and CDB (something else you have to know). Before it is over you
should be intimate with the SetupDiXxxx API.

--
The personal opinion of
Gary G. Little

"Nidhi Malik" <nidhi.malik@xxxxxxxxxxxxxxx> wrote in message
news:ueF3VlM1HHA.3916@xxxxxxxxxxxxxxxxxxxxxxx
Hi ,
Thanks for the reply
But i want to write driectly on disk for my disk wiping utility in
vc+++.WriteFile() function fails to write on sectors. Software is properly
working on all
other windows operating system accep vista. That is the reasion i want
to write i driver for vista compatibality. Same as EldoS Corporation
Driver (RawDisk) enables access to disk sectors in Windows XP/Vista. Did
you know any other way that can help me to solve my problem.

Wating for reply
Nidhi Malik




"Maxim S. Shatskih" <maxim@xxxxxxxxxxxxxxxx> wrote in message
news:OGD5cfB1HHA.484@xxxxxxxxxxxxxxxxxxxxxxx
This will not give you anything, Vista will fail the writes anyway :-)

IOCTL_DISK_IS_WRITABLE is only for FSD use, for FSD to know whether to
mount itself read-only or writable.

Vista fails the writes only to physical disk LUN device
(\\.\PhysicalDisk%d), and only if the range touched by the write is
covered by
a defined partition.

Writes to volumes (\\.\D: or such) are fine in Vista, provided you are
"administrator enough" for this.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com

"Nidhi Malik" <nidhi.malik@xxxxxxxxxxxxxxx> wrote in message
news:OQ5aCOA1HHA.4880@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I want my application to directly write on the disk in vista ( vista
does
not alow it) . I am going to write a disk filter driver that modifies
the
return value for the IOCTL for the disk . Looking at the source code of
disk.sys, i guess the modifcation should be in IOCTL_DISK_IS_WRITABLE
case.
-----------------------------------------------------------------------------
------
case IOCTL_DISK_IS_WRITABLE: {


status = STATUS_MEDIA_WRITE_PROTECTED;

break;
}

to

case IOCTL_DISK_IS_WRITABLE: {


status = STATUS_SUCESS;

break;
}
-----------------------------------------------------------------------------
-
So i want to force disk.sys ( IOCTL_DISK_IS_WRITABLE ) to return
STATUS_SUCESS every time my application want to write on disk using
filter
driver.
So, i need help to know that i am going in right direction or not . If i
am
in right direction how can i do this modification.

Thanks a lot






.



Relevant Pages

  • Re: New tower wit vista 64 bit
    ... Some printers have XP drivers but no Vista drivers at all, some may have only a 32 bit driver and Vista 64 wants "Signed" drivers as a security measure. ... you can try opening up My Computer and right click on the disk drive Icon. ... I also find that on both XP and Vista the AVG anti virus program has caused real slow behavior. ...
    (microsoft.public.windows.vista.performance_maintenance)
  • Re: New tower wit vista 64 bit
    ... bhk wrote: ... Some printers have XP drivers but no Vista drivers at all, some may have only a 32 bit driver and Vista 64 wants "Signed" drivers as a security measure. ... you can try opening up My Computer and right click on the disk drive Icon. ...
    (microsoft.public.windows.vista.performance_maintenance)
  • Re: Max. HD size Ultra5
    ... used with the old PIO modes). ... You can use 300GB disk in PIO mode if You want, ... LBA in DMA mode, only 28 bits LBA (they can do 48 bits LBA but only ... The IDE *driver* on SPARC only does 28 bit LBA; ...
    (comp.sys.sun.hardware)
  • Re: Operating system.....why can`t I revert to XP from Vista...Bios Lock?
    ... You need the sata driver for a floppy off dells website! ... Once delpart removed the Vista ... have tried two Dells a E520 and a XPS 410.Both have Vista Home ... Center(Dell disk) and a regular XP Pro disk. ...
    (alt.sys.pc-clone.dell)
  • Re: Driver to work around WriteFile access denied issue in Vista
    ... Vista some parts of the disk are accessible in the SYSTEM account but not ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... R> this fails under Vista with an access denied message. ...
    (microsoft.public.development.device.drivers)