Issues and bugs in VSP AX(Read 7788 times)
Issues and bugs in VSP AX on: December 21, 2009, 03:18:06 PM
I used Virtual Serial Port ActiveX Control in a project and found
the following bugs/issues.

- ResetBus may not remove existing unused ports.

- EnumVirtualPort should not return S_OK if the specified port number is out
  of range. You should document whether arguments are zero-based or one-based.

- CreatePort succeeds even if a hardware port with the same name already exists.

- It should be possible to set the access mask before creating the port.
  Otherwise any application may access the port after CreatePort just
  before the access mask can be set.

- Registration should not require a restart of the application.
  CreateInstanceLic should succeed if called again after registration.
  You should also provide a method to register the component from code.
  This makes it possible to provide a custom (localized) UI.

- You should provide a merge module for Microsoft Installer packages.
  This would save customers that create MSI setups a lot of time.
  I had to write and test custom actions that install the driver for the
  supported platforms.
  vspdxp_install.exe is useless because it does not wait until
  vsbsetup.exe returns.
  The MSI setup may continue while the driver is still being installed
  or uninstalled. This will prevent removing the driver files during
  uninstallation.
  Simply calling vsbsetup.exe does not work because this program seems to
  expect that the current directory is the directory where vsbsetup.exe
  is located. I had to write my own custom action exe which starts a new
  process for vsbsetup.exe with the correct current directory and then waits
  until vsbsetup.exe returns. The custom action also prevents that vsbsetup.exe
  displays an ugly console window (you should have used /SUBSYSTEM:WINDOWS).
  http://blogs.msdn.com/heaths/archive/2006/01/23/516455.aspx

- The Write and Read method do not work if called from an MTA
  (Multithreaded Apartment). The IDL for the 2 methods is simply wrong.
  It should be declared similar to ISequentialStream::Read, ISequentialStream::Write.

  HRESULT Read(
     [out, size_is(cb), length_is(*pcbRead)] void *pv,
        [in] ULONG cb,
        [out] ULONG *pcbRead);

  ReadArray and WriteArray will work from an MTA.
  Eventually I switched my application to STA because your
  control does not seem to work reliable if used from an MTA.



Re: Issues and bugs in VSP AX Reply #1 on: December 22, 2009, 02:35:36 PM
Hello,

Please see the comments below:

Quote
- ResetBus may not remove existing unused ports.

I kindly ask you to provide us with the detailed instructions on how this problem can be reproduced. Please note that ResetBus will not remove the ports if at least one port is opened.

Quote
- EnumVirtualPort should not return S_OK if the specified port number is
out of range. You should document whether  arguments are zero-based or
one-based.

Please, be informed that if port number is out of range, Virtual Serial Port ActiveX Control returns empty string. The numbering starts at 0.

Quote
- It should be possible to set the access mask before creating the port.
Otherwise any application may access the port after CreatePort just
before the access mask can be set.

I regret to say, that it is impossible to set the access mask before creating the port, in the current version of Virtual Serial Port ActiveX Control. We will take into account your suggestion.

Quote
- Registration should not require a restart of the application.
CreateInstanceLic should succeed if called again after registration.

Our software protection mechanism does not allow to execute registration without application restart. We will fix the issue in one of the future releases of the product.

Quote
- You should also provide a method to register the component from code.
This makes it possible to provide a custom (localized) UI

We will implement the option which allows to register the component from code. Please, be informed that Quiet registration is available for OEM license owners. To know more about Quiet registration, please follow the link: http://wiki.eltima.com/user-guides/vsp-ax/installation.html

Quote
- You should provide a merge module for Microsoft Installer packages.
This would save customers that create MSI setups a lot of time

We will take into account your suggestion. What installer you are using?

Quote
- vspdxp_install.exe is useless because it does not wait until
vsbsetup.exe returns.

We will be glad to send you new build of Virtual Serial Port ActiveX Control. The problem you described is already fixed in the latest build of the product.

Quote
- Simply calling vsbsetup.exe does not work because this program seems
to expect that the current directory is the directory where vsbsetup.exe
is located.

Unfortunately, our testers were unable to reproduce the problem. What they did is:

1) Put NT5 folder to C:\
2) Open C:\from the console and type: NT5\vsbsetup
3) The drivers are not installed, because working directory is C:\(not C:\NT5)

It is necessary to set the Working directory correctly.

Quote
- The custom action also prevents that vsbsetup.exe displays an ugly
console window (you should have used /SUBSYSTEM:WINDOWS).

Most installers allow you to hide the windows. You can use NO_SHOW option.

Quote
- The Write and Read method do not work if called from an MTA
(Multithreaded Apartment). The IDL for the 2 methods is simply wrong.
It should be declared similar to ISequentialStream::Read,
ISequentialStream::Write.

