2008-04-06

18 new messages in 7 topics - digest

microsoft.public.development.device.drivers
http://groups.google.com/group/microsoft.public.development.device.drivers?hl=en

microsoft.public.development.device.drivers@googlegroups.com

Today's topics:

* Determining a virtual COM port of an USB device - 8 messages, 4 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/7ced944dc5159c9d?hl=en
* Is parsing the HID report manully a right decision in my case? - 1 messages,
1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/93225232f7486749?hl=en
* Vista Error Message - 3 messages, 3 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/674d39469923bbb9?hl=en
* File System Hook - 3 messages, 2 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/8bd85e79bb10ae4f?hl=en
* do not use CM_xxx function call - 1 messages, 1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/b5757acbad3a6910?hl=en
* How do I let audio device in "Sounds and Audio Devices"? - 1 messages, 1
author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/3e124dc9cd8643ca?hl=en
* ntstrsafe.h "No such file or directory in Wndows DDk 2600" ???? - 1 messages,
1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/c076079f15d2092b?hl=en

==============================================================================
TOPIC: Determining a virtual COM port of an USB device
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/7ced944dc5159c9d?hl=en
==============================================================================

== 1 of 8 ==
Date: Fri, Apr 4 2008 10:16 pm
From: "abei"


My advice is to enumrate all COM port by COM class GUID then pick up your
device by device name.


"Dilip" <rdilipk@lycos.com>
??????:7b98a98a-0187-4da4-b3a2-6d37f3ab769a@a70g2000hsh.googlegroups.com...
> Howdy Gurus
>
> I am not a low-level developer -- more of an application programmer,
> so I might've gotten some of my terminology wrong here. Do bear with
> me.
>
> We have a USB printer that we use in our application to print receipts
> and such. The drivers for this printer also create a virtual COM port
> for applications to communicate with it. Is there a way by which I
> can enumerate all the devices that are on the USB ports and determine
> what virtual COM port # they are sitting on? I know its possible to
> blindly open all the available COM ports (virtual or otherwise) one by
> one and query the device for its status and determine if its indeed a
> printer or not. However I don't want to go down this route because if
> by chance another device is sitting on one of the COM ports and I try
> to send some printer-specific control characters it kinda messes up
> that device.
>
> I did read up a lot of stuff on the internet and even came across this
> tiny program that displays all the USB devices connected to your PC --
> (beware its a .PDF document containing CPP code)
> http://www.intel.com/intelpress/usb/examples/DUSBVC.PDF
> I managed to get that code to compile and it even printed information
> regarding my printer but I wasn't able to determine its COM port from
> that info.
>
> Any way out of this?
>


== 2 of 8 ==
Date: Sat, Apr 5 2008 5:35 am
From: chris.aseltine@gmail.com


On Apr 4, 4:41 pm, "Maxim S. Shatskih" <ma...@storagecraft.com> wrote:

> Add a proprietary IOCTL to your COM port implementation.

I think he wants to avoid communicating with unknown devices on the
system altogether. What if a customer's system has a buggy COM port
driver that crashes on unknown IOCTLs?

== 3 of 8 ==
Date: Sat, Apr 5 2008 6:36 am
From: Dilip


On Apr 4, 4:41 pm, chris.aselt...@gmail.com wrote:
> On Apr 4, 2:59 pm, Dilip <rdil...@lycos.com> wrote:
>
> > We have a USB printer that we use in our application to print receipts
> > and such.  The drivers for this printer also create a virtual COM port
> > for applications to communicate with it.  Is there a way by which I
> > can enumerate all the devices that are on the USB ports and determine
> > what virtual COM port # they are sitting on?
>
> My advice is to drop the idea of looking for COM ports altogether and
> look for device interfaces.  Use SetupDiEnumDeviceInterfaces() to
> enumerate all instances of the COM port GUID (i.e.
> {86e0d1e0-8089-11d0-9ce4-08003e301f73}) and then look for your
> device's VID and PID in the symbolic link.

I already managed to accomplish this. However I definitely need to
know the virtual COM port # because some of the status messages that
the device sends (like out-of-paper, lid open etc) comes via that
communication port. The only 2 uses of the USB port are for the
actual printing and to subscribe to printer plugged-in/plugged-out
events.

As I said its possible to interrogate every COM port from 1 - 10, send
some control characters, watch the response and then determine if the
printer is sitting there or not. The problem with this approach is if
another device has used one of these ports then sending control
characters to that device messes it up for some reason.

== 4 of 8 ==
Date: Sat, Apr 5 2008 6:37 am
From: Dilip


Maxim

