ExAcquireResourceExclusiveLite?

Hi, every body

I need access the HDD in Exclusive Mode.

How can I use ExAcquireResourceExclusiveLite for do that?

BOOLEAN
ExAcquireResourceExclusiveLite(
IN PERESOURCE Resource,
IN BOOLEAN Wait
);

How I link the first parameter (Resource) with c:, d: or HDD1, HDD2,
etc.?
If isn?t posible send me please some suggestions.

Best Regards.

Rene.


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

When you open the device, you need to indicate exclusive access.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ren? Gonz?lez
Rodriguez
Sent: Monday, January 07, 2002 12:19 PM
To: File Systems Developers
Subject: [ntfsd] ExAcquireResourceExclusiveLite?

Hi, every body

I need access the HDD in Exclusive Mode.

How can I use ExAcquireResourceExclusiveLite for do that?

BOOLEAN
ExAcquireResourceExclusiveLite(
IN PERESOURCE Resource,
IN BOOLEAN Wait
);

How I link the first parameter (Resource) with c:, d: or HDD1, HDD2,
etc.? If isn?t posible send me please some suggestions.

Best Regards.

Rene.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi, Jamey.

Thanks, but How?

I need something like that
ExAcquireResourceExclusiveLite(“\\.\c:”, TRUE)
or ExAcquireResourceExclusiveLite(“\\.\PHYSICALDRIVEx”, TRUE)

-----Mensaje original-----
De: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Enviado el: lunes, 07 de enero de 2002 21:28
Para: File Systems Developers
Asunto: [ntfsd] RE: ExAcquireResourceExclusiveLite?

When you open the device, you need to indicate exclusive access.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ren? Gonz?lez
Rodriguez
Sent: Monday, January 07, 2002 12:19 PM
To: File Systems Developers
Subject: [ntfsd] ExAcquireResourceExclusiveLite?

Hi, every body

I need access the HDD in Exclusive Mode.

How can I use ExAcquireResourceExclusiveLite for do that?

BOOLEAN
ExAcquireResourceExclusiveLite(
IN PERESOURCE Resource,
IN BOOLEAN Wait
);

How I link the first parameter (Resource) with c:, d: or HDD1, HDD2,
etc.? If isn?t posible send me please some suggestions.

Best Regards.

Rene.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@fie.uclv.edu.cu
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

IoGetDeviceObjectPointer() or any other function that opens the device
and allows you to pass in access parameters.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Moises Herrera
Vazquez
Sent: Monday, January 07, 2002 1:02 PM
To: File Systems Developers
Subject: [ntfsd] RE: ExAcquireResourceExclusiveLite?

Hi, Jamey.

Thanks, but How?

I need something like that
ExAcquireResourceExclusiveLite(“\\.\c:”, TRUE)
or ExAcquireResourceExclusiveLite(“\\.\PHYSICALDRIVEx”, TRUE)

-----Mensaje original-----
De: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Enviado el: lunes, 07 de enero de 2002 21:28
Para: File Systems Developers
Asunto: [ntfsd] RE: ExAcquireResourceExclusiveLite?

When you open the device, you need to indicate exclusive access.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ren? Gonz?lez
Rodriguez
Sent: Monday, January 07, 2002 12:19 PM
To: File Systems Developers
Subject: [ntfsd] ExAcquireResourceExclusiveLite?

Hi, every body

I need access the HDD in Exclusive Mode.

How can I use ExAcquireResourceExclusiveLite for do that?

BOOLEAN
ExAcquireResourceExclusiveLite(
IN PERESOURCE Resource,
IN BOOLEAN Wait
);

How I link the first parameter (Resource) with c:, d: or HDD1, HDD2,
etc.? If isn?t posible send me please some suggestions.

Best Regards.

Rene.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@fie.uclv.edu.cu To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Getting exclusive access to the volume has nothing to do with this function. The ERESOURCE package just implements a fancy shared/exclusive mutex.

You have to be a little bit more explicit about what kind of exclusive access you want - the only exclusive access the system provides for is one where you either

* ask for it and get it if no one else is using it
* ASK FOR IT and destroy everyone else’s access to it

The first is just through the usual sharing modes on CreateFile. The latter is through FSCTL_DISMOUNT_VOLUME on a handle, which you can then use for read/write/ioctl until you close it, at which point the volume is accessible again to others. FSCTL_DISMOUNT_VOLUME destroys all other outstanding handles to the volume and does not allow new opens until the handle the DISMOUNT was issued through closes - it isn’t polite about anything.


This posting is provided “AS IS” with no warranties, and confers no
rights. You assume all risk for your use.

-----Original Message-----
From: Ren? Gonz?lez Rodriguez [mailto:xxxxx@fie.uclv.edu.cu]
Sent: Monday, January 07, 2002 12:19 PM
To: File Systems Developers
Subject: [ntfsd] ExAcquireResourceExclusiveLite?

Hi, every body

I need access the HDD in Exclusive Mode.

