Re: WM_DEVICECHANGE PARAMETERS



one of the drivers is enable the COM port device interface, the other is not (and is just creating a symbolic COM port name link). the view in device manager is by device class (e.g. the GUID in the INF at the top), it has no relation to device interface.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Rob" <Rob@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:2344856A-8038-493D-8DB9-49070425B29D@xxxxxxxxxxxxxxxx
Hi,
Thanks for your tips.
I got it working for the devices I mentioned, by just registerring for
keyboards.
Disks and ports are an exception, and are always notified "with data".

Unfortunately the custom USB-comport-device thats produced in-house by the
company I work for, somehow is not the same as another USB-COM device I have.
They both appear in devicemanager under ports (class), and are both shown by
XP as a comport (deviceinterface ?) .

The custom (self-built) device however, does not produce a notification
"with data", as the other (bought) device does. The device programmer tells
me that the device has the following properties (part of descriptor):

0x02, /* bcdUSB = 2.00 */
0x02, /* bDeviceClass: CDC */
0x00, /* bDeviceSubClass */
0x00, /* bDeviceProtocol */
0x40, /* bMaxPacketSize0 */

Any idea what could be wrong here ?
Strange that in XP-devicemanager, and under WinCE everything is OK.
Just the notification is giving me trouble.

Greetings,
Rob.


"Doron Holan [MSFT]" wrote:

the device arrival message will include the device interface GUID and will
include the symbolic link name to the device.

WM_DEVICECHANGE
http://msdn.microsoft.com/en-us/library/aa363205(VS.85).aspx

DEV_BROADCAST_DEVICEINTERFACE Structure
http://msdn.microsoft.com/en-us/library/aa363244(VS.85).aspx

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Rob" <Rob@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:28F01714-9D35-408B-A3DF-4E63C8C46AE9@xxxxxxxxxxxxxxxx
> Hi,
> Thanks, I'll try that first thing tomorrow.
>
> I assume you mean this is done by calling the register function > multiple
> times with differrent GUIDS, and I assume that the resulting
> WM_DEVICECHANGE
> will have usefull info then ? (if I register for "all classes" I just > get
> class guids, but if I register for keyboard I should get the keyboard > guid
> in
> the response ?) , Right ?
>
> Do you happen to know where I can find the devicename of the inserted
> device
> ?
> I did see a sample where some long , very cryptic devicename was
> retrieved,
> but not the short form like KBD1:,COM1: etc...
>
> Greetings,
> Rob.
>
>
>
>
>
> "Doron Holan [MSFT]" wrote:
>
>> yes, of course you can register for multiple notifications. for
>> keyboards
>> you should GUID_DEVINTERFACE_KEYBOARD, not the HID guid.
>>
>> d
>> -- >> Please do not send e-mail directly to this alias. this alias is for
>> newsgroup purposes only.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>>
>> "Rob" <Rob@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:0153784F-2B33-43C4-B915-C121014F7BE5@xxxxxxxxxxxxxxxx
>> > Hi,
>> > I need to monitor several types of devices at the same time :
>> > - keyboard (not all HID's)
>> > - Comports
>> > - Disks
>> >
>> > Can I register multiple times for this ?
>> >
>> > Greetings,
>> > Rob.
>> >
>> >
>> > "Doron Holan [MSFT]" wrote:
>> >
>> >> you need to register with a specific device interface. this tells >> >> you
>> >> the
>> >> type of device. once you have the devicce instance path on the
>> >> arrival
>> >> notification you can use setupdi to open up the properties for the
>> >> device
>> >> and read the "ComPort" property (for a COM port)
>> >>
>> >> d
>> >>
>> >> -- >> >> Please do not send e-mail directly to this alias. this alias is for
>> >> newsgroup purposes only.
>> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> rights.
>> >>
>> >>
>> >> "Rob" <Rob@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> news:A51D55EF-F958-40F2-920C-1AD0DB3D73A8@xxxxxxxxxxxxxxxx
>> >> > Hi,
>> >> > I also had the problem that LParam is 0.
>> >> > See codefragment below for the right (?) way to register, in >> >> > order
>> >> > to
>> >> > solve
>> >> > that.
>> >> >
>> >> > My problem is that when I plug in a device (like a COMPORT) I >> >> > would
>> >> > like
>> >> > to
>> >> > know 2 things :
>> >> > 1) WHat kind of device was plugged (comport, I need the IF-GUID I
>> >> > think)
>> >> > 2) What it's devicename is (Like COM1:)
>> >> >
>> >> > This seems impossible without to determine from the
>> >> > notification-info.
>> >> > See : http://69.10.233.10/KB/cs/HardwareHelper.aspx
>> >> > and :
>> >> > http://www.codeproject.com/KB/system/HwDetect.aspx?display=PrintAll
>> >> >
>> >> > monitoring the entire devicelist seems the only option.
>> >> > I hope I'm wrong about this.
>> >> >
>> >> > Any tips ?
>> >> >
>> >> >
>> >> > //****** CODE fragment: ******
>> >> >
>> >> > DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
>> >> > GUID tmp={0,0,0,""};
>> >> > ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) );
>> >> >
>> >> > NotificationFilter.dbcc_size =
>> >> > sizeof(DEV_BROADCAST_DEVICEINTERFACE);
>> >> > NotificationFilter.dbcc_devicetype = >> >> > DBT_DEVTYP_DEVICEINTERFACE;
>> >> > NotificationFilter.dbcc_classguid = tmp;
>> >> >
>> >> > m_hDevNotify = RegisterDeviceNotification(m_hWnd
>> >> > ,&NotificationFilter,
>> >> > DEVICE_NOTIFY_WINDOW_HANDLE|DEVICE_NOTIFY_ALL_INTERFACE_CLASSES);
>> >> >
>> >> > //****** end CODE fragment: ******
>> >> >
>> >> >
>> >> >
>> >> > Greetings,
>> >> > Rob.
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > "rseedle" wrote:
>> >> >
>> >> >> I am recieving the plug in / unplug events correctly but the >> >> >> WPARAM
>> >> >> always
>> >> >> has a 7 in it. If I understand correctly the WPARAM should >> >> >> specify
>> >> >> the
>> >> >> values
>> >> >>
>> >> >> DBT_DEVICEARRIVAL 0x8000
>> >> >> and
>> >> >> DBT_DEVICEREMOVECOMPLETE 0x8004
>> >> >>
>> >> >> What is up with that ?
>> >> >>
>> >> >> Randy Seedle
>> >>
>> >>
>>
>>



