Joe White’s Blog

Life, .NET, and Cats


API magic: Windows’ password dialog

I ran across an article on MSDN with some info on using Windows security APIs in your program. It’s targeted at C++, though it has a couple of passing references to .NET.

Some observations:

  1. It has an example of how to bring up the standard Windows “enter a password” dialog, customized for your program. I wondered how GMail Notifier did it. (CredUIPromptForCredentials, for those too lazy to follow the link.) Alas, the example is in C++, not .NET, but it’s on pinvoke.net.
  2. It has examples of a new XP/2003 API function that encrypts data using the current user’s credentials, so that data can only be decrypted by that same user. This is a pretty interesting idea, for things like password storage. (CryptProtectData and CryptUnprotectData. Also documented on pinvoke.net.)
  3. Man. Security APIs are ugly.
  4. Especially from C++.

There are no responses to “API magic: Windows’ password dialog” yet.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


Joe White's Blog copyright © 2004-2011. Portions of the site layout use Yahoo! YUI Reset, Fonts, and Grids.
Proudly powered by WordPress. Entries (RSS) and Comments (RSS). Privacy policy