Floppy disk insertion and ejection problem

Hi All,

Let me ask You one question about W2k internals.
I really need your professional advice.

What is the best way to handle any Floppy disk
insertion and ejection under Windows 2000?

Please, help. Any ideas (kernel mode driver solution
or user mode app), or links are welcome.

Is it possible to use RegisterDeviceNotification()
function to solve my problem?

Great thanks for any help!
Yours faithfully,
Felix K

What exactly is your goal with this? That might help in getting a good
answer…

  • jb

============================================
Jonathan Borden

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Felix K
Sent: Monday, September 16, 2002 12:21 PM
To: NT Developers Interest List
Subject: [ntdev] Floppy disk insertion and ejection problem

Hi All,

Let me ask You one question about W2k internals.
I really need your professional advice.

What is the best way to handle any Floppy disk
insertion and ejection under Windows 2000?

Please, help. Any ideas (kernel mode driver solution
or user mode app), or links are welcome.

Is it possible to use RegisterDeviceNotification()
function to solve my problem?

Great thanks for any help!
Yours faithfully,
Felix K


You are currently subscribed to ntdev as: xxxxx@L5sg.com
To unsubscribe send a blank email to %%email.unsub%%

Why do you think you have a disk insertion and/or ejection problem? Here is
the way it is supposed to work:

  1. You insert a floppy diskette.
  2. You do something, e.g. Windows Explorer, and try to access the floppy.
  3. You see the file(s) or lack thereof on the floppy.
  4. You remove the floppy
  5. You try to access again or refresh and it pops up a box that says the
    drive is not ready

Why is this a problem? What are you trying to do? I have worked on floppy
based smartcard and flash memory reader/writers for SmartDisk who owns the
patents on this type of product. There the normal floppy logic, such as
after the driver sees that the media is unformatted, it will not look at the
media again until a changeline is seen. We had to create our own version(s)
of the driver that inhibited that behavior because the microprocessor in the
Smarty & FlashPath would stop generating sector data during internal
processing with the smartcard and flash memory.

As someone else said, a better explanation of what, why, and wherefore of
your question would help.

----- Original Message -----
From: “Felix K”
To: “NT Developers Interest List”
Sent: Monday, September 16, 2002 12:20 PM
Subject: [ntdev] Floppy disk insertion and ejection problem

> Hi All,
>
> Let me ask You one question about W2k internals.
> I really need your professional advice.
>
> What is the best way to handle any Floppy disk
> insertion and ejection under Windows 2000?
>
> Please, help. Any ideas (kernel mode driver solution
> or user mode app), or links are welcome.
>
> Is it possible to use RegisterDeviceNotification()
> function to solve my problem?
>
> Great thanks for any help!
> Yours faithfully,
> Felix K
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@yoshimuni.com
> To unsubscribe send a blank email to %%email.unsub%%

JB> What exactly is your goal with this? That might help in getting a good
JB> answer…

I’m writing a part of security complex which must control the
facts of useing any removable media (CDROM, Floppy discs, …).

When somebody inserts a CD disk into device I receive
WM_DEVICECHANGE message from the system, then retrieve
necessary information about this CD (Label, File system
type, …) and write it into log file. When somebody
ejects CD disk, I do the same operation.

But in situation with floppy diskette the system unfortunately
don’t send me any notifications and I can’t fix the fact of it
insertion or ejection. So, is it possible somehow to fix the facts
of floppy diskette insertion and ejection?

Please, help.

Thank You in advance, for any advice
Felix K

Someone please correct me if I’m wrong on what I’m about to say…

I don’t believe there is such a notification for the floppy drive. The
reason, as far as I am able to remember, stems from the fact that the
‘changed disk’ line on the floppy drive was not always implemented
correctly. So on a pc it’s often ignored, the only real 1way to
determine if a disk is in the drive or not was to to a read, seek or
whatever, on the actual floppy.

In addition, there is a problem in determining if a floppy disk inserted
now is different from one previously inserted. This is due to the
inconsistent manner in which floppy serial id #'s are done (many can
have 0’s).

I know this doesn’t help your situation. I’m trying to think of
possible solutions to the problem.

One solution might be (and this is a bit exccesive) to filter the
hardware access to the floppy drive. In this idea, any access to the
floppy device would be caught by your filter driver and then you can
send notification to your user-land app (using the inverted call model).
You wouldn’t be notified of an insertion or ejection. But you would be
able to be notified on initial access (you could ignore subsequent
accesses). Would this help?