HRESULT Read(
[out, size_is(cb), length_is(*pcbRead)] void *pv,
[in] ULONG cb,
[out] ULONG *pcbRead);

ReadArray and WriteArray will work from an MTA.
Eventually I switched my application to STA because your
control does not seem to work reliable if used from an MTA.

What is your development environment? Please be informed that some IDEs do not allow you to work with pointers.
« Last Edit: December 22, 2009, 02:39:54 PM by Tina »



Re: Issues and bugs in VSP AX Reply #2 on: December 22, 2009, 08:13:06 PM
Quote
I kindly ask you to provide us with the detailed instructions on how this problem can be reproduced. Please note that ResetBus will not remove the ports if at least one port is opened.

I am not sure what caused the problem. I had the problem at least once. There were two virtual ports which could not be deleted with ResetBus. Using Attach and Delete I could remove one of the two ports. The other one was removed after a restart of the machine.
Let's say there are 10 ports when I call ResetBus. The first port that ResetBus tries to delete is still opened by an application. Does ResetBus simply fail and does not remove any of the 10 ports even though the other 9 are not in use?
How does the ResetBus.exe utility work? I think it does delete all of the existing unused ports.


Quote
Please, be informed that if port number is out of range, Virtual Serial Port ActiveX Control returns empty string. The numbering starts at 0.

This is not really a problem, but I think the returned HRESULT should be used for this. I could write code like this:

if (SUCCEEDED(port->raw_EnumVirtualPort(0, &name)) {
  // no need to check if name is not empty.
}

There are other methods where you use an out parameter of type VARIANT_BOOL instead of simply returning an error HRESULT. This will also prevent wrapper classes such as _com_ptr_t or a .NET RCW from throwing exceptions.


Quote
We will take into account your suggestion. What installer you are using?

I use a standard Setup Project in Visual Studio 2005 to create a Windows Installer package, but any other tool that creates msi packages should be able to use merge modules.


Quote
1) Put NT5 folder to C:\
2) Open C:\from the console and type: NT5\vsbsetup
3) The drivers are not installed, because working directory is C:\(not C:\NT5)

This is exactly the problem. Because if I use vsbsetup.exe directly as the target of a custom action (http://msdn.microsoft.com/en-us/library/aa368062(VS.85).aspx) the current directory is most likely not the directory where vsbsetup.exe will be placed by the installation. So I had to write a program that is the target of the custom action. This program calls CreateProcess to start vsbsetup.exe with the correct lpCurrentDirectory and CREATE_NO_WINDOW. This could also be done by vsbsetup.exe itself.


Quote
What is your development environment? Please be informed that some IDEs do not allow you to work with pointers.

I use a Win32 project (C++) in Visual Studio 2005. The application does not create any windows and I wanted to use functions like WaitForMultipleObject without worrying about message pumping. But this has nothing to do with the IDE, it is about how COM works. Your methods will only work if the caller and callee see the same memory. But this may not be the case if they live in different apartments. A proxy may be implicitly used which will only work if the IDL is correct. I have attached a modified Console.cpp from your VC.NET example. You can search for 'CHANGED' to see the changes. If you send "1234" to the virtual port, only the first "1" is correct, the other 3 bytes will be zero.



Re: Issues and bugs in VSP AX Reply #3 on: December 24, 2009, 12:21:52 PM
Quote
Does ResetBus simply fail and does not remove any of the 10 ports even though the other 9 are not in use? How does the ResetBus.exe utility work? I think it does delete all of the existing unused ports.

As you perhaps know, it is impossible to reset a bus if at least one COM port is opened. Please be informed that ResetBus will not delete the ports if one port in the bus is used.

Quote
I use a standard Setup Project in Visual Studio 2005 to create a Windows Installer package, but any other tool that creates msi packages should be able to use merge modules.

May I ask you how to set current directory for the executable file? According to the test results the current directory is Windows\Syetem32. It is not quite correct to write to this folder. Thanks in advance for assistance.

Quote
So I had to write a program that is the target of the custom action. This program calls CreateProcess to start vsbsetup.exe with the correct lpCurrentDirectory and CREATE_NO_WINDOW. This could also be done by vsbsetup.exe itself.

Thank you for clarification. We will implement your suggestions in one of the future releases of Virtual Serial Port Active Control.

Quote
I have attached a modified Console.cpp from your VC.NET example. You can search for 'CHANGED' to see the changes. If you send "1234" to the virtual port, only the first "1" is correct, the other 3 bytes will be zero.

According to the information you provided, the solution for you is to use ReadArray and WriteArray methods. If you are using COINIT_MULTITHREADED, then only these methods fit your requirements best of all.



 

Sitemap 1 2 3 4 5