LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling kernel32.dll crashes LV2011 SP1 64bit

Solved!
Go to solution

Hi all,

 

I'm moving an applciation from LV2011 SP1 on Windows XP to LV2011 SP1 64bit on Win7 64bit.

 

In my app I'm making calls to the kernel32.dll to know how much RAM is available on the computer, here's the VI i'm using for this :

 

kernel32.png

 

To call the dll, I'm only giving the name of it "kernel32.dll" and not the full path.

 

I never had issues with it on Win XP and now that I'm on Win7 64bit, when I run this VI, LV simply vanishes away without any crash message and when I restart it, it doesn't go through the crash recovery process.

 

I went into the C:\Windows\System folder and saw that there two kernel32.dll files, one in the System32 subfolder and one in the SysWOW64 subfolder.

 

I tried to give the full path of both versions of the dll in the call node but I keep getting the same result.

 

Any idea what I should do to make this works?

I guess I could give up using a dll call and use some .NET functions but I'm really not familiar with it.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 1 of 4
(3,629 Views)
Solution
Accepted by topic author TiTou

I think your problem is that on 64-bit systems, SIZE_T (the datatype for most of the parameters of the structure) is 64-bits, and you've unsigned, 32-bit values.

Message 2 of 4
(3,611 Views)

Indeed!

 

But is it "normal" to have LabVIEW to just vanish any error message when the parameters passed in the call dll node don't have the correct format??


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 3 of 4
(3,606 Views)

Well, when you have a kernel function stomping on a process' memory I'm guessing just about anything could happen.

0 Kudos
Message 4 of 4
(3,604 Views)