I’m not a real big fan of over-engineering a problem, and this might be
a case where this *is* overengineering. I just don’t see another way
yet given the relatively poor consistency with which some signals on
floppy drives have been handled in the past.

If anyone else has a suggestion, I’m interested as well.

  • jb
    ============================================
    Jonathan Borden
    L5 Software Group, LLC
    “remember…all computers wait at the same speed.”

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Felix K
Sent: Tuesday, September 17, 2002 2:27 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Floppy disk insertion and ejection problem

JB> What exactly is your goal with this? That might help in getting a
JB> good answer…

I’m writing a part of security complex which must control the facts of
useing any removable media (CDROM, Floppy discs, …).

When somebody inserts a CD disk into device I receive WM_DEVICECHANGE
message from the system, then retrieve necessary information about this
CD (Label, File system type, …) and write it into log file. When
somebody ejects CD disk, I do the same operation.

But in situation with floppy diskette the system unfortunately don’t
send me any notifications and I can’t fix the fact of it insertion or
ejection. So, is it possible somehow to fix the facts of floppy diskette
insertion and ejection?

Please, help.

Thank You in advance, for any advice
Felix K


You are currently subscribed to ntdev as: xxxxx@L5sg.com
To unsubscribe send a blank email to %%email.unsub%%

[skip]

JB> One solution might be (and this is a bit exccesive) to filter the
JB> hardware access to the floppy drive. In this idea, any access to the
JB> floppy device would be caught by your filter driver and then you can
JB> send notification to your user-land app (using the inverted call model).
JB> You wouldn’t be notified of an insertion or ejection. But you would be
JB> able to be notified on initial access (you could ignore subsequent
JB> accesses). Would this help?

I suppose it would help to solve the problem, however there is a similar
method which is concluded in patching NtCreateFile() function. In that
case we can monitor any attempts to access the floppy device and log
neccessary info. But neither in the first case nor in the second we
can’t to handle floppy discette ejection. One more method is concluded
in checking the floppy device on descette presence in given time
intervals, but every such attempt causes noise from the device which is
not acceptable. May be there is a silent method of checking the floppy
device?

JB> If anyone else has a suggestion, I’m interested as well.

And I’m too.

Yours faithfully,
Felix K

We determined that attempting to check the floppy drive for media at 5
second intervals would cause the drive to fail within about 3 months of
normal 9 to 5 usage. It is NOT possible to check the changeline without
spinning up the motor. You don’t have to wait for the motor to reach full
speed, but the power surge occurs on the drive. Your users won’t like it if
you make them replace their floppy drives several times a year.

The changeline was generally correct for 3.5" diskettes. The 5.25" diskette
drives had many problems including that the old drives didn’t support
changeline at all. I would suggest a closer reading of the sources in the
NT4 DDK of the floppy driver. If you use the W2K or XP DDKs, you will have
to read and understand both the floppy driver and the FDC driver.

It is not really possible to do what your design requires. A floppy filter
will be able to see the media changed info and know if the floppy driver
thinks it is different media. If the media has not been mounted the floppy
driver will not indicate media changed, so this is not perfect.

----- Original Message -----
From: “Felix K”
To: “NT Developers Interest List”
Sent: Tuesday, September 17, 2002 9:32 AM
Subject: [ntdev] RE: Floppy disk insertion and ejection problem

> [skip]
>
> JB> One solution might be (and this is a bit exccesive) to filter the
> JB> hardware access to the floppy drive. In this idea, any access to the
> JB> floppy device would be caught by your filter driver and then you can
> JB> send notification to your user-land app (using the inverted call
model).
> JB> You wouldn’t be notified of an insertion or ejection. But you would
be
> JB> able to be notified on initial access (you could ignore subsequent
> JB> accesses). Would this help?
>
> I suppose it would help to solve the problem, however there is a similar
> method which is concluded in patching NtCreateFile() function. In that
> case we can monitor any attempts to access the floppy device and log
> neccessary info. But neither in the first case nor in the second we
> can’t to handle floppy discette ejection. One more method is concluded
> in checking the floppy device on descette presence in given time
> intervals, but every such attempt causes noise from the device which is
> not acceptable. May be there is a silent method of checking the floppy
> device?
>
> JB> If anyone else has a suggestion, I’m interested as well.
>
> And I’m too.
>
> Yours faithfully,
> Felix K
>
Someone please correct me if I’m wrong on what I’m about to say…

