![]() |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Guest
Posts: n/a
|
Re: Virtual COM port with UMDF
good find!
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. "Andre" <> wrote in message news:... >I found that the device type can be specified during installation. So by > adding > > [MyComPort_Install.NT.hw] > AddReg=TcEL60xx_RegistryAdd > > [MyComPort_RegistryAdd] > HKR,,DeviceType,0x10001,0x0000001b > > to the *.inf file, the device type is set to FILE_DEVICE_SERIAL_PORT. > Afterwards, the GetFileType() delivers a 0x02, i.e. FILE_TYPE_CHAR. The > .NET > component SerialPort can now open my virtual com port. > > Thanks for your help. > Regards, > Andre > > > "Doron Holan [MSFT]" wrote: > >> it looks like UMDF does not allow you to set the device type for the >> device >> you are creating so i don't think that it is possible to write a serial >> port >> driver that works with all applications >> >> 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. >> >> >> "Andre" <> wrote in message >> news:... >> > Thanks for this hint. Actually I found why SerialPort does not like my >> > virtual com port. >> > >> > It requests the file type using GetFileType() and accepts only 0 and 2, >> > i.e >> > FILE_TYPE_CHAR or FILE_TYPE_UNKNOWN. >> > >> > However, if I create a file handle as follows: >> > >> > HANDLE hFile = CreateFile(L"COM3", GENERIC_READ | GENERIC_WRITE, 0, >> > NULL, >> > OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); >> > >> > The file type returned by GetFileType() is 1, i.e. FILE_TYPE_DISK. So >> > how >> > can I configure, that my device creates files of with type >> > FILE_TYPE_CHAR? >> > >> > BTW, I already handle the OnCreateFile event but I found nothing in the >> > documentation about how to return a certain file type from the >> > OnCreateFile >> > method. >> > >> > >> > >> > "Doron Holan [MSFT]" wrote: >> > >> >> the name of the device object itself shouldn't matter. there are many >> >> disasm tools for the .net framework which will show you the IDL or the >> >> source code. you can use one of these tools to see why the component >> >> is >> >> failing. >> >> >> >> 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. >> >> >> >> >> >> "Andre" <> wrote in message >> >> news:... >> >> > What about my question? Is >> >> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f" actually >> >> > the >> >> > device >> >> > name which must be used in the serialcomm registry key. In the book >> >> > "Developing Drivers with WDF" (P. Orwick, G. Smith) p. 145 it >> >> > mentions >> >> > that >> >> > this is the "Name of the Down device" which cannot be used by >> >> > "clients". >> >> > This >> >> > suggests to me, that there could be another name which must be used >> >> > in >> >> > the >> >> > registry at [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]. >> >> > >> >> > I would like to debug into the SerialPort component of .NET, but at >> >> > the >> >> > point of the error the source code is not available to me. >> >> > Therefore, I >> >> > have >> >> > very little chance to see why it fails. >> >> > >> >> > >> >> > >> >> > >> >> > "Doron Holan [MSFT]" wrote: >> >> > >> >> >> You would have to debug the application at this point. >> >> >> >> >> >> 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. >> >> >> >> >> >> >> >> >> "Andre" <> wrote in message >> >> >> news:... >> >> >> > Hi, >> >> >> > >> >> >> > now I have included the steps you recommended. I am using the >> >> >> > PortName >> >> >> > assigned by the ports class installer as symbolic link, which >> >> >> > works >> >> >> > fine. >> >> >> > To >> >> >> > create the device name mapping I obtain the device name with >> >> >> > method >> >> >> > IWDFDevice::RetrieveDeviceName() and use the result which leads >> >> >> > to >> >> >> > the >> >> >> > following additional serial comm device name mappings in the >> >> >> > registry >> >> >> > >> >> >> > [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM] >> >> >> > ... >> >> >> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f"="COM3" >> >> >> > >> >> >> > However, still the .NET application is not able to open this >> >> >> > virtual >> >> >> > com >> >> >> > port. Again I got the error message described in the original >> >> >> > post. >> >> >> > Is there anything wrong with the device name? Must I retrieve it >> >> >> > somewhere >> >> >> > else? >> >> >> > >> >> >> > Regards, >> >> >> > Andre >> >> >> > >> >> >> > >> >> >> > "Doron Holan [MSFT]" wrote: >> >> >> > >> >> >> >> you need to write the port name to >> >> >> >> HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. >> >> >> >> the >> >> >> >> KMDF or WDM serial sample shows you how to do this. >> >> >> >> unfortunately, >> >> >> >> a >> >> >> >> UMDF >> >> >> >> driver cannot write to this key so that it is not possible >> >> >> >> without >> >> >> >> external >> >> >> >> help (either you modify the ACL of the key which is bad or you >> >> >> >> have >> >> >> >> some >> >> >> >> other comnponent with sufficient privleges to write to the key). >> >> >> >> >> >> >> >> furthermore, install your device under the ports class and use >> >> >> >> the >> >> >> >> PortName >> >> >> >> assigned to your driver instead of a hardcoded name (COM9). You >> >> >> >> will >> >> >> >> find >> >> >> >> the PortName in the device node under a registry value of >> >> >> >> "PortName" : >> >> >> >> REG_SZ. >> >> >> >> >> >> >> >> 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. >> >> >> >> >> >> >> >> >> >> >> >> "Andre" <> wrote in message >> >> >> >> news:... >> >> >> >> > Hello, >> >> >> >> > >> >> >> >> > I have created a UMDF driver, which creates a virtual serial >> >> >> >> > com >> >> >> >> > port >> >> >> >> > in >> >> >> >> > three steps: >> >> >> >> > m_FxDevice->CreateDeviceInterface(&GUID_DEVINTERFACE_COMPORT, NULL); >> >> >> >> > m_FxDevice->CreateSymbolicLink(L"\\DosDevices\\Global\\COM9") ; >> >> >> >> > m_FxDevice->AssignDeviceInterfaceState(&GUID_DEVINTERFACE_COM PORT,NULL,TRUE); >> >> >> >> > >> >> >> >> > I want to test this com port with a .NET application using the >> >> >> >> > SerialPort >> >> >> >> > component to access my driver. However, the GetPortNames() >> >> >> >> > method >> >> >> >> > does >> >> >> >> > not >> >> >> >> > find this serial port. Also, if I explicitly specify COM9 as >> >> >> >> > port >> >> >> >> > name >> >> >> >> > then >> >> >> >> > the component fails to open the port and throws an exception, >> >> >> >> > stating >> >> >> >> > that >> >> >> >> > "the given port name does not start with COM/com or does not >> >> >> >> > resolve >> >> >> >> > to >> >> >> >> > a >> >> >> >> > valid serial port. Parameter: portName" >> >> >> >> > >> >> >> >> > Must the driver take any additional steps to create a complete >> >> >> >> > virtual >> >> >> >> > serial port? >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> |
|
|
|
#12 |
|
Guest
Posts: n/a
|
Re: Virtual COM port with UMDF
Hi,
now I have included the steps you recommended. I am using the PortName assigned by the ports class installer as symbolic link, which works fine. To create the device name mapping I obtain the device name with method IWDFDevice::RetrieveDeviceName() and use the result which leads to the following additional serial comm device name mappings in the registry [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM] .... "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f"="COM3" However, still the .NET application is not able to open this virtual com port. Again I got the error message described in the original post. Is there anything wrong with the device name? Must I retrieve it somewhere else? Regards, Andre "Doron Holan [MSFT]" wrote: > you need to write the port name to HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. the > KMDF or WDM serial sample shows you how to do this. unfortunately, a UMDF > driver cannot write to this key so that it is not possible without external > help (either you modify the ACL of the key which is bad or you have some > other comnponent with sufficient privleges to write to the key). > > furthermore, install your device under the ports class and use the PortName > assigned to your driver instead of a hardcoded name (COM9). You will find > the PortName in the device node under a registry value of "PortName" : > REG_SZ. > > 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. > > > "Andre" <> wrote in message > news:... > > Hello, > > > > I have created a UMDF driver, which creates a virtual serial com port in > > three steps: > > m_FxDevice->CreateDeviceInterface(&GUID_DEVINTERFACE_COMPORT, NULL); > > m_FxDevice->CreateSymbolicLink(L"\\DosDevices\\Global\\COM9") ; > > m_FxDevice->AssignDeviceInterfaceState(&GUID_DEVINTERFACE_COM PORT,NULL,TRUE); > > > > I want to test this com port with a .NET application using the SerialPort > > component to access my driver. However, the GetPortNames() method does not > > find this serial port. Also, if I explicitly specify COM9 as port name > > then > > the component fails to open the port and throws an exception, stating that > > "the given port name does not start with COM/com or does not resolve to a > > valid serial port. Parameter: portName" > > > > Must the driver take any additional steps to create a complete virtual > > serial port? > > > > |
|
|
|
#13 |
|
Guest
Posts: n/a
|
Re: Virtual COM port with UMDF
You would have to debug the application at this point.
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. "Andre" <> wrote in message news:... > Hi, > > now I have included the steps you recommended. I am using the PortName > assigned by the ports class installer as symbolic link, which works fine. > To > create the device name mapping I obtain the device name with method > IWDFDevice::RetrieveDeviceName() and use the result which leads to the > following additional serial comm device name mappings in the registry > > [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM] > ... > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f"="COM3" > > However, still the .NET application is not able to open this virtual com > port. Again I got the error message described in the original post. > Is there anything wrong with the device name? Must I retrieve it somewhere > else? > > Regards, > Andre > > > "Doron Holan [MSFT]" wrote: > >> you need to write the port name to HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. >> the >> KMDF or WDM serial sample shows you how to do this. unfortunately, a >> UMDF >> driver cannot write to this key so that it is not possible without >> external >> help (either you modify the ACL of the key which is bad or you have some >> other comnponent with sufficient privleges to write to the key). >> >> furthermore, install your device under the ports class and use the >> PortName >> assigned to your driver instead of a hardcoded name (COM9). You will >> find >> the PortName in the device node under a registry value of "PortName" : >> REG_SZ. >> >> 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. >> >> >> "Andre" <> wrote in message >> news:... >> > Hello, >> > >> > I have created a UMDF driver, which creates a virtual serial com port >> > in >> > three steps: >> > m_FxDevice->CreateDeviceInterface(&GUID_DEVINTERFACE_COMPORT, NULL); >> > m_FxDevice->CreateSymbolicLink(L"\\DosDevices\\Global\\COM9") ; >> > m_FxDevice->AssignDeviceInterfaceState(&GUID_DEVINTERFACE_COM PORT,NULL,TRUE); >> > >> > I want to test this com port with a .NET application using the >> > SerialPort >> > component to access my driver. However, the GetPortNames() method does >> > not >> > find this serial port. Also, if I explicitly specify COM9 as port name >> > then >> > the component fails to open the port and throws an exception, stating >> > that >> > "the given port name does not start with COM/com or does not resolve to >> > a >> > valid serial port. Parameter: portName" >> > >> > Must the driver take any additional steps to create a complete virtual >> > serial port? >> > >> >> |
|
|
|
#14 |
|
Guest
Posts: n/a
|
Re: Virtual COM port with UMDF
What about my question? Is
"\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f" actually the device name which must be used in the serialcomm registry key. In the book "Developing Drivers with WDF" (P. Orwick, G. Smith) p. 145 it mentions that this is the "Name of the Down device" which cannot be used by "clients". This suggests to me, that there could be another name which must be used in the registry at [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]. I would like to debug into the SerialPort component of .NET, but at the point of the error the source code is not available to me. Therefore, I have very little chance to see why it fails. "Doron Holan [MSFT]" wrote: > You would have to debug the application at this point. > > 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. > > > "Andre" <> wrote in message > news:... > > Hi, > > > > now I have included the steps you recommended. I am using the PortName > > assigned by the ports class installer as symbolic link, which works fine. > > To > > create the device name mapping I obtain the device name with method > > IWDFDevice::RetrieveDeviceName() and use the result which leads to the > > following additional serial comm device name mappings in the registry > > > > [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM] > > ... > > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f"="COM3" > > > > However, still the .NET application is not able to open this virtual com > > port. Again I got the error message described in the original post. > > Is there anything wrong with the device name? Must I retrieve it somewhere > > else? > > > > Regards, > > Andre > > > > > > "Doron Holan [MSFT]" wrote: > > > >> you need to write the port name to HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. > >> the > >> KMDF or WDM serial sample shows you how to do this. unfortunately, a > >> UMDF > >> driver cannot write to this key so that it is not possible without > >> external > >> help (either you modify the ACL of the key which is bad or you have some > >> other comnponent with sufficient privleges to write to the key). > >> > >> furthermore, install your device under the ports class and use the > >> PortName > >> assigned to your driver instead of a hardcoded name (COM9). You will > >> find > >> the PortName in the device node under a registry value of "PortName" : > >> REG_SZ. > >> > >> 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. > >> > >> > >> "Andre" <> wrote in message > >> news:... > >> > Hello, > >> > > >> > I have created a UMDF driver, which creates a virtual serial com port > >> > in > >> > three steps: > >> > m_FxDevice->CreateDeviceInterface(&GUID_DEVINTERFACE_COMPORT, NULL); > >> > m_FxDevice->CreateSymbolicLink(L"\\DosDevices\\Global\\COM9") ; > >> > m_FxDevice->AssignDeviceInterfaceState(&GUID_DEVINTERFACE_COM PORT,NULL,TRUE); > >> > > >> > I want to test this com port with a .NET application using the > >> > SerialPort > >> > component to access my driver. However, the GetPortNames() method does > >> > not > >> > find this serial port. Also, if I explicitly specify COM9 as port name > >> > then > >> > the component fails to open the port and throws an exception, stating > >> > that > >> > "the given port name does not start with COM/com or does not resolve to > >> > a > >> > valid serial port. Parameter: portName" > >> > > >> > Must the driver take any additional steps to create a complete virtual > >> > serial port? > >> > > >> > >> > > |
|
|
|
#15 |
|
Guest
Posts: n/a
|
Re: Virtual COM port with UMDF
the name of the device object itself shouldn't matter. there are many
disasm tools for the .net framework which will show you the IDL or the source code. you can use one of these tools to see why the component is failing. 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. "Andre" <> wrote in message news:... > What about my question? Is > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f" actually the > device > name which must be used in the serialcomm registry key. In the book > "Developing Drivers with WDF" (P. Orwick, G. Smith) p. 145 it mentions > that > this is the "Name of the Down device" which cannot be used by "clients". > This > suggests to me, that there could be another name which must be used in the > registry at [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]. > > I would like to debug into the SerialPort component of .NET, but at the > point of the error the source code is not available to me. Therefore, I > have > very little chance to see why it fails. > > > > > "Doron Holan [MSFT]" wrote: > >> You would have to debug the application at this point. >> >> 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. >> >> >> "Andre" <> wrote in message >> news:... >> > Hi, >> > >> > now I have included the steps you recommended. I am using the PortName >> > assigned by the ports class installer as symbolic link, which works >> > fine. >> > To >> > create the device name mapping I obtain the device name with method >> > IWDFDevice::RetrieveDeviceName() and use the result which leads to the >> > following additional serial comm device name mappings in the registry >> > >> > [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM] >> > ... >> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f"="COM3" >> > >> > However, still the .NET application is not able to open this virtual >> > com >> > port. Again I got the error message described in the original post. >> > Is there anything wrong with the device name? Must I retrieve it >> > somewhere >> > else? >> > >> > Regards, >> > Andre >> > >> > >> > "Doron Holan [MSFT]" wrote: >> > >> >> you need to write the port name to HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. >> >> the >> >> KMDF or WDM serial sample shows you how to do this. unfortunately, a >> >> UMDF >> >> driver cannot write to this key so that it is not possible without >> >> external >> >> help (either you modify the ACL of the key which is bad or you have >> >> some >> >> other comnponent with sufficient privleges to write to the key). >> >> >> >> furthermore, install your device under the ports class and use the >> >> PortName >> >> assigned to your driver instead of a hardcoded name (COM9). You will >> >> find >> >> the PortName in the device node under a registry value of "PortName" : >> >> REG_SZ. >> >> >> >> 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. >> >> >> >> >> >> "Andre" <> wrote in message >> >> news:... >> >> > Hello, >> >> > >> >> > I have created a UMDF driver, which creates a virtual serial com >> >> > port >> >> > in >> >> > three steps: >> >> > m_FxDevice->CreateDeviceInterface(&GUID_DEVINTERFACE_COMPORT, NULL); >> >> > m_FxDevice->CreateSymbolicLink(L"\\DosDevices\\Global\\COM9") ; >> >> > m_FxDevice->AssignDeviceInterfaceState(&GUID_DEVINTERFACE_COM PORT,NULL,TRUE); >> >> > >> >> > I want to test this com port with a .NET application using the >> >> > SerialPort >> >> > component to access my driver. However, the GetPortNames() method >> >> > does >> >> > not >> >> > find this serial port. Also, if I explicitly specify COM9 as port >> >> > name >> >> > then >> >> > the component fails to open the port and throws an exception, >> >> > stating >> >> > that >> >> > "the given port name does not start with COM/com or does not resolve >> >> > to >> >> > a >> >> > valid serial port. Parameter: portName" >> >> > >> >> > Must the driver take any additional steps to create a complete >> >> > virtual >> >> > serial port? >> >> > >> >> >> >> >> >> |
|
|
|
#16 |
|
Guest
Posts: n/a
|
Re: Virtual COM port with UMDF
i have used and it works very well for
this 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. "Doron Holan [MSFT]" <> wrote in message news:.gbl... > the name of the device object itself shouldn't matter. there are many > disasm tools for the .net framework which will show you the IDL or the > source code. you can use one of these tools to see why the component is > failing. > > 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. > > > "Andre" <> wrote in message > news:... >> What about my question? Is >> "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f" actually the >> device >> name which must be used in the serialcomm registry key. In the book >> "Developing Drivers with WDF" (P. Orwick, G. Smith) p. 145 it mentions >> that >> this is the "Name of the Down device" which cannot be used by "clients". >> This >> suggests to me, that there could be another name which must be used in >> the >> registry at [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]. >> >> I would like to debug into the SerialPort component of .NET, but at the >> point of the error the source code is not available to me. Therefore, I >> have >> very little chance to see why it fails. >> >> >> >> >> "Doron Holan [MSFT]" wrote: >> >>> You would have to debug the application at this point. >>> >>> 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. >>> >>> >>> "Andre" <> wrote in message >>> news:... >>> > Hi, >>> > >>> > now I have included the steps you recommended. I am using the PortName >>> > assigned by the ports class installer as symbolic link, which works >>> > fine. >>> > To >>> > create the device name mapping I obtain the device name with method >>> > IWDFDevice::RetrieveDeviceName() and use the result which leads to the >>> > following additional serial comm device name mappings in the registry >>> > >>> > [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM] >>> > ... >>> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f"="COM3" >>> > >>> > However, still the .NET application is not able to open this virtual >>> > com >>> > port. Again I got the error message described in the original post. >>> > Is there anything wrong with the device name? Must I retrieve it >>> > somewhere >>> > else? >>> > >>> > Regards, >>> > Andre >>> > >>> > >>> > "Doron Holan [MSFT]" wrote: >>> > >>> >> you need to write the port name to >>> >> HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. >>> >> the >>> >> KMDF or WDM serial sample shows you how to do this. unfortunately, a >>> >> UMDF >>> >> driver cannot write to this key so that it is not possible without >>> >> external >>> >> help (either you modify the ACL of the key which is bad or you have >>> >> some >>> >> other comnponent with sufficient privleges to write to the key). >>> >> >>> >> furthermore, install your device under the ports class and use the >>> >> PortName >>> >> assigned to your driver instead of a hardcoded name (COM9). You will >>> >> find >>> >> the PortName in the device node under a registry value of "PortName" >>> >> : >>> >> REG_SZ. >>> >> >>> >> 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. >>> >> >>> >> >>> >> "Andre" <> wrote in message >>> >> news:... >>> >> > Hello, >>> >> > >>> >> > I have created a UMDF driver, which creates a virtual serial com >>> >> > port >>> >> > in >>> >> > three steps: >>> >> > m_FxDevice->CreateDeviceInterface(&GUID_DEVINTERFACE_COMPORT, NULL); >>> >> > m_FxDevice->CreateSymbolicLink(L"\\DosDevices\\Global\\COM9") ; >>> >> > m_FxDevice->AssignDeviceInterfaceState(&GUID_DEVINTERFACE_COM PORT,NULL,TRUE); >>> >> > >>> >> > I want to test this com port with a .NET application using the >>> >> > SerialPort >>> >> > component to access my driver. However, the GetPortNames() method >>> >> > does >>> >> > not >>> >> > find this serial port. Also, if I explicitly specify COM9 as port >>> >> > name >>> >> > then >>> >> > the component fails to open the port and throws an exception, >>> >> > stating >>> >> > that >>> >> > "the given port name does not start with COM/com or does not >>> >> > resolve to >>> >> > a >>> >> > valid serial port. Parameter: portName" >>> >> > >>> >> > Must the driver take any additional steps to create a complete >>> >> > virtual >>> >> > serial port? >>> >> > >>> >> >>> >> >>> >>> > |
|
|
|
#17 |
|
Guest
Posts: n/a
|
Re: Virtual COM port with UMDF
Thanks for this hint. Actually I found why SerialPort does not like my
virtual com port. It requests the file type using GetFileType() and accepts only 0 and 2, i.e FILE_TYPE_CHAR or FILE_TYPE_UNKNOWN. However, if I create a file handle as follows: HANDLE hFile = CreateFile(L"COM3", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); The file type returned by GetFileType() is 1, i.e. FILE_TYPE_DISK. So how can I configure, that my device creates files of with type FILE_TYPE_CHAR? BTW, I already handle the OnCreateFile event but I found nothing in the documentation about how to return a certain file type from the OnCreateFile method. "Doron Holan [MSFT]" wrote: > the name of the device object itself shouldn't matter. there are many > disasm tools for the .net framework which will show you the IDL or the > source code. you can use one of these tools to see why the component is > failing. > > 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. > > > "Andre" <> wrote in message > news:... > > What about my question? Is > > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f" actually the > > device > > name which must be used in the serialcomm registry key. In the book > > "Developing Drivers with WDF" (P. Orwick, G. Smith) p. 145 it mentions > > that > > this is the "Name of the Down device" which cannot be used by "clients". > > This > > suggests to me, that there could be another name which must be used in the > > registry at [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]. > > > > I would like to debug into the SerialPort component of .NET, but at the > > point of the error the source code is not available to me. Therefore, I > > have > > very little chance to see why it fails. > > > > > > > > > > "Doron Holan [MSFT]" wrote: > > > >> You would have to debug the application at this point. > >> > >> 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. > >> > >> > >> "Andre" <> wrote in message > >> news:... > >> > Hi, > >> > > >> > now I have included the steps you recommended. I am using the PortName > >> > assigned by the ports class installer as symbolic link, which works > >> > fine. > >> > To > >> > create the device name mapping I obtain the device name with method > >> > IWDFDevice::RetrieveDeviceName() and use the result which leads to the > >> > following additional serial comm device name mappings in the registry > >> > > >> > [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM] > >> > ... > >> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f"="COM3" > >> > > >> > However, still the .NET application is not able to open this virtual > >> > com > >> > port. Again I got the error message described in the original post. > >> > Is there anything wrong with the device name? Must I retrieve it > >> > somewhere > >> > else? > >> > > >> > Regards, > >> > Andre > >> > > >> > > >> > "Doron Holan [MSFT]" wrote: > >> > > >> >> you need to write the port name to HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. > >> >> the > >> >> KMDF or WDM serial sample shows you how to do this. unfortunately, a > >> >> UMDF > >> >> driver cannot write to this key so that it is not possible without > >> >> external > >> >> help (either you modify the ACL of the key which is bad or you have > >> >> some > >> >> other comnponent with sufficient privleges to write to the key). > >> >> > >> >> furthermore, install your device under the ports class and use the > >> >> PortName > >> >> assigned to your driver instead of a hardcoded name (COM9). You will > >> >> find > >> >> the PortName in the device node under a registry value of "PortName" : > >> >> REG_SZ. > >> >> > >> >> 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. > >> >> > >> >> > >> >> "Andre" <> wrote in message > >> >> news:... > >> >> > Hello, > >> >> > > >> >> > I have created a UMDF driver, which creates a virtual serial com > >> >> > port > >> >> > in > >> >> > three steps: > >> >> > m_FxDevice->CreateDeviceInterface(&GUID_DEVINTERFACE_COMPORT, NULL); > >> >> > m_FxDevice->CreateSymbolicLink(L"\\DosDevices\\Global\\COM9") ; > >> >> > m_FxDevice->AssignDeviceInterfaceState(&GUID_DEVINTERFACE_COM PORT,NULL,TRUE); > >> >> > > >> >> > I want to test this com port with a .NET application using the > >> >> > SerialPort > >> >> > component to access my driver. However, the GetPortNames() method > >> >> > does > >> >> > not > >> >> > find this serial port. Also, if I explicitly specify COM9 as port > >> >> > name > >> >> > then > >> >> > the component fails to open the port and throws an exception, > >> >> > stating > >> >> > that > >> >> > "the given port name does not start with COM/com or does not resolve > >> >> > to > >> >> > a > >> >> > valid serial port. Parameter: portName" > >> >> > > >> >> > Must the driver take any additional steps to create a complete > >> >> > virtual > >> >> > serial port? > >> >> > > >> >> > >> >> > >> > >> > > |
|
|
|
#18 |
|
Guest
Posts: n/a
|
Re: Virtual COM port with UMDF
it looks like UMDF does not allow you to set the device type for the device
you are creating so i don't think that it is possible to write a serial port driver that works with all applications 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. "Andre" <> wrote in message news:... > Thanks for this hint. Actually I found why SerialPort does not like my > virtual com port. > > It requests the file type using GetFileType() and accepts only 0 and 2, > i.e > FILE_TYPE_CHAR or FILE_TYPE_UNKNOWN. > > However, if I create a file handle as follows: > > HANDLE hFile = CreateFile(L"COM3", GENERIC_READ | GENERIC_WRITE, 0, NULL, > OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); > > The file type returned by GetFileType() is 1, i.e. FILE_TYPE_DISK. So how > can I configure, that my device creates files of with type FILE_TYPE_CHAR? > > BTW, I already handle the OnCreateFile event but I found nothing in the > documentation about how to return a certain file type from the > OnCreateFile > method. > > > > "Doron Holan [MSFT]" wrote: > >> the name of the device object itself shouldn't matter. there are many >> disasm tools for the .net framework which will show you the IDL or the >> source code. you can use one of these tools to see why the component is >> failing. >> >> 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. >> >> >> "Andre" <> wrote in message >> news:... >> > What about my question? Is >> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f" actually the >> > device >> > name which must be used in the serialcomm registry key. In the book >> > "Developing Drivers with WDF" (P. Orwick, G. Smith) p. 145 it mentions >> > that >> > this is the "Name of the Down device" which cannot be used by >> > "clients". >> > This >> > suggests to me, that there could be another name which must be used in >> > the >> > registry at [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]. >> > >> > I would like to debug into the SerialPort component of .NET, but at the >> > point of the error the source code is not available to me. Therefore, I >> > have >> > very little chance to see why it fails. >> > >> > >> > >> > >> > "Doron Holan [MSFT]" wrote: >> > >> >> You would have to debug the application at this point. >> >> >> >> 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. >> >> >> >> >> >> "Andre" <> wrote in message >> >> news:... >> >> > Hi, >> >> > >> >> > now I have included the steps you recommended. I am using the >> >> > PortName >> >> > assigned by the ports class installer as symbolic link, which works >> >> > fine. >> >> > To >> >> > create the device name mapping I obtain the device name with method >> >> > IWDFDevice::RetrieveDeviceName() and use the result which leads to >> >> > the >> >> > following additional serial comm device name mappings in the >> >> > registry >> >> > >> >> > [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM] >> >> > ... >> >> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f"="COM3" >> >> > >> >> > However, still the .NET application is not able to open this virtual >> >> > com >> >> > port. Again I got the error message described in the original post. >> >> > Is there anything wrong with the device name? Must I retrieve it >> >> > somewhere >> >> > else? >> >> > >> >> > Regards, >> >> > Andre >> >> > >> >> > >> >> > "Doron Holan [MSFT]" wrote: >> >> > >> >> >> you need to write the port name to >> >> >> HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. >> >> >> the >> >> >> KMDF or WDM serial sample shows you how to do this. unfortunately, >> >> >> a >> >> >> UMDF >> >> >> driver cannot write to this key so that it is not possible without >> >> >> external >> >> >> help (either you modify the ACL of the key which is bad or you have >> >> >> some >> >> >> other comnponent with sufficient privleges to write to the key). >> >> >> >> >> >> furthermore, install your device under the ports class and use the >> >> >> PortName >> >> >> assigned to your driver instead of a hardcoded name (COM9). You >> >> >> will >> >> >> find >> >> >> the PortName in the device node under a registry value of >> >> >> "PortName" : >> >> >> REG_SZ. >> >> >> >> >> >> 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. >> >> >> >> >> >> >> >> >> "Andre" <> wrote in message >> >> >> news:... >> >> >> > Hello, >> >> >> > >> >> >> > I have created a UMDF driver, which creates a virtual serial com >> >> >> > port >> >> >> > in >> >> >> > three steps: >> >> >> > m_FxDevice->CreateDeviceInterface(&GUID_DEVINTERFACE_COMPORT, NULL); >> >> >> > m_FxDevice->CreateSymbolicLink(L"\\DosDevices\\Global\\COM9") ; >> >> >> > m_FxDevice->AssignDeviceInterfaceState(&GUID_DEVINTERFACE_COM PORT,NULL,TRUE); >> >> >> > >> >> >> > I want to test this com port with a .NET application using the >> >> >> > SerialPort >> >> >> > component to access my driver. However, the GetPortNames() method >> >> >> > does >> >> >> > not >> >> >> > find this serial port. Also, if I explicitly specify COM9 as >> >> >> > port >> >> >> > name >> >> >> > then >> >> >> > the component fails to open the port and throws an exception, >> >> >> > stating >> >> >> > that >> >> >> > "the given port name does not start with COM/com or does not >> >> >> > resolve >> >> >> > to >> >> >> > a >> >> >> > valid serial port. Parameter: portName" >> >> >> > >> >> >> > Must the driver take any additional steps to create a complete >> >> >> > virtual >> >> >> > serial port? >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> |
|
|
|
#19 |
|
Guest
Posts: n/a
|
Re: Virtual COM port with UMDF
I found that the device type can be specified during installation. So by
adding [MyComPort_Install.NT.hw] AddReg=TcEL60xx_RegistryAdd [MyComPort_RegistryAdd] HKR,,DeviceType,0x10001,0x0000001b to the *.inf file, the device type is set to FILE_DEVICE_SERIAL_PORT. Afterwards, the GetFileType() delivers a 0x02, i.e. FILE_TYPE_CHAR. The .NET component SerialPort can now open my virtual com port. Thanks for your help. Regards, Andre "Doron Holan [MSFT]" wrote: > it looks like UMDF does not allow you to set the device type for the device > you are creating so i don't think that it is possible to write a serial port > driver that works with all applications > > 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. > > > "Andre" <> wrote in message > news:... > > Thanks for this hint. Actually I found why SerialPort does not like my > > virtual com port. > > > > It requests the file type using GetFileType() and accepts only 0 and 2, > > i.e > > FILE_TYPE_CHAR or FILE_TYPE_UNKNOWN. > > > > However, if I create a file handle as follows: > > > > HANDLE hFile = CreateFile(L"COM3", GENERIC_READ | GENERIC_WRITE, 0, NULL, > > OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); > > > > The file type returned by GetFileType() is 1, i.e. FILE_TYPE_DISK. So how > > can I configure, that my device creates files of with type FILE_TYPE_CHAR? > > > > BTW, I already handle the OnCreateFile event but I found nothing in the > > documentation about how to return a certain file type from the > > OnCreateFile > > method. > > > > > > > > "Doron Holan [MSFT]" wrote: > > > >> the name of the device object itself shouldn't matter. there are many > >> disasm tools for the .net framework which will show you the IDL or the > >> source code. you can use one of these tools to see why the component is > >> failing. > >> > >> 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. > >> > >> > >> "Andre" <> wrote in message > >> news:... > >> > What about my question? Is > >> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f" actually the > >> > device > >> > name which must be used in the serialcomm registry key. In the book > >> > "Developing Drivers with WDF" (P. Orwick, G. Smith) p. 145 it mentions > >> > that > >> > this is the "Name of the Down device" which cannot be used by > >> > "clients". > >> > This > >> > suggests to me, that there could be another name which must be used in > >> > the > >> > registry at [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]. > >> > > >> > I would like to debug into the SerialPort component of .NET, but at the > >> > point of the error the source code is not available to me. Therefore, I > >> > have > >> > very little chance to see why it fails. > >> > > >> > > >> > > >> > > >> > "Doron Holan [MSFT]" wrote: > >> > > >> >> You would have to debug the application at this point. > >> >> > >> >> 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. > >> >> > >> >> > >> >> "Andre" <> wrote in message > >> >> news:... > >> >> > Hi, > >> >> > > >> >> > now I have included the steps you recommended. I am using the > >> >> > PortName > >> >> > assigned by the ports class installer as symbolic link, which works > >> >> > fine. > >> >> > To > >> >> > create the device name mapping I obtain the device name with method > >> >> > IWDFDevice::RetrieveDeviceName() and use the result which leads to > >> >> > the > >> >> > following additional serial comm device name mappings in the > >> >> > registry > >> >> > > >> >> > [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM] > >> >> > ... > >> >> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f"="COM3" > >> >> > > >> >> > However, still the .NET application is not able to open this virtual > >> >> > com > >> >> > port. Again I got the error message described in the original post. > >> >> > Is there anything wrong with the device name? Must I retrieve it > >> >> > somewhere > >> >> > else? > >> >> > > >> >> > Regards, > >> >> > Andre > >> >> > > >> >> > > >> >> > "Doron Holan [MSFT]" wrote: > >> >> > > >> >> >> you need to write the port name to > >> >> >> HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. > >> >> >> the > >> >> >> KMDF or WDM serial sample shows you how to do this. unfortunately, > >> >> >> a > >> >> >> UMDF > >> >> >> driver cannot write to this key so that it is not possible without > >> >> >> external > >> >> >> help (either you modify the ACL of the key which is bad or you have > >> >> >> some > >> >> >> other comnponent with sufficient privleges to write to the key). > >> >> >> > >> >> >> furthermore, install your device under the ports class and use the > >> >> >> PortName > >> >> >> assigned to your driver instead of a hardcoded name (COM9). You > >> >> >> will > >> >> >> find > >> >> >> the PortName in the device node under a registry value of > >> >> >> "PortName" : > >> >> >> REG_SZ. > >> >> >> > >> >> >> 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. > >> >> >> > >> >> >> > >> >> >> "Andre" <> wrote in message > >> >> >> news:... > >> >> >> > Hello, > >> >> >> > > >> >> >> > I have created a UMDF driver, which creates a virtual serial com > >> >> >> > port > >> >> >> > in > >> >> >> > three steps: > >> >> >> > m_FxDevice->CreateDeviceInterface(&GUID_DEVINTERFACE_COMPORT, NULL); > >> >> >> > m_FxDevice->CreateSymbolicLink(L"\\DosDevices\\Global\\COM9") ; > >> >> >> > m_FxDevice->AssignDeviceInterfaceState(&GUID_DEVINTERFACE_COM PORT,NULL,TRUE); > >> >> >> > > >> >> >> > I want to test this com port with a .NET application using the > >> >> >> > SerialPort > >> >> >> > component to access my driver. However, the GetPortNames() method > >> >> >> > does > >> >> >> > not > >> >> >> > find this serial port. Also, if I explicitly specify COM9 as > >> >> >> > port > >> >> >> > name > >> >> >> > then > >> >> >> > the component fails to open the port and throws an exception, > >> >> >> > stating > >> >> >> > that > >> >> >> > "the given port name does not start with COM/com or does not > >> >> >> > resolve > >> >> >> > to > >> >> >> > a > >> >> >> > valid serial port. Parameter: portName" > >> >> >> > > >> >> >> > Must the driver take any additional steps to create a complete > >> >> >> > virtual > >> >> >> > serial port? > >> >> >> > > >> >> >> > >> >> >> > >> >> > >> >> > >> > >> > > |
|
|
|
#20 |
|
Guest
Posts: n/a
|
Re: Virtual COM port with UMDF
good find!
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. "Andre" <> wrote in message news:... >I found that the device type can be specified during installation. So by > adding > > [MyComPort_Install.NT.hw] > AddReg=TcEL60xx_RegistryAdd > > [MyComPort_RegistryAdd] > HKR,,DeviceType,0x10001,0x0000001b > > to the *.inf file, the device type is set to FILE_DEVICE_SERIAL_PORT. > Afterwards, the GetFileType() delivers a 0x02, i.e. FILE_TYPE_CHAR. The > .NET > component SerialPort can now open my virtual com port. > > Thanks for your help. > Regards, > Andre > > > "Doron Holan [MSFT]" wrote: > >> it looks like UMDF does not allow you to set the device type for the >> device >> you are creating so i don't think that it is possible to write a serial >> port >> driver that works with all applications >> >> 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. >> >> >> "Andre" <> wrote in message >> news:... >> > Thanks for this hint. Actually I found why SerialPort does not like my >> > virtual com port. >> > >> > It requests the file type using GetFileType() and accepts only 0 and 2, >> > i.e >> > FILE_TYPE_CHAR or FILE_TYPE_UNKNOWN. >> > >> > However, if I create a file handle as follows: >> > >> > HANDLE hFile = CreateFile(L"COM3", GENERIC_READ | GENERIC_WRITE, 0, >> > NULL, >> > OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); >> > >> > The file type returned by GetFileType() is 1, i.e. FILE_TYPE_DISK. So >> > how >> > can I configure, that my device creates files of with type >> > FILE_TYPE_CHAR? >> > >> > BTW, I already handle the OnCreateFile event but I found nothing in the >> > documentation about how to return a certain file type from the >> > OnCreateFile >> > method. >> > >> > >> > >> > "Doron Holan [MSFT]" wrote: >> > >> >> the name of the device object itself shouldn't matter. there are many >> >> disasm tools for the .net framework which will show you the IDL or the >> >> source code. you can use one of these tools to see why the component >> >> is >> >> failing. >> >> >> >> 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. >> >> >> >> >> >> "Andre" <> wrote in message >> >> news:... >> >> > What about my question? Is >> >> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f" actually >> >> > the >> >> > device >> >> > name which must be used in the serialcomm registry key. In the book >> >> > "Developing Drivers with WDF" (P. Orwick, G. Smith) p. 145 it >> >> > mentions >> >> > that >> >> > this is the "Name of the Down device" which cannot be used by >> >> > "clients". >> >> > This >> >> > suggests to me, that there could be another name which must be used >> >> > in >> >> > the >> >> > registry at [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]. >> >> > >> >> > I would like to debug into the SerialPort component of .NET, but at >> >> > the >> >> > point of the error the source code is not available to me. >> >> > Therefore, I >> >> > have >> >> > very little chance to see why it fails. >> >> > >> >> > >> >> > >> >> > >> >> > "Doron Holan [MSFT]" wrote: >> >> > >> >> >> You would have to debug the application at this point. >> >> >> >> >> >> 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. >> >> >> >> >> >> >> >> >> "Andre" <> wrote in message >> >> >> news:... >> >> >> > Hi, >> >> >> > >> >> >> > now I have included the steps you recommended. I am using the >> >> >> > PortName >> >> >> > assigned by the ports class installer as symbolic link, which >> >> >> > works >> >> >> > fine. >> >> >> > To >> >> >> > create the device name mapping I obtain the device name with >> >> >> > method >> >> >> > IWDFDevice::RetrieveDeviceName() and use the result which leads >> >> >> > to >> >> >> > the >> >> >> > following additional serial comm device name mappings in the >> >> >> > registry >> >> >> > >> >> >> > [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM] >> >> >> > ... >> >> >> > "\\\\.\\UMDFCtrlDev-e4cbea35-44d3-11dc-9762-0003ffa3650f"="COM3" >> >> >> > >> >> >> > However, still the .NET application is not able to open this >> >> >> > virtual >> >> >> > com >> >> >> > port. Again I got the error message described in the original >> >> >> > post. >> >> >> > Is there anything wrong with the device name? Must I retrieve it >> >> >> > somewhere >> >> >> > else? >> >> >> > >> >> >> > Regards, >> >> >> > Andre >> >> >> > >> >> >> > >> >> >> > "Doron Holan [MSFT]" wrote: >> >> >> > >> >> >> >> you need to write the port name to >> >> >> >> HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. >> >> >> >> the >> >> >> >> KMDF or WDM serial sample shows you how to do this. >> >> >> >> unfortunately, >> >> >> >> a >> >> >> >> UMDF >> >> >> >> driver cannot write to this key so that it is not possible >> >> >> >> without >> >> >> >> external >> >> >> >> help (either you modify the ACL of the key which is bad or you >> >> >> >> have >> >> >> >> some >> >> >> >> other comnponent with sufficient privleges to write to the key). >> >> >> >> >> >> >> >> furthermore, install your device under the ports class and use >> >> >> >> the >> >> >> >> PortName >> >> >> >> assigned to your driver instead of a hardcoded name (COM9). You >> >> >> >> will >> >> >> >> find >> >> >> >> the PortName in the device node under a registry value of >> >> >> >> "PortName" : >> >> >> >> REG_SZ. >> >> >> >> >> >> >> >> 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. >> >> >> >> >> >> >> >> >> >> >> >> "Andre" <> wrote in message >> >> >> >> news:... >> >> >> >> > Hello, >> >> >> >> > >> >> >> >> > I have created a UMDF driver, which creates a virtual serial >> >> >> >> > com >> >> >> >> > port >> >> >> >> > in >> >> >> >> > three steps: >> >> >> >> > m_FxDevice->CreateDeviceInterface(&GUID_DEVINTERFACE_COMPORT, NULL); >> >> >> >> > m_FxDevice->CreateSymbolicLink(L"\\DosDevices\\Global\\COM9") ; >> >> >> >> > m_FxDevice->AssignDeviceInterfaceState(&GUID_DEVINTERFACE_COM PORT,NULL,TRUE); >> >> >> >> > >> >> >> >> > I want to test this com port with a .NET application using the >> >> >> >> > SerialPort >> >> >> >> > component to access my driver. However, the GetPortNames() >> >> >> >> > method >> >> >> >> > does >> >> >> >> > not >> >> >> >> > find this serial port. Also, if I explicitly specify COM9 as >> >> >> >> > port >> >> >> >> > name >> >> >> >> > then >> >> >> >> > the component fails to open the port and throws an exception, >> >> >> >> > stating >> >> >> >> > that >> >> >> >> > "the given port name does not start with COM/com or does not >> >> >> >> > resolve >> >> >> >> > to >> >> >> >> > a >> >> >> >> > valid serial port. Parameter: portName" >> >> >> >> > >> >> >> >> > Must the driver take any additional steps to create a complete >> >> >> >> > virtual >> >> >> >> > serial port? >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
< Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |