Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   Mount Volume Notification (https://forum.exetools.com/showthread.php?t=7558)

just4urim 05-15-2005 17:52

Mount Volume Notification
 
Hi all

I have a BIG problem with notification about mounted volumes . I want to implement an application (in user/kernel mode) that could be notified whenever any removable medias( like Floppy or CD-ROM) or network drive is being mounted.
You know ,my app.(in user mode) could be notified about any modification on certain Dir (including file rename , create or delete ) by using 'FindFirstChangeNotification'.
But It does not work on drive which have not been mounted yet.
how can i solve it ?

omidgl 05-16-2005 00:50

You can use RegisterDeviceNotification function in User32.dll. The documentation can be found on Platform SDK (or MSDN).

Regards
O M I D

just4urim 05-16-2005 11:53

Hi ,
I used RegisterDeviceNotification , but i don't know which GUID i should use in dbcc_classguid to receive the notification of new arrival volumes! :confused:
I also used DEV_BROADCAST_VOLUME as the second parameter of RegisterDeviceNotification ,
and set its filed as follow :
.dbcv_size = sizeof(DEV_BROADCAST_VOLUME );
.dbcv_devicetype = DBT_DEVTYP_VOLUME;
.dbcv_unitmask = 0x0001 ;
.dbcv_flags = DBTF_MEDIA ;
but it failed !
TNX

xtx 05-17-2005 03:23

I beleive that you want dbcc_classguid = InterfaceClassGuid. Check out the example on MSDN.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/registering_for_device_notification.asp

Also in RegisterDeviceNotification the value DEVICE_NOTIFY_ALL_INTERFACE_CLASSES can be set and will ignore dbcc_classguid but that is only in specific cases.

xtx

just4urim 05-26-2005 03:28

Tnx for all comments , I did it by attaching to their file system and process the return STATUS code to detect it if the media is exist or not . it's not complete but i'm trying :)


All times are GMT +8. The time now is 14:38.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX