Replacing msgina.dll?

A

andrewbb

I'd like to perform some (what I hope is simple) functionality on the
initial Windows logon screen. On that initial screen is it possible
to:
1. listen for a particular keystroke
2. if that keystroke is hit, run a program and refresh the Windows
logon screen?


Will that require writing a new msgina.dll? Or is it possible to
implement in another way?
 
G

Guest

Logonui.exe supplies the graphics for the logon screen, and these can be
changed, but you cannot present additional dialogs or run code this way.

gina.dll provides authentication against various network services, and (I
think) can be made to show a customised UI. A complex business replacing it
though, especially without the original sourcecode.

Is your requirement to modify a multiuser domain logon, or simply to present
your own startup-dialog to a fixed useraccount? The latter can be achieved in
other easier ways.
 
A

andrewbb

Interesting... I don't need to change the authentication mechanism so
maybe (hopefully) I won't have to write a custom gina.dll...


Is it possible to listen for a hotkey on the Windows Logon screen? It
doesn't have to display a UI, I just need to respond to the hotkey and
refresh the screen.


Or what's your idea on displaying a startup-dialog to a fixed
useraccount?
 
G

Guest

Any hotkey-detector would have to run as a service since no user is logged-on
at that time. Also, I'm not sure it would be able to interact with the logon
desktop, which is deliberately protected against keyloggers, etc. Only way is
to try and see, I guess.

The fixed-useraccount workaround is to hook the userinit process. This is
done by supplying an alternative Userinit executable, in the Winlogon
registry key. Your executable then hands-over control to the standard
userinit.exe once it's done its stuff.

Beware that if your userinit replacement fails to run for any reason you
won't be able to start the computer, so do any experiments on a testbed, not
your main PC.

HKLM\Software\Microsoft\Windows NT\Winlogon
Userinit=C:\WINDOWS\system32\userinit.exe,

Note carefully the syntax, some Windows versions have two items separated by
a comma. In XP the comma is there but nothing follows it. I'm told you should
always leave the comma even when there is no second item.

A somewhat safer (experimentation-wise) but less secure alternative is to
hook the shell executable, normally explorer.exe

Since both of these run immediately after logon it's unfortunately too late
to change the user at this stage.
 
S

Steve Riley [MSFT]

Andrew, help us understand the reasons behind your requirement. Why do you
need to refresh the screen?
 
A

andrewbb

It's a hidden user account and profile. Both the user profile and
account are hidden from Windows until a hotkey is pressed. Then the
profile and account are restored to allow a normal login. A service
re-hides the account upon log off. A patent is pending on the process
and it's operational now, but I'd like the ability to login directly
from the Windows logon screen, rather than logging in as an
interactive user first.

The 2 issues are:
1. Listening for the hotkey. Registerhotkey from a service fails with
"This operation requires an interactive windows station", so I'll have
to find another way. From what I understand, winlogon.exe uses
RegisterHotkey for Ctrl+Alt+Del. How does it do this before an
interactive user is logged in?

2. Assuming I find a way to capture keystrokes, is it not possible to
refresh the logon screen?
 
A

andrewbb

Some progress... the hotkey part was solved by starting a process in
the logon desktop session. But how do you refresh the logon screen?

Is there a function in winlogon or logonui that I can call? It seems
like msgina would need an interface to refresh the screen.
 
G

Guest

A patent is pending on the process

In which case it seems rather disreputable to be asking us to provide free
help in what is basically an attempt to deny others the right to develop
similar software.

So, I told you a few things about similar code I'd written, thinking it
would be of help. But hey, why the hell should I? If you then go and patent
some part of that process or even 'the ideas behind it' I could end-up not
being able to use code that I'd written myself, and all because I was
[generous|stoopid] enough to help you.

Copyright is one thing, if I spend long hours writing code I have a right to
prevent others misusing my work. Patents are a different matter, though. They
are an ideas-denial mechanism, one which basically allows the person who
though of patenting that feature the right to deny use of it to others. Even
if the patent-holder has not the slightest idea how, nor the skills, to put
the idea into practice.

Nope. I am no open-source zealot, but I am convinced of one thing and that
is that software patents should never have been allowed. Sorry, no more help
from me on this one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top