I don’t believe there is such a notification for the floppy drive. The
reason, as far as I am able to remember, stems from the fact that the
‘changed disk’ line on the floppy drive was not always implemented
correctly. So on a pc it’s often ignored, the only real 1way to
determine if a disk is in the drive or not was to a read, seek or
whatever, on the actual floppy.

In addition, there is a problem in determining if a floppy disk inserted
now is different from one previously inserted. This is due to the
inconsistent manner in which floppy serial id #'s are done (many can
have 0’s).

I know this doesn’t help your situation. I’m trying to think of
possible solutions to the problem.

One solution might be (and this is a bit excessive) to filter the
hardware access to the floppy drive. In this idea, any access to the
floppy device would be caught by your filter driver and then you can
send notification to your user-land app (using the inverted call model).
You wouldn’t be notified of an insertion or ejection. But you would be
able to be notified on initial access (you could ignore subsequent
accesses). Would this help?

I’m not a real big fan of over-engineering a problem, and this might be
a case where this is overengineering. I just don’t see another way
yet given the relatively poor consistency with which some signals on
floppy drives have been handled in the past.

If anyone else has a suggestion, I’m interested as well.

- jb
============================================
Jonathan Borden
L5 Software Group, LLC
“remember…all computers wait at the same speed.”

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Felix K
Sent: Tuesday, September 17, 2002 2:27 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Floppy disk insertion and ejection problem

JB> What exactly is your goal with this? That might help in getting a
JB> good answer…

I’m writing a part of security complex which must control the facts of
useing any removable media (CDROM, Floppy discs, …).

When somebody inserts a CD disk into device I receive WM_DEVICECHANGE
message from the system, then retrieve necessary information about this
CD (Label, File system type, …) and write it into log file. When
somebody ejects CD disk, I do the same operation.

But in situation with floppy diskette the system unfortunately don’t
send me any notifications and I can’t fix the fact of it insertion or
ejection. So, is it possible somehow to fix the facts of floppy diskette
insertion and ejection?

Please, help.

Thank You in advance, for any advice
Felix K

One possibly dumb question, with those nice little CompactFlash USB drivers
around, who needs floppies anymore ?

Alberto.

-----Original Message-----
From: David J. Craig [mailto:xxxxx@yoshimuni.com]
Sent: Tuesday, September 17, 2002 10:39 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Floppy disk insertion and ejection problem

We determined that attempting to check the floppy drive for media at 5
second intervals would cause the drive to fail within about 3 months of
normal 9 to 5 usage. It is NOT possible to check the changeline without
spinning up the motor. You don’t have to wait for the motor to reach full
speed, but the power surge occurs on the drive. Your users won’t like it if
you make them replace their floppy drives several times a year.

The changeline was generally correct for 3.5" diskettes. The 5.25" diskette
drives had many problems including that the old drives didn’t support
changeline at all. I would suggest a closer reading of the sources in the
NT4 DDK of the floppy driver. If you use the W2K or XP DDKs, you will have
to read and understand both the floppy driver and the FDC driver.

It is not really possible to do what your design requires. A floppy filter
will be able to see the media changed info and know if the floppy driver
thinks it is different media. If the media has not been mounted the floppy
driver will not indicate media changed, so this is not perfect.

----- Original Message -----
From: “Felix K”
To: “NT Developers Interest List”
Sent: Tuesday, September 17, 2002 9:32 AM
Subject: [ntdev] RE: Floppy disk insertion and ejection problem

> [skip]
>
> JB> One solution might be (and this is a bit exccesive) to filter the
> JB> hardware access to the floppy drive. In this idea, any access to the
> JB> floppy device would be caught by your filter driver and then you can
> JB> send notification to your user-land app (using the inverted call
model).
> JB> You wouldn’t be notified of an insertion or ejection. But you would
be
> JB> able to be notified on initial access (you could ignore subsequent
> JB> accesses). Would this help?
>
> I suppose it would help to solve the problem, however there is a similar
> method which is concluded in patching NtCreateFile() function. In that
> case we can monitor any attempts to access the floppy device and log
> neccessary info. But neither in the first case nor in the second we
> can’t to handle floppy discette ejection. One more method is concluded
> in checking the floppy device on descette presence in given time
> intervals, but every such attempt causes noise from the device which is
> not acceptable. May be there is a silent method of checking the floppy
> device?
>
> JB> If anyone else has a suggestion, I’m interested as well.
>
> And I’m too.
>
> Yours faithfully,
> Felix K
>
Someone please correct me if I’m wrong on what I’m about to say…

