How to unlock windows login screen

1.9k views Asked by At

at first point I have to say that I know that this topic is not new and there are some existing topics on StackOverflow, but I didn't find any solution of my problem.

I know that to unlock windows screen (Win 7 or 8) I must use Credential Provider so I download

http://www.microsoft.com/en-us/download/details.aspx?id=4057

And write my code in pure C++. In my case the MS provided "SampleHardwareEventCredentialProvider" is perfect match. Also I read other SO thread and I know that "there are WinLogon and LogonUI. LogonUI is responsible for displaying a login window and notification of WinLogon about users’ actions. Winlogon reacts for events from LogonUI and performs required actions to log-in users, log-off users, lock sessions, and unlock sessions."

I trying to create external hardware event that will unlock my computer. In my case I had a bluetooth event that will unlock my Windows.

And my problem is that given class:

class CSampleCredential : public ICredentialProviderCredential

and its implemented method:

HRESULT CSampleCredential::Initialize(
    CREDENTIAL_PROVIDER_USAGE_SCENARIO cpus,
    const CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR* rgcpfd,
    const FIELD_STATE_PAIR* rgfsp
)

I dont know how C++ code exacly can unlock windows screen.

What stuck me up? I try with Initialize method because I saw similar example (but without possibility to reuse because of not completeness):

http://blogs.msdn.com/b/securitytools/archive/2009/07/30/how-to-build-custom-logon-ui-s-in-windows-vista.aspx

So I tryied with 2 things: -CSampleCredential::Initialize() -BOOL LogonUser() -with "localhost" "userName" "userPassword"

but both of them didn't work for me. So What is a key point (codeLine) that will unlock for user blue windows screen?

1

There are 1 answers

0
John On

You can unlock the screen by hooking the process and simulating the password input.

https://github.com/TennisRunner/Windows7Logon