Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

On Windows Seven, how to make LabVIEW deploy the right ws2_32.dll on my target ?

Solved!
Go to solution

Hello,

 

On Windows Seven, because ws2_32.dll is listed as a "KnownDLLs" (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs), when LabVIEW deploys my custom DLL which depends on ws2_32.dll, it deploys the system32 DLL ws2_32.dll instead of the LabVIEW 2012 RT image ws2_32.dll, causing dependencies errors displayed on my target... And it is not possible to change the "KnownDLLs" list because it is a strong Windows system mechanism.

 

I noticed that on Windows XP, ws2_32 is not in the "KnownDLLs" list and I thought that everything would be fine (I did not try).

To solve the problem temporarily, I changed my custom DLL in order that it depends only on wsock32.dll but it is not satisfactory for me...

 

Could you help me ?

 

 

0 Kudos
Message 1 of 4
(6,404 Views)

The simple unfortunate answer is:  You don't.

 

The ws2_32.dll is the WinSock2 API, which heavily depends on specific system services being available in the operating system.  PharLap does not have those system services available, and so the ws2_32.dll would not load even if you FTP'd the file to the target (because resources it requires are not present).  NI does not support the WinSock2 API in its Real-Time platform.

 

-Danny

0 Kudos
Message 2 of 4
(6,384 Views)
Solution
Accepted by topic author borlec1969

Thank you for your answer, but I am quite sure that LabVIEW 2012 NI RT supports WinSock2 API as the ws2_32.dll can be found in the directory "C:\Program Files (x86)\National Instruments\RT Images\Base\9.0" and as the program "DLL Checker 2012.exe" seems to confirm.

 

I did some test since my first post and I resolved my problem :

 

To prevent LabVIEW for automatically upload the DLLs into the target (and upload the wrong ws2_32.dll), I uploaded manually with FileZilla the right DLLs (for example the ws2_32.dll located in the directory ...National Instruments\RT Images\Base\9.0) into the directory /ni-rt/system of the PXI RT target. Now, when LabVIEW tranfers my program depending on ws2_32.dll in the target, it finds that the dependencies are already resloved and all is fine !

 

0 Kudos
Message 3 of 4
(6,344 Views)

Be very careful about that assumption.  That ws2_32.dll you found is an "experimental" version of ws2_32.dll that we created that supports literally a bare minimum support (pretty much only what the legacy WinSock support has, plus some experimental functionality we threw in there).  If it works for you, then GREAT!  But, be aware that not all of the functionality is there - if you check GetLastError you might find some of your API calls return "not supported", or you might get warnings about limited functionality when you attempt to use some API, if you use some WinSock2 API your calls may fail to find the entry point, or your calls may fail (or succeed) silently.  If you use functionality within ws2_32.dll, it is completely UNSUPPORTED and you must verify that the functionality works as you intend; no life guards are on duty.

 

-Danny

0 Kudos
Message 4 of 4
(6,341 Views)