1

I have a C++ script that locks the windows when a specific event occurs. Locking windows is done using “LockWorkStation()” command. What I want to do is “unlock” windows when some other event occurs. For the sake of argument, let’s assume windows is “locked”. I need windows to get unlocked after 2 minutes. Does this need any modification to MSGINA.dll ? or it is a simple command similar to LockWorkStation() ? Knowing that I have the username and password saved somewhere (currently on a US B stick that works as a key).

Any guidance, advice, or procedure to the direction to achieve the task is highly appreciated.

Regards

Louis
  • 1,265
  • 1
  • 15
  • 22
  • 7
    What is a C++ *script*? – bitmask Sep 14 '11 at 00:49
  • 2
    In my mind locking is not meant to be exited programatically, only through a "physical" user action. In that logic, there should be no way of doing this _by design_. Of course, there are hacks on the web showing how to do it using code injection, but I don't think you'll get something stable with it (and it may be blocked / not working on future version of windows). – J.N. Sep 14 '11 at 00:56
  • Why are you allowing the station to be locked in the first place? Really, you are swimming against the tide here. – David Heffernan Sep 14 '11 at 13:11
  • 1
    Hello David; I am having a mouse with a fingerprint similar to this ( http://reviews.cnet.com/mice/microsoft-wireless-intellimouse-explorer/1707-3148_7-31140753.html ) so i want to "lock" the station once an unauthorized person uses the mouse. Consequently, I want to "unlock" the station once an authorized person uses the mouse. Any advice would be highly appreciated. Thank you. – Louis Sep 14 '11 at 14:16

1 Answers1

2

There is no supported mechanism to unlock workstation. You will have to write a custom GINA module and then communitate with it somehow.

With standard GINA the closest you can get is to do autologon (e.g. using Autologon tool from SysInternals). However autologon only kicks in after machine reboot or after user logoff, so user session would be lost.

seva titov
  • 11,720
  • 2
  • 35
  • 54
  • FWIW, GINA does not exist on Vista and above. – David Heffernan Sep 14 '11 at 08:06
  • Thank you Seva. Do you think that what i am intended to do can be done Credential Provider ? or same issue persist ? – Louis Sep 14 '11 at 11:52
  • David is right. I missed that custom GINA seased to exist starting Windows Vista. Even on XP and below, custom GINA is probably not the solution you want to be after, because complexity of writing custom GINA is too high. – seva titov Sep 14 '11 at 23:01
  • @Louis, Credential Provider cannot initate logon or session unlock by itself. Only Winlogon and LogonUI can do that. – seva titov Sep 14 '11 at 23:08