Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > RegisterDeviceNotification fails with ERROR_SERVICE_SPECIFIC_ERROR

Reply
Thread Tools Display Modes

RegisterDeviceNotification fails with ERROR_SERVICE_SPECIFIC_ERROR

 
 
PhilG
Guest
Posts: n/a

 
      07-06-2010
Hello,

I'm trying to activate custom device notification between a kernel mode
driver
and a user application. As stated on the subject line, my call to
RegisterDeviceNotification fails with code 1066,
ERROR_SERVICE_SPECIFIC_ERROR.
Here's the code.

DEV_BROADCAST_HANDLE notifyFilter = { 0 };
notifyFilter.dbch_size = sizeof notifyFilter;
notifyFilter.dbch_handle = devHdl; // from CreateFile call with driver
name
notifyFilter.dbch_devicetype = DBT_DEVTYP_HANDLE;
itsDevNotifyHdl = RegisterDeviceNotification(m_hWnd, &notifyFilter,
DEVICE_NOTIFY_WINDOW_HANDLE); // returns 0, GetLastError() = 1066

Not much explanation on this error in the MSDN (or WDK) so I searched the
web.
There are many posts related to this very same problem, but offered answers
fall into two
categories: 1. No answer; 2. use DEV_BROADCAST_DEVICEINTERFACE
(DBT_DEVTYPE_DEVICEINTERFACE).

Unfortunately, I cannot use DEV_BROADCAST_DEVICEINTERFACE because I need the
DBT_CUSTOMEVENT-only flelds in DEV_BROADCAST_HANDLE.

Ironically, I've gotten this to work before in an earlier version of this
driver
(for a legacy ISA board) based on the old Driver::Works framework. The driver
I'm developing now is a straight WDM driver (not KMDF) for a PCI card. The
basic
driver came with the board kit. It did not have a IRP dispatch routine for
IRP_MJ_SYSTEM_CONTROL,
but I added one because ERROR_SERVICE_SPECIFIC_ERROR seems to be related
mainly
to the WMI classes. That hasn't made a difference.

Any clues out there as to why RegisterDeviceNotification would fail with
ERROR_SERVICE_SPECIFIC_ERROR?

Thanks,

Phil

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET Framework 3.0 - KB982524 FAILS JamesKB Windows Update 8 07-02-2010 07:34 PM
Trust problem: DNS name resolution works, nltest /dsgetdc fails Rainer Active Directory 4 04-13-2010 02:45 PM
SBS2003 backup fails every night (sometimes it works manually) Andy Simoens Windows Small Business Server 3 01-28-2010 02:12 PM
Vista fails to start after BSOD Dave Wakefield Windows Vista Installation 6 07-12-2007 10:41 PM
USB Flash Drives (thumbdrives) fails to install TonyR Windows Vista Installation 0 02-12-2007 08:53 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59