ATL service PNP driver notification register RRS feed

  • Question

  • Hello everyone,

    I am trying to registration ATL service application for PNP device query remove request however I have not already succeed. I am trying to using RegisterDeviceNotification() function but first parameter of this function needs to handle. Any idea or suggestion would be great.

    Small part of source code as below,


        ZeroMemory(&filter, sizeof(filter));
        filter.dbcc_size = sizeof(DEV_BROADCAST_HANDLE);
        filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
        filter.dbcc_classguid = GUID_QUERY_REMOVE_NOTIFY;

        CAtlServiceModuleTChild.m_hNotification = RegisterDeviceNotification(???, (PVOID)&filter, DEVICE_NOTIFY_SERVICE_HANDLE );


    Peace at home, peace in the world -- Mustafa Kemal

    Thursday, April 18, 2013 5:41 PM


  • You are confused on two fronts
    1)  the first parameter to RegisterDeviceNotification for a service would the return value from RegisterServiceCtrlHandler(Ex)
    2) to register for file handle notifications you need to use DEV_BROADCAST_HANDLE, not DEV_BROADCAST_INTERFACE, set the dbch_devicetype to DBT_DEVTYP_HANDLE, set dbcc_devicetype to the handle you opened


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, April 18, 2013 9:36 PM