Need to change the display name of comport in device manager

We have created a virtual com port, its working fine. Now we have required to change the friendly name of com port. We have created the symbolic name of com port using the desire com port number. We able to connect the com port through serial application but only problem is that not showing desire com port number in device manager.

We have tried the below codes before creating the symbolic name but it is also not changing the friendly name.

status = IoSetDevicePropertyData(
pdx,
&PKEY_DeviceInterface_FriendlyName,
LOCALE_NEUTRAL,
PLUGPLAY_PROPERTY_PERSISTENT,
DEVPROP_TYPE_STRING,
sizeof(WCHAR)* ChangeFriendlyName.Length,
ChangeFriendlyName.Buffer);

Getting status success.

please do the needful.

We have created a virtual com port. It is working fine. now we have required to change the friendly name of com port from the driver code. We have created symbolic name with desire com port number its working fine but problem is that in device manager not showing the desire com port number.

We are using the below code to change the friendly name but its not able to change. Please do the need full and please guide us.

status = IoSetDevicePropertyData(
pdx,
&DEVPKEY_Device_FriendlyName,
LOCALE_NEUTRAL,
PLUGPLAY_PROPERTY_PERSISTENT,
DEVPROP_TYPE_STRING,
sizeof(WCHAR)* ChangeFriendlyName.Length,
ChangeFriendlyName.Buffer);

Hello, sorry but I don’t know how to fix your problem. But please, could you try to help me to solve my issue?

I’m working on a Virtual Serial port driver too. I started from “Virtual serial driver sample” of “windows-driver-kit-81-cpp.zip” merged with latest WDK 10 update.

My problem is that provided example is no working correctly with some serial terminal programs. For example Tera Term is no compatible with example (Tera Term is no able to open correctly created virtual serial port).

With Microsoft WDK support I investigate the problem and found that issue is in “queue.cpp” file; “OnDeviceIoControl” funct; “case IOCTL_SERIAL_WAIT_ON_MASK” management.

Questions:

  • have you ever try your driver with Tera Term terminal? it’s working?
  • from which example of WDK do you start to develop?

Thank you

Hello lifeislovelyjourney,

on what Windows version did you test IoSetDevicePropertyData? I experienced
that changing the friendly name is not possible for Windows 7 and earlier
versions.

This issue is NOT documented in MSDN: “IoSetDevicePropertyData” (
https://msdn.microsoft.com/en-us/library/windows/hardware/ff549704(v=vs.85).aspx?f=255&MSPPError=-2147217396
).

But in the MSDN documentation for
“IWDFUnifiedPropertyStore::SetPropertyData” it states: “The driver can
modify device interface property data only starting with Windows 8.”
According to the documentation it also should return HRESULT_FROM_WIN32
(STATUS_NOT_SUPPORTED) for this case, Unfortunately this is not true.
“SetPropertyData”
will not return an error code although device name could not be changed in
Windows 7 and earlier.

Greetings,
Armin

2017-04-20 8:49 GMT+02:00 :

> Hello, sorry but I don’t know how to fix your problem. But please, could
> you try to help me to solve my issue?
>
> I’m working on a Virtual Serial port driver too. I started from “Virtual
> serial driver sample” of “windows-driver-kit-81-cpp.zip” merged with
> latest WDK 10 update.
>
> My problem is that provided example is no working correctly with some
> serial terminal programs. For example Tera Term is no compatible with
> example (Tera Term is no able to open correctly created virtual serial
> port).
>
> With Microsoft WDK support I investigate the problem and found that issue
> is in “queue.cpp” file; “OnDeviceIoControl” funct; “case
> IOCTL_SERIAL_WAIT_ON_MASK” management.
>
> Questions:
> - have you ever try your driver with Tera Term terminal? it’s working?
> - from which example of WDK do you start to develop?
>
> Thank you
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:> showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:></http:>

Thanks Johnny Dakovo for reply.

So there is any another way to change the com port number as per the user choice.Our requirement is to create an user defined com port.

When i have tested on windows 10 then getting an issues.
IoSetDevicePropertyData —>> 0xc000000d

0xc000000d means STATUS_INVALID_PARAMETER. This means one or more of your
provided parameters to IoSetDevicePropertyData are invalid. What type
is “ChangeFriendlyName.Buffer”?
It has to be WCHAR not CHAR.

2017-04-20 13:44 GMT+02:00 :

> When i have tested on windows 10 then getting an issues.
> IoSetDevicePropertyData —>> 0xc000000d
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:> showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:></http:>

0xc000000d means STATUS_INVALID_PARAMETER. This means one or more of your
provided parameters to IoSetDevicePropertyData are invalid. What type
is “ChangeFriendlyName.Buffer”?
It has to be WCHAR not CHAR.

Yes it is WCHAR*. right now I am using the hard coded string.

DECLARE_UNICODE_STRING_SIZE(ChangeFriendlyName, 68);

RtlInitUnicodeString(&ChangeFriendlyName, L"Communications Ports COM15");