.



Relevant Pages

  • Re: DECLARE_UNICODE_STRING_SIZE and SymbolicLink?
    ... you do not need to give your device a name, all you need to do is create the device interface and register it and it will use the PDO's auto generated name as the link target. ... Please do not send e-mail directly to this alias. ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.development.device.drivers)
  • connect to named instances
    ... is bcos of the port number.. ... alias in client network utility with the instance name and the actual port ... but i have to use the alias. ... Can i not register with the instance name directly without setting it up ...
    (microsoft.public.sqlserver.server)
  • RE: access across domains
    ... As my understanding, from your SQL Server, you want to register a remoter ... SQL Server from a domain which is different from the one your SQL Server is ... different domain through Alias: ... Port 1433 is the default port number for SQL Server. ...
    (microsoft.public.sqlserver.security)
  • Re: Via VT 6410 Raid Controller
    ... Using 1 I/O APICs Using ACPI for SMP configuration information Allocating PCI resources starting at 20000000 Built 1 zonelists mapped APIC to ffffd000 ... Allocate Port Service ... USB Universal Host Controller Interface driver v2.2 ... IFWLOG: register target usbcore: registered new driver usblp drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver parport: PnPBIOS parport detected. ...
    (Linux-Kernel)
  • Re: 2.6.22-rc3 hibernate(?) fails totally - regression (xfs on raid6)
    ... the port and hibernate is trying to resume scsi disk device. ... pnp: Device 00:08 activated. ... ACPI: PCI interrupt for device 0000:00:09.0 disabled ... atyfb: using auxiliary register aperture ...
    (Linux-Kernel)