How can I use ExAcquireResourceExclusiveLite for do that?

BOOLEAN
ExAcquireResourceExclusiveLite(
IN PERESOURCE Resource,
IN BOOLEAN Wait
);

How I link the first parameter (Resource) with c:, d: or HDD1, HDD2,
etc.?
If isn?t posible send me please some suggestions.

Best Regards.

Rene.


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

What do you mean by “exclusive access”?
Maybe locking a volume by FSCTL (like CHKDSK does) is for you?

Max

----- Original Message -----
From: “René González Rodriguez”
To: “File Systems Developers”
Sent: Monday, January 07, 2002 11:19 PM
Subject: [ntfsd] ExAcquireResourceExclusiveLite?

Hi, every body

I need access the HDD in Exclusive Mode.

How can I use ExAcquireResourceExclusiveLite for do that?

BOOLEAN
ExAcquireResourceExclusiveLite(
IN PERESOURCE Resource,
IN BOOLEAN Wait
);

How I link the first parameter (Resource) with c:, d: or HDD1, HDD2,
etc.?
If isn´t posible send me please some suggestions.

Best Regards.

Rene.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

“exclusive access”?

I need read the HDD registers, and some data like SerialNumber,
FirmwareRevision, Model, etc.
But… some soft like Defrag, scandisk… lock the HDD, and my program
generate some errors, because the HDD is busy for long time.

The “Dr. Hardware” soft read that information, without error inclusive
with Defrag and scandisk running. With IDA I see Dr. HW use
ExAcquireResourceExclusiveLite, but I don’t know how can I use it to
lock the HDD or if really this function is used to do that.

Thanks
Moises.

-----Mensaje original-----
De: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Enviado el: martes, 08 de enero de 2002 13:57
Para: File Systems Developers
Asunto: [ntfsd] Re: ExAcquireResourceExclusiveLite?

What do you mean by “exclusive access”?
Maybe locking a volume by FSCTL (like CHKDSK does) is for you?

Max

----- Original Message -----
From: “Ren? Gonz?lez Rodriguez”
To: “File Systems Developers”
Sent: Monday, January 07, 2002 11:19 PM
Subject: [ntfsd] ExAcquireResourceExclusiveLite?

Hi, every body

I need access the HDD in Exclusive Mode.

How can I use ExAcquireResourceExclusiveLite for do that?

BOOLEAN
ExAcquireResourceExclusiveLite(
IN PERESOURCE Resource,
IN BOOLEAN Wait
);

How I link the first parameter (Resource) with c:, d: or HDD1, HDD2,
etc.?
If isn?t posible send me please some suggestions.

Best Regards.

Rene.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@fie.uclv.edu.cu
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

>with Defrag and scandisk running. With IDA I see Dr. HW use

ExAcquireResourceExclusiveLite

As Daniel Lovinger said, ERESOURCE has nothing to do with disks - this is just a kind of mutex used usually by the filesystems.

There is no notion of “locking the hard disk” in NT. Only “locking the filesystem volume”.
Defrag does not do even the latter :slight_smile: The disk driver even does not know that defrag is running over it.

You cannot read IDE ports directly - this can spoil the life for IDE driver and cause the whole machine to hang. So, looks like the
IDE port IOCTLs are the only way for you. IDE driver will do the synchronization internally.

Serial number and firmware revision is accessed by IOCTL_SCSI_GET_INQUIRY_DATA.

Max


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thanks Max…, but…

I don’t know how get the Serial Number information with IOCTL_SCSI_GET_INQUIRY_DATA , I just get FirmwareRevision and ModelNumber.

What is your suggestion to do that at W9x?.

Regards

Moises.

-----Mensaje original-----
De: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Enviado el: viernes, 11 de enero de 2002 10:46
Para: File Systems Developers
Asunto: [ntfsd] Re: ExAcquireResourceExclusiveLite?

with Defrag and scandisk running. With IDA I see Dr. HW use
ExAcquireResourceExclusiveLite

As Daniel Lovinger said, ERESOURCE has nothing to do with disks - this is just a kind of mutex used usually by the filesystems.

There is no notion of “locking the hard disk” in NT. Only “locking the filesystem volume”.
Defrag does not do even the latter :slight_smile: The disk driver even does not know that defrag is running over it.

You cannot read IDE ports directly - this can spoil the life for IDE driver and cause the whole machine to hang. So, looks like the
IDE port IOCTLs are the only way for you. IDE driver will do the synchronization internally.

Serial number and firmware revision is accessed by IOCTL_SCSI_GET_INQUIRY_DATA.

Max


You are currently subscribed to ntfsd as: xxxxx@fie.uclv.edu.cu
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

>I don’t know how get the Serial Number information with

IOCTL_SCSI_GET_INQUIRY_DATA , I just get FirmwareRevision and ModelNumber.

Try SMART IOCTLs. They can provide you with whole IDE IDENTIFY information, IIRC.

suggestion to do that at W9x?.

Dunno, I never wrote VXDs.

Max


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com