RegisterDeviceNotification in service

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: wei (wei_chen55_at_comcast.net)
Date: 05/28/04


Date: Fri, 28 May 2004 11:07:52 -0400

Hello,
I am trying to get my service program notified with new volume arrival
event.
But the RegisterDeviceNotification keep failing me with error code 13 which
is
invalid_data.

Following is my code, can anyone point me where i did wrong?

Thank you very much.

DEV_BROADCAST_VOLUME NotificationFilter;
 ZeroMemory(&NotificationFilter,sizeof(DEV_BROADCAST_VOLUME));
 NotificationFilter.dbcv_size = sizeof(DEV_BROADCAST_VOLUME);
 NotificationFilter.dbcv_devicetype = DBT_DEVTYP_VOLUME;

//No use to tweak the dbcv)unitmask and dbcv_flags
 //NotificationFilter.dbcv_unitmask = 0x0215;
 //NotificationFilter.dbcv_flags = DBTF_MEDIA;

NotifyHandle =
RegisterDeviceNotification(m_hServiceStatus,&NotificationFilter,DEVICE_NOTIF
Y_SERVICE_HANDLE);



Relevant Pages

  • Installworld fails...
    ... My installworld is ... failing as follows: ... for prog in [awk cap_mkdb cat chflags chmod chown date echo egrep find ... *** Error code 1 ...
    (freebsd-questions)
  • Re: AfxHookWindowCreate fails and createEx returns getlasterror value as Zero and does not give a me
    ... i found that CreateEx is causing the problem. ... AfxHookWindowCreate is failing. ... Can any one please tell why AfxHookWindowCreate can fail..The window ...
    (microsoft.public.vc.mfc)
  • Re: replaced HD & lost license
    ... > I copied over the image of an exisiting Windows XP pro HD ... > Maxtor. ... After disconnecting the failing HD I rebooted the ... > issue or referencing this error code. ...
    (microsoft.public.windowsxp.hardware)
  • replaced HD & lost license
    ... I copied over the image of an exisiting Windows XP pro HD ... After disconnecting the failing HD I rebooted the ... issue or referencing this error code. ...
    (microsoft.public.windowsxp.hardware)
  • GD from ports on FreeBSD 4.9
    ... The gd update is failing with the following errors: ... gdft.c: In function `fontFetch': ... *** Error code 1 ... monks. ...
    (freebsd-questions)