COM Port Device names

Dear All,
Is it necessary that whatever the driver which is enumearating
serial ports name the Symbolic Links the following way:

COMn----> //Device//Serial(n-1)
**************************************************************************
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************

Nope, not at all. Drivers other then serial can name their device
whatever they want, like \Device\RocketPort. Also, serial doesn’t
always follow this convention; if you disable then enable a serial.sys
controlled com port, the COM name will stay the same, but the device
name will be \Device\Serial. Also, this can change based
on PNP start order.

If you look at serial’s source code (it’s in the DDK), it just
increments a number, edited here brevity:

NTSTATUS
SerialCreateDevObj(IN PDRIVER_OBJECT DriverObject,
OUT PDEVICE_OBJECT *NewDeviceObject)
{
static ULONG currentInstance = 0;

RtlIntegerToUnicodeString(currentInstance++, 10, &instanceStr);
RtlAppendUnicodeStringToString(&deviceObjName, &instanceStr);

status = IoCreateDevice(DriverObject,
sizeof(SERIAL_DEVICE_EXTENSION),
&deviceObjName, FILE_DEVICE_SERIAL_PORT,
FILE_DEVICE_SECURE_OPEN, TRUE,
&deviceObject);

D

This posting is provided “AS IS” with no warranties, and confers no
rights.
-----Original Message-----
From: Seshagiri_Babu [mailto:xxxxx@Satyam.com]
Sent: Sunday, July 07, 2002 9:44 PM
To: NT Developers Interest List
Subject: [ntdev] COM Port Device names

Dear All,
Is it necessary that whatever the driver which is enumearating
serial ports name the Symbolic Links the following way:

COMn----> //Device//Serial(n-1)
**********************************************************************

This email (including any attachments) is intended for the sole use of
the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
or
distribution or forwarding of any or all of the contents in this message
is
STRICTLY PROHIBITED. If you are not the intended recipient, please
contact
the sender by email and delete all copies; your cooperation in this
regard
is appreciated.
**********************************************************************



You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

It would seem that anyone not replacing the std serial driver MUST use
different names than \device\serial. Because you do not know what
serial.sys is going to use for the 's (unless you really want to
determine this with your driver…I’ll pass, it’s just extra work) it is
possible that you will run into naming conflicts.

Is there an EASY way to get the list of named serial devices?

…Chris

P.S. SerialDoExternalNaming is where all the links/etc get created.

----- Original Message -----
From: “Doron Holan”
To: “NT Developers Interest List”
Sent: Monday, July 08, 2002 1:06 AM
Subject: [ntdev] RE: COM Port Device names

Nope, not at all. Drivers other then serial can name their device
whatever they want, like \Device\RocketPort. Also, serial doesn’t
always follow this convention; if you disable then enable a serial.sys
controlled com port, the COM name will stay the same, but the device
name will be \Device\Serial. Also, this can change based
on PNP start order.

If you look at serial’s source code (it’s in the DDK), it just
increments a number, edited here brevity:

NTSTATUS
SerialCreateDevObj(IN PDRIVER_OBJECT DriverObject,
OUT PDEVICE_OBJECT *NewDeviceObject)
{
static ULONG currentInstance = 0;

RtlIntegerToUnicodeString(currentInstance++, 10, &instanceStr);
RtlAppendUnicodeStringToString(&deviceObjName, &instanceStr);

status = IoCreateDevice(DriverObject,
sizeof(SERIAL_DEVICE_EXTENSION),
&deviceObjName, FILE_DEVICE_SERIAL_PORT,
FILE_DEVICE_SECURE_OPEN, TRUE,
&deviceObject);

D

This posting is provided “AS IS” with no warranties, and confers no
rights.
-----Original Message-----
From: Seshagiri_Babu [mailto:xxxxx@Satyam.com]
Sent: Sunday, July 07, 2002 9:44 PM
To: NT Developers Interest List
Subject: [ntdev] COM Port Device names

Dear All,
Is it necessary that whatever the driver which is enumearating
serial ports name the Symbolic Links the following way:

COMn----> //Device//Serial(n-1)
**********************************************************************

This email (including any attachments) is intended for the sole use of
the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
or
distribution or forwarding of any or all of the contents in this message
is
STRICTLY PROHIBITED. If you are not the intended recipient, please
contact
the sender by email and delete all copies; your cooperation in this
regard
is appreciated.
**********************************************************************



You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@connecttech.com
To unsubscribe send a blank email to %%email.unsub%%

If you are creating your own serial.sys replacement and want to create
your own devices objects with the name \device\serial, just start
creating them in a loop, incrementing until you receive NT_SUCCESS
from IoCreateDevice. If you want to enumerate these values, you can
look in HKLM\hardware\devicemap\SERIALCOMM, but any serial like driver
will add its own values there as well (adding values to this key is
optional, so not all drivers may do it).

d

-----Original Message-----
From: Chris Dore [mailto:xxxxx@connecttech.com]
Sent: Monday, July 08, 2002 6:51 AM
To: NT Developers Interest List
Subject: [ntdev] RE: COM Port Device names

It would seem that anyone not replacing the std serial driver MUST use
different names than \device\serial. Because you do not know what
serial.sys is going to use for the 's (unless you really want to
determine this with your driver…I’ll pass, it’s just extra work) it is
possible that you will run into naming conflicts.

Is there an EASY way to get the list of named serial devices?

…Chris

P.S. SerialDoExternalNaming is where all the links/etc get created.

----- Original Message -----
From: “Doron Holan”
To: “NT Developers Interest List”
Sent: Monday, July 08, 2002 1:06 AM
Subject: [ntdev] RE: COM Port Device names

Nope, not at all. Drivers other then serial can name their device
whatever they want, like \Device\RocketPort. Also, serial doesn’t
always follow this convention; if you disable then enable a serial.sys
controlled com port, the COM name will stay the same, but the device
name will be \Device\Serial. Also, this can change based
on PNP start order.

If you look at serial’s source code (it’s in the DDK), it just
increments a number, edited here brevity:

NTSTATUS
SerialCreateDevObj(IN PDRIVER_OBJECT DriverObject,
OUT PDEVICE_OBJECT *NewDeviceObject)
{
static ULONG currentInstance = 0;

RtlIntegerToUnicodeString(currentInstance++, 10, &instanceStr);
RtlAppendUnicodeStringToString(&deviceObjName, &instanceStr);

status = IoCreateDevice(DriverObject,
sizeof(SERIAL_DEVICE_EXTENSION),
&deviceObjName, FILE_DEVICE_SERIAL_PORT,
FILE_DEVICE_SECURE_OPEN, TRUE,
&deviceObject);

D

This posting is provided “AS IS” with no warranties, and confers no
rights.
-----Original Message-----
From: Seshagiri_Babu [mailto:xxxxx@Satyam.com]
Sent: Sunday, July 07, 2002 9:44 PM
To: NT Developers Interest List
Subject: [ntdev] COM Port Device names

Dear All,
Is it necessary that whatever the driver which is enumearating
serial ports name the Symbolic Links the following way:

COMn----> //Device//Serial(n-1)
**********************************************************************

This email (including any attachments) is intended for the sole use of
the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
or
distribution or forwarding of any or all of the contents in this message
is
STRICTLY PROHIBITED. If you are not the intended recipient, please
contact
the sender by email and delete all copies; your cooperation in this
regard
is appreciated.
**********************************************************************



You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@connecttech.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%