I don’t believe there is such a notification for the floppy drive. The
reason, as far as I am able to remember, stems from the fact that the
‘changed disk’ line on the floppy drive was not always implemented
correctly. So on a pc it’s often ignored, the only real 1way to
determine if a disk is in the drive or not was to a read, seek or
whatever, on the actual floppy.

In addition, there is a problem in determining if a floppy disk inserted
now is different from one previously inserted. This is due to the
inconsistent manner in which floppy serial id #'s are done (many can
have 0’s).

I know this doesn’t help your situation. I’m trying to think of
possible solutions to the problem.

One solution might be (and this is a bit excessive) to filter the
hardware access to the floppy drive. In this idea, any access to the
floppy device would be caught by your filter driver and then you can
send notification to your user-land app (using the inverted call model).
You wouldn’t be notified of an insertion or ejection. But you would be
able to be notified on initial access (you could ignore subsequent
accesses). Would this help?

I’m not a real big fan of over-engineering a problem, and this might be
a case where this is overengineering. I just don’t see another way
yet given the relatively poor consistency with which some signals on
floppy drives have been handled in the past.

If anyone else has a suggestion, I’m interested as well.

- jb
============================================
Jonathan Borden
L5 Software Group, LLC
“remember…all computers wait at the same speed.”

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Felix K
Sent: Tuesday, September 17, 2002 2:27 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Floppy disk insertion and ejection problem

JB> What exactly is your goal with this? That might help in getting a
JB> good answer…

I’m writing a part of security complex which must control the facts of
useing any removable media (CDROM, Floppy discs, …).

When somebody inserts a CD disk into device I receive WM_DEVICECHANGE
message from the system, then retrieve necessary information about this
CD (Label, File system type, …) and write it into log file. When
somebody ejects CD disk, I do the same operation.

But in situation with floppy diskette the system unfortunately don’t
send me any notifications and I can’t fix the fact of it insertion or
ejection. So, is it possible somehow to fix the facts of floppy diskette
insertion and ejection?

Please, help.

Thank You in advance, for any advice
Felix K


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to %%email.unsub%%

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

You can do this with a file system filter driver; simply monitor the
mount requests.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jonathan Borden
Sent: Tuesday, September 17, 2002 1:53 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Floppy disk insertion and ejection problem

Someone please correct me if I’m wrong on what I’m about to say…

I don’t believe there is such a notification for the floppy drive. The
reason, as far as I am able to remember, stems from the fact that the
‘changed disk’ line on the floppy drive was not always implemented
correctly. So on a pc it’s often ignored, the only real 1way to
determine if a disk is in the drive or not was to to a read, seek or
whatever, on the actual floppy.

In addition, there is a problem in determining if a floppy disk inserted
now is different from one previously inserted. This is due to the
inconsistent manner in which floppy serial id #'s are done (many can
have 0’s).

I know this doesn’t help your situation. I’m trying to think of
possible solutions to the problem.

One solution might be (and this is a bit exccesive) to filter the
hardware access to the floppy drive. In this idea, any access to the
floppy device would be caught by your filter driver and then you can
send notification to your user-land app (using the inverted call model).
You wouldn’t be notified of an insertion or ejection. But you would be
able to be notified on initial access (you could ignore subsequent
accesses). Would this help?

I’m not a real big fan of over-engineering a problem, and this might be
a case where this *is* overengineering. I just don’t see another way
yet given the relatively poor consistency with which some signals on
floppy drives have been handled in the past.

If anyone else has a suggestion, I’m interested as well.

  • jb
    ============================================
    Jonathan Borden
    L5 Software Group, LLC
    “remember…all computers wait at the same speed.”

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Felix K
Sent: Tuesday, September 17, 2002 2:27 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Floppy disk insertion and ejection problem

JB> What exactly is your goal with this? That might help in getting a
JB> good answer…

I’m writing a part of security complex which must control the facts of
useing any removable media (CDROM, Floppy discs, …).

When somebody inserts a CD disk into device I receive WM_DEVICECHANGE
message from the system, then retrieve necessary information about this
CD (Label, File system type, …) and write it into log file. When
somebody ejects CD disk, I do the same operation.

