Re: DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?
- From: Uwe Sieber <mail@xxxxxxxxxxxxx>
- Date: Wed, 10 Oct 2007 12:56:31 +0200
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 thisnotification 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
.
- Follow-Ups:
- Re: DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?
- From: Uwe Sieber
- Re: DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?
- References:
- DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?
- From: Uwe Sieber
- RE: DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?
- From: "Jeffrey Tan[MSFT]"
- DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?
- Prev by Date: Re: How to Read Message tables from PE Files,...
- Next by Date: Re: How to Read Message tables from PE Files,...
- Previous by thread: RE: DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?
- Next by thread: Re: DEV_BROADCAST_HANDLE / DEV_BROADCAST_HANDLE64 ?
- Index(es):
Relevant Pages
|