C++ script to “unlock” windows after being locked using “LockWorkStation()”

2k views Asked by At

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

1

There are 1 answers

4
seva titov On

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.