But in situation with floppy diskette the system unfortunately don’t
send me any notifications and I can’t fix the fact of it insertion or
ejection. So, is it possible somehow to fix the facts of floppy diskette
insertion and ejection?

Please, help.

Thank You in advance, for any advice
Felix K


You are currently subscribed to ntdev as: xxxxx@L5sg.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

The company is heading down the tubes and I was laid off last year. All the
other driver developers are gone too. When this company began in 1998 as a
venture funded by Toshiba with Fischer International Systems Corporation
providing the IP, USB was expensive and generally not available on computers
in Japan. Now the USB based devices are also sold by SmartDisk and I wrote
the disk class driver for the first SmartMedia & CompactFlash dual media
device.

Now, the mass storage compliant devices are around $30 and just work on W2K,
XP & Me. Some of the current devices are not mass storage compliant such as
a Zio CF reader I have and it is a real pain. I have a SmartDisk SmartMedia
reader that is mass storage compliant and it just works all the time.

One advantage to the floppy type of devices was the low learning curve that
was initially required. No installation required. That was a big concern
to the Japanese companies that branded the FlashPath.

----- Original Message -----
From: “Moreira, Alberto”
To: “NT Developers Interest List”
Sent: Tuesday, September 17, 2002 11:05 AM
Subject: [ntdev] RE: Floppy disk insertion and ejection problem

> One possibly dumb question, with those nice little CompactFlash USB
drivers
> around, who needs floppies anymore ?
>
> Alberto.
>
>
> -----Original Message-----
> From: David J. Craig [mailto:xxxxx@yoshimuni.com]
> Sent: Tuesday, September 17, 2002 10:39 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Floppy disk insertion and ejection problem
>
>
> We determined that attempting to check the floppy drive for media at 5
> second intervals would cause the drive to fail within about 3 months of
> normal 9 to 5 usage. It is NOT possible to check the changeline without
> spinning up the motor. You don’t have to wait for the motor to reach full
> speed, but the power surge occurs on the drive. Your users won’t like it
if
> you make them replace their floppy drives several times a year.
>
> The changeline was generally correct for 3.5" diskettes. The 5.25"
diskette
> drives had many problems including that the old drives didn’t support
> changeline at all. I would suggest a closer reading of the sources in the
> NT4 DDK of the floppy driver. If you use the W2K or XP DDKs, you will
have
> to read and understand both the floppy driver and the FDC driver.
>
> It is not really possible to do what your design requires. A floppy
filter
> will be able to see the media changed info and know if the floppy driver
> thinks it is different media. If the media has not been mounted the
floppy
> driver will not indicate media changed, so this is not perfect.
>
> ----- Original Message -----
> From: “Felix K”
> To: “NT Developers Interest List”
> Sent: Tuesday, September 17, 2002 9:32 AM
> Subject: [ntdev] RE: Floppy disk insertion and ejection problem
>
>
> > [skip]
> >
> > JB> One solution might be (and this is a bit exccesive) to filter the
> > JB> hardware access to the floppy drive. In this idea, any access to
the
> > JB> floppy device would be caught by your filter driver and then you can
> > JB> send notification to your user-land app (using the inverted call
> model).
> > JB> You wouldn’t be notified of an insertion or ejection. But you would
> be
> > JB> able to be notified on initial access (you could ignore subsequent
> > JB> accesses). Would this help?
> >
> > I suppose it would help to solve the problem, however there is a similar
> > method which is concluded in patching NtCreateFile() function. In that
> > case we can monitor any attempts to access the floppy device and log
> > neccessary info. But neither in the first case nor in the second we
> > can’t to handle floppy discette ejection. One more method is concluded
> > in checking the floppy device on descette presence in given time
> > intervals, but every such attempt causes noise from the device which is
> > not acceptable. May be there is a silent method of checking the floppy
> > device?
> >
> > JB> If anyone else has a suggestion, I’m interested as well.
> >
> > And I’m too.
> >
> > Yours faithfully,
> > Felix K
> >
> Someone please correct me if I’m wrong on what I’m about to say…
>
> I don’t believe there is such a notification for the floppy drive. The
> reason, as far as I am able to remember, stems from the fact that the
> ‘changed disk’ line on the floppy drive was not always implemented
> correctly. So on a pc it’s often ignored, the only real 1way to
> determine if a disk is in the drive or not was to a read, seek or
> whatever, on the actual floppy.
>
> In addition, there is a problem in determining if a floppy disk inserted
> now is different from one previously inserted. This is due to the
> inconsistent manner in which floppy serial id #'s are done (many can
> have 0’s).
>
> I know this doesn’t help your situation. I’m trying to think of
> possible solutions to the problem.
>
> One solution might be (and this is a bit excessive) to filter the
> hardware access to the floppy drive. In this idea, any access to the
> floppy device would be caught by your filter driver and then you can
> send notification to your user-land app (using the inverted call model).
> You wouldn’t be notified of an insertion or ejection. But you would be
> able to be notified on initial access (you could ignore subsequent
> accesses). Would this help?
>
> I’m not a real big fan of over-engineering a problem, and this might be
> a case where this is overengineering. I just don’t see another way
> yet given the relatively poor consistency with which some signals on
> floppy drives have been handled in the past.
>
> If anyone else has a suggestion, I’m interested as well.
>
> - jb
> ============================================
> Jonathan Borden
> L5 Software Group, LLC
> “remember…all computers wait at the same speed.”
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Felix K
> Sent: Tuesday, September 17, 2002 2:27 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Floppy disk insertion and ejection problem
>
>
> JB> What exactly is your goal with this? That might help in getting a
> JB> good answer…
>
> I’m writing a part of security complex which must control the facts of
> useing any removable media (CDROM, Floppy discs, …).
>
> When somebody inserts a CD disk into device I receive WM_DEVICECHANGE
> message from the system, then retrieve necessary information about this
> CD (Label, File system type, …) and write it into log file. When
> somebody ejects CD disk, I do the same operation.
>
> But in situation with floppy diskette the system unfortunately don’t
> send me any notifications and I can’t fix the fact of it insertion or
> ejection. So, is it possible somehow to fix the facts of floppy diskette
> insertion and ejection?
>
> Please, help.
>
> Thank You in advance, for any advice
> Felix K
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@compuware.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>
>
> The contents of this e-mail are intended for the named addressee only. It
> contains information that may be confidential. Unless you are the named
> addressee or an authorized designee, you may not copy or use it, or
disclose
> it to anyone else. If you received it in error please notify us
immediately
> and then destroy it.
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@yoshimuni.com
> To unsubscribe send a blank email to %%email.unsub%%