The printer is a third party device. We don't own the source code to
it. I will have to work with what I have. See my reply to Chris
elsethread.

On Apr 4, 4:41 pm, "Maxim S. Shatskih" <ma...@storagecraft.com> wrote:
>     Add a proprietary IOCTL to your COM port implementation.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> ma...@storagecraft.comhttp://www.storagecraft.com
>
> "Dilip" <rdil...@lycos.com> wrote in message
>
> news:7b98a98a-0187-4da4-b3a2-6d37f3ab769a@a70g2000hsh.googlegroups.com...
>
>
>
> > Howdy Gurus
>
> > I am not a low-level developer -- more of an application programmer,
> > so I might've gotten some of my terminology wrong here.  Do bear with
> > me.
>
> > We have a USB printer that we use in our application to print receipts
> > and such.  The drivers for this printer also create a virtual COM port
> > for applications to communicate with it.  Is there a way by which I
> > can enumerate all the devices that are on the USB ports and determine
> > what virtual COM port # they are sitting on?  I know its possible to
> > blindly open all the available COM ports (virtual or otherwise) one by
> > one and query the device for its status and determine if its indeed a
> > printer or not.  However I don't want to go down this route because if
> > by chance another device is sitting on one of the COM ports and I try
> > to send some printer-specific control characters it kinda messes up
> > that device.
>
> > I did read up a lot of stuff on the internet and even came across this
> > tiny program that displays all the USB devices connected to your PC --
> > (beware its a .PDF document containing CPP code)
> >http://www.intel.com/intelpress/usb/examples/DUSBVC.PDF
> > I managed to get that code to compile and it even printed information
> > regarding my printer but I wasn't able to determine its COM port from
> > that info.
>
> > Any way out of this?- Hide quoted text -
>
> - Show quoted text -

== 5 of 8 ==
Date: Sat, Apr 5 2008 6:38 am
From: Dilip


On Apr 5, 12:16 am, "abei" <aboutwh...@163.com> wrote:
> My advice is to enumrate all COM port by COM class GUID then pick up your
> device by device name.

Could you show me an example of how to do this? You can also point me
in the right direction? I am more of an application programmer but
have been writing code for almost a decade. I shouldn't have any
problems getting something up and running if I knew where to look.

== 6 of 8 ==
Date: Sat, Apr 5 2008 1:37 pm
From: "Pavel A."


"Dilip" <rdilipk@lycos.com> wrote in message
news:4faeb6b4-a9f2-4f2b-ad10-37d24412c11a@b1g2000hsg.googlegroups.com...

>... I definitely need to
> know the virtual COM port # because ....

Ok then do you know the hw id of your USB device?
You can detect whether parent of the COM port is an usb device with certain
ID.

--PA

== 7 of 8 ==
Date: Sat, Apr 5 2008 8:35 pm
From: chris.aseltine@gmail.com


On Apr 5, 8:36 am, Dilip <rdil...@lycos.com> wrote:

> On Apr 4, 4:41 pm, chris.aselt...@gmail.com wrote:
>
> > My advice is to drop the idea of looking for COM ports altogether and
> > look for device interfaces. Use SetupDiEnumDeviceInterfaces() to
> > enumerate all instances of the COM port GUID (i.e.
> > {86e0d1e0-8089-11d0-9ce4-08003e301f73}) and then look for your
> > device's VID and PID in the symbolic link.
>
> I already managed to accomplish this. However I definitely need to
> know the virtual COM port # because some of the status messages that
> the device sends (like out-of-paper, lid open etc) comes via that
> communication port. The only 2 uses of the USB port are for the
> actual printing and to subscribe to printer plugged-in/plugged-out
> events.

