Re: DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?

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



Jeffrey Tan[MSFT] wrote:
Hi Uwe,

Sorry for letting you wait.

So, what is the correct way for a Win32 service under WOW64 to get this
notification with the correct handle values?

Well, it should work. There is a thunk defined for WM_DEVICECHANGE message that takes care of thunking DEV_BROADCAST_HANDLE. It could be a corner case though. Do you have an easy and detailed repro?


Ok, I've made simple demo project with VS6:
http://www.uwe-sieber.de/sourcecode/medianotify_src.zip
(26KB).

It's a single thread console app which creates a window for
receiving the notifications.
Debug output is made into the console window. The program
stops when the window is closed.
A release EXE is included.

As commandline param a single drive letter is expected, as
medianotify X

It registers then for a handle to the disk or cdrom device
of this volume.
When a media is removed or inserted it receives DBT_CUSTOMEVENT
with GUID_IO_MEDIA_REMOVAL or GUID_IO_MEDIA_ARRIVAL.

It shows the handles used for RegsiterDeviceNotification and
the handles received with DBT_CUSTOMEVENT in the
DEV_BROADCAST_HANDLE struct.

Unfortunally I have no Vista x64 here. It works under XP and
Vista32.
The drive letter must be of a drive with removable media,
best a flash card reader, an CDROM drive works too.
Floppy drives do not work because of missing media notification
support.

If it should work under Vista x64 then the problem may
occur only in a Win32 service. I'll change the app then
into a Win32.


Uwe











.



Relevant Pages

  • Re: DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?
    ... Debug output is made into the console window. ... When a media is removed or inserted it receives DBT_CUSTOMEVENT ... Floppy drives do not work because of missing media notification ...
    (microsoft.public.win32.programmer.kernel)
  • Re: DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?
    ... Debug output is made into the console window. ... When a media is removed or inserted it receives DBT_CUSTOMEVENT ... Floppy drives do not work because of missing media notification ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Disable cdrom polling
    ... command, ... informs the OS when a media is inserted. ... actively sending notification when media is inserted without being asked. ... no optical drives are compliant with the specification. ...
    (alt.os.linux.suse)
  • Re: DVD RAM?
    ... I have read that DVD RAM is a much more reliable media for important ... DVD RAM but pressumably use the type 4 cartridge with the disk ... would be Pioneer or Plasmon (not sure if Plasmon made drives or just ... and the stated reliability drops dramatically for the formats ...
    (comp.sys.ibm.pc.hardware.storage)
  • Re: newbie Question: Data exchange between Dialog and my own data structure
    ... Typically this is handled by sending a notification to however many windows require ... I will simply send a notification via SendMessage to the main window. ... It sounds to me like your statement is "I want to update the values in the controls". ... change could to applied to CMyData. ...
    (microsoft.public.vc.mfc)