LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

launch native windows login credential dialog with winAPI

Solved!
Go to solution

Hi Jenna,

This thread is pretty old, so Zou may not be monitoring it any more. You may have better luck posting a new thread. 

Maggie M.
Application Engineer
National Instruments.
http://www.ni.com/support
0 Kudos
Message 11 of 13
(1,050 Views)

@drummaniac83 wrote:

 

 

I've been told that Rolf would be able to solve this in 30 seconds.  Help me LabVIEW! You're my only hope!


You guys are hilarious. This isn't something which takes 30 seconds for a professional to solve. For one playing C compiler and doing all the bit lifting in LabVIEW to prevent an external wrapper library is a very laborious task, error prone and generally requires quite a bit of debugging. Doing the same in C by writing a wrapper library is somewhat easier but still requires quite a bit of work.

 

And it's not just done by looking at the prototype and starting to code. The C syntax is notoriously inadequate to describe all aspects of an API in terms of memory management requirements and other specific requirements for the individual parameters. So it's about going to MSDN and other sites and read the description, looking for possible sample code that shows how to handle these aspects properly and then after a lengthy study you can start to code. Then there is debugging and more debugging. "It doesn't crash anymore!" is not enough.

 

Even if it doesn't cause a protection fault that LabVIEW can catch and display an error dialog for, can it still catastrophically corrupt memory. It may seem ok, but can suddenly start to crash after you build an executable or move to a different computer or different LabVIEW, Windows or whatever version. Wrapping this function properly would take me anything from 1 to maybe 10 hours. I can claim that the chance that it is actually clean and not corrupting memory after that is pretty high. The difference between that code and wrapper code that is written by someone not understanding all these issues is that it will likely take another person even longer to come up with such a solution but with much less confidence that it still won't corrupt memory along the way. Smiley Happy

 

That's not a problem for throwaway code of course, but not something I would want to have in an industrial application that might be used to control an expensive experiment. Smiley Wink

Rolf Kalbermatter
My Blog
0 Kudos
Message 12 of 13
(1,044 Views)

@jennapark86 wrote:

Hi zou,

 

It looks like the dropbox link is no longer available. Can you re-upload the code?

 

Thanks,

Jenna


The question would be why do you think you need to call this function? This function calls a legitimate Windows login dialog and returns you the credentials the user has entered. It does not validate those credentials in itself with a Windows domain controller or your local user list.

Validation still has to be done by yourself. The only point where it might help is if you also use some card reader which has a Windows security provider interface and you want to use it to allow people to login with such a card. But there are card readers with a serial interface too that you could communicate directly with if you wanted.

If it is just for a login dialog it is much easier to write that yourself as a LabVIEW VI.

Rolf Kalbermatter
My Blog
0 Kudos
Message 13 of 13
(1,042 Views)