JK> You can do this with a file system filter driver; simply monitor the
JK> mount requests.

Some times ago I have tried to implement file system filter driver
for mount requests monitoring, but faced with a problem which
forced me to stop the work in this direction.

So, the problem is in the method which have been used by me to
hook file system’s device. This method consists of 5 steps:

  1. First open the volume’s root directory (ZwCreateFile());
  2. Got the file handle, so now look-up the file-object it refers to
    (ObReferenceObjectByHandle());
  3. Next, find out what device is associated with the file object by
    getting its related device object (IoGetRelatedDeviceObject())
  4. Make a hooking device object that will be attached to file system’s
    device (IoCreateDevice()).
  5. Finally, attach to the device (IoAttachDeviceByPointer()).

After experiments and studies I found that the file system driver
creats the device for floppy diskette at the time of the first successful
attempt to access the discette, but NOT at Windows startup. When
I tried to hook file system’s device (for floppy discette) which
wasn’t mounted/created yet I had an error at the first step (ZwCreateFile()).

Please, let me ask You and other Professionals from this mailing list
to clarify the situation with the file system filter driver and
correct me if I wrong somewhere.

Thanks to All for any help.
Yours faithfully,
Felix K

> insertion or ejection. So, is it possible somehow to fix the facts

of floppy diskette insertion and ejection?

Write a disk filter driver immediately on top of flpydisk.sys.
Monitor the read IRPs with SL_OVERRIDE_VERIFY_VOLUME flag. Both mount
and remount will issue these IRPs.

So, you will monitor any FASTFAT’s accesses to floppy, without the
chance of tracking the floppy eject though. Looks like it is not so
possible to monitor probable raw (sector-level) floppy accesses.

Max

> In addition, there is a problem in determining if a floppy disk
inserted

now is different from one previously inserted. This is due to the
inconsistent manner in which floppy serial id #'s are done (many can
have 0’s).

Can you assume all floppies are FAT? If yes - then use FAT’s volume
serial number and volume label as floppy ID.
FASTFAT itself uses the same :slight_smile:

Max