I don't think you understood what I said. Either opening the symbolic
link (i.e. "\\?
\ACPI#PNP0501#1#{86e0d1e0-8089-11d0-9ce4-08003e301f73}") or the
"virtual COM port #" (i.e. "\\.\COM9") -- each will give you a handle
to the same exact device stack.

In the case of the symbolic link, you can look for your device's
hardware ID in it, so that solves your problem of distinguishing
devices without probing.

== 8 of 8 ==
Date: Sat, Apr 5 2008 11:09 pm
From: "Pavel A."


<chris.aseltine@gmail.com> wrote in message
news:df83d95c-a9eb-4683-9141-4a05ee334f15@b1g2000hsg.googlegroups.com...
.............
> In the case of the symbolic link, you can look for your device's
> hardware ID in it, so that solves your problem of distinguishing
> devices without probing.

Chris, this is risky - MS folks warned several times that the sym. link
format
can change.

--PA


==============================================================================
TOPIC: Is parsing the HID report manully a right decision in my case?
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/93225232f7486749?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Apr 5 2008 3:32 am
From: Gurmit Teotia


Hello Experts,
I'm new to HID. I need to develop an application which communicates
with a Touch board. That board use HID protocol for communication.
USB, COM and IP (Internet Protocol) can be used to communicate with
board.

I'm thinking of parsing the report manually as HidP_* can't be used
when board is connected either through COM or IP. I'm very well aware
of report format. I'd not be using the report descriptor to parse the
report. I'll directly be picking up the data from report.

I'd highly appreciate any comment it.

Regards,
Gurmit


==============================================================================
TOPIC: Vista Error Message
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/674d39469923bbb9?hl=en
==============================================================================

== 1 of 3 ==
Date: Sat, Apr 5 2008 4:11 am
From: "Mike Hayward"


Don't know if I'm in the right place to ask this question, but here goes.

I Took delivery of a new laptop yesterday with Vista Home Premium installed.

I've set up two users, however when logging on to the secondard user account
I get the following error message:

"error loadNTDriver"

Anyone, know what this is and how I can resolve it?

Thanks

== 2 of 3 ==
Date: Sat, Apr 5 2008 4:25 am
From: "Maxim S. Shatskih"


Some of the vendor's preinstalled software is buggy.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Mike Hayward" <hayward.m1@btinternet.com> wrote in message
news:6D2EE0F5-2BB7-4F86-839B-320BCBF7D4D7@microsoft.com...
> Don't know if I'm in the right place to ask this question, but here goes.
>
> I Took delivery of a new laptop yesterday with Vista Home Premium installed.
>
> I've set up two users, however when logging on to the secondard user account
> I get the following error message:
>
> "error loadNTDriver"
>
> Anyone, know what this is and how I can resolve it?
>
> Thanks
>

== 3 of 3 ==
Date: Sat, Apr 5 2008 4:25 pm
From: Tim Roberts


"Mike Hayward" <hayward.m1@btinternet.com> wrote:
>
>Don't know if I'm in the right place to ask this question, but here goes.
>
>I Took delivery of a new laptop yesterday with Vista Home Premium installed.
>
>I've set up two users, however when logging on to the secondard user account
>I get the following error message:
>
>"error loadNTDriver"
>
>Anyone, know what this is and how I can resolve it?

Google is way faster than this newsgroup at solving specific problems.

This is related to some hotkey utility on MSI notebooks. According to
Google, you can solve this by opening up an administrator command shell and
typing:
sfc /scannow
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.


==============================================================================
TOPIC: File System Hook
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/8bd85e79bb10ae4f?hl=en
==============================================================================

== 1 of 3 ==
Date: Sat, Apr 5 2008 7:17 pm
From: "Allan"


I need to monitor a particular file if the same file handle is being used to
write data to it.
Is it possible to hook the file system to get information like these?
Is there ready made software that does this?

File File Handle Event
Config.ini 1 File Opened
Config.ini 1 File Append Data
Config.ini 1 File Append Data
Config.ini 1 File Append Data
Config.ini 1 File Closed

== 2 of 3 ==
Date: Sat, Apr 5 2008 4:25 am
From: "Maxim S. Shatskih"


FILEMON

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Allan" <mmress@hotmail.com> wrote in message
news:uJGDe6wlIHA.4684@TK2MSFTNGP06.phx.gbl...
> I need to monitor a particular file if the same file handle is being used to
> write data to it.
> Is it possible to hook the file system to get information like these?
> Is there ready made software that does this?
>
> File File Handle Event
> Config.ini 1 File Opened
> Config.ini 1 File Append Data
> Config.ini 1 File Append Data
> Config.ini 1 File Append Data
> Config.ini 1 File Closed
>
>
>

== 3 of 3 ==
Date: Sat, Apr 5 2008 8:17 pm
From: "Allan"


Thanks! I had just got the answer too.

Ok. I had found the solution.
There is no need to track the file handle for my case.
I just need to track the event to "File Open" to the Config.ini file, and
track a corresponding "File Close" event. I would be able to tell the same
handle had written data to the Config.ini file.

There is a ready made software File Monitor or Process Monitor.

http://technet.microsoft.com/en-us/sysinternals/bb545046.aspx

// File Open
8:10:06 PM Project1.exe:1856 C:\gb\file.txt Options: OverwriteIf Access:
00120196
8:10:06 PM Project1.exe:1856 C:\gb\ Options: Open Directory Access:
00100000

// File Write Data
8:10:11 PM Project1.exe:1856 Msimtf.dll Attributes: A
8:10:11 PM Project1.exe:1856 Msimtf.dll Options: Open Access: 00100020
8:10:11 PM Project1.exe:1856 Msimtf.dll Length: 159232
8:10:11 PM Project1.exe:1856 Msimtf.dll
8:10:11 PM Project1.exe:1856 Msimtf.dll
8:10:11 PM Project1.exe:1856 Msimtf.dll Attributes: A
8:10:11 PM Project1.exe:1856 Msimtf.dll Options: Open Access: 00100020
8:10:11 PM Project1.exe:1856 Msimtf.dll Length: 159232
8:10:11 PM Project1.exe:1856 Msimtf.dll
8:10:11 PM Project1.exe:1856 Msimtf.dll

// File Close
8:10:16 PM Project1.exe:1856 C:\gb\file.txt Offset: 0 Length: 5
8:10:16 PM Project1.exe:1856 C:\gb\file.txt
8:10:16 PM Project1.exe:1856 C:
8:10:16 PM Project1.exe:1856 C:\gb\file.txt

"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:e9DjI$wlIHA.5268@TK2MSFTNGP05.phx.gbl...
> FILEMON
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
> "Allan" <mmress@hotmail.com> wrote in message
> news:uJGDe6wlIHA.4684@TK2MSFTNGP06.phx.gbl...
>> I need to monitor a particular file if the same file handle is being used
>> to
>> write data to it.
>> Is it possible to hook the file system to get information like these?
>> Is there ready made software that does this?
>>
>> File File Handle Event
>> Config.ini 1 File Opened
>> Config.ini 1 File Append Data
>> Config.ini 1 File Append Data
>> Config.ini 1 File Append Data
>> Config.ini 1 File Closed
>>
>>
>>
>



==============================================================================
TOPIC: do not use CM_xxx function call
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/b5757acbad3a6910?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Apr 5 2008 8:40 am
From: KenH


No, I take it back. Yesterday I installed another HBA and the
SPDRP_PHYSICAL_DEVICE_OBJECT_NAME did not show SCSI port address at all. It's
in \Device\xxxx format. So I still don't know how to get the SCSI port
address of a enclosure.

Ken

"KenH" wrote:

> Hi,
>
> I found used the same function call with SPDRP_PHYSICAL_DEVICE_OBJECT_NAME
> property can get all of them.
>
> Ken
>
> "KenH" wrote:
>
> > Kalle,
> >
> > Thanks, it works. May I ask for how to get the scsi port number for the disk
> > enclosure? I can get the bus/target/lun now, I need the scsi port# also.
> >
> > Ken
> >
> > "Kalle Olavi Niemitalo" wrote:
> >
> > > KenH <KenHwang@newsgroup.nospam> writes:
> > >
> > > > May someone hint me how to get the parameters used in SetupDixxx from
> > > > the CM_xx device instance handle?
> > >
> > > Perhaps you could use CM_Get_Device_ID, then SetupDiOpenDeviceInfo.
> > > SP_DEVINFO_DATA::DevInst is for the opposite direction.
> > >


==============================================================================
TOPIC: How do I let audio device in "Sounds and Audio Devices"?
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/3e124dc9cd8643ca?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Apr 5 2008 9:33 am
From: Peter Lin


How do I let audio device in "Sounds and Audio Devices"?

Now, I have two pins. One input audio pin, and One output audio pin.
There are in one Filter.
I create one node in the Filter, and I create two connection to connect them.
But "Sounds and Audio Devices" does'nt show my audio device.

Is need special condition?
thanks.


==============================================================================
TOPIC: ntstrsafe.h "No such file or directory in Wndows DDk 2600" ????
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/c076079f15d2092b?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Apr 5 2008 3:03 pm
From: Tim Roberts


Beginner to device driver <ranu2006@gmail.com> wrote:
>
>I first tried with sc command ... as I was not know that pnp drivers
>cannot be started through command promt
>
>but I even tried with code using StartService api call ,even then I
>face the same problem .....

Right. The "sc" command is just a way to access the StartService API. PnP
drivers cannot be started as services. They must be loaded by PnP when
some bus driver enumerates them.

What kind of a driver is this?
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

==============================================================================

You received this message because you are subscribed to the Google Groups "microsoft.public.development.device.drivers"
group.

To post to this group, visit http://groups.google.com/group/microsoft.public.development.device.drivers?hl=en

To unsubscribe from this group, send email to microsoft.public.development.device.drivers-unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/microsoft.public.development.device.drivers/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com?hl=en

1 comment:

Daisy Jones said...

very helpful! Here you will get all kind of solution like

d link router password
dlink australia
D-link Tech Support