serial port link in driver

Hi all,

I want to ask one question: if I will add a peace of code to AddDevice function,

UNICODE_STRING strDevice, strCOMx;

RtlInitUnicodeString(&strCOMx, L\??\COMx);
RtlInitUnicodeString(&strDevice, L\Device\MySerialPort0\COMx);
IoCreateSymbolicLink(&strCOMx, &strDevice);

will I be able to use CreateFile function in user application to get access to COMx?

Thank you,
Andrey

Yes, but you don’t need the COMx at the end of your device name unless
you are exposing multiple COM port names, see
http://blogs.msdn.com/doronh/archive/2006/08/23/715612.aspx … heh,
looking at the post and your code below, it looks like you copied it
pretty much verbatim :wink:

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey
Kamchatnikov
Sent: Monday, June 11, 2007 8:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] serial port link in driver

Hi all,

I want to ask one question: if I will add a peace of code to AddDevice
function,

UNICODE_STRING strDevice, strCOMx;

RtlInitUnicodeString(&strCOMx, L\??\COMx <file:> );
RtlInitUnicodeString(&strDevice, L\Device\MySerialPort0\COMx
<file:> );
IoCreateSymbolicLink(&strCOMx, &strDevice);

will I be able to use CreateFile function in user application to get
access to COMx?

Thank you,

Andrey


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</file:></file:>