Click to See Complete Forum and Search --> : How to emulate a CTRL+ALT+DEL Sequence (secure attention sequence)


MTeTrust
August 17th, 2004, 07:38 PM
I am writing a Windows NT service that needs to popup the standard “user logon” dialog box.

I know in advance that the workstation is locked. The basic idea is to emulate a “secure attention sequence”, i.e. CTRL+ALT+DEL. The user will be responsible for fill the login credentials. I would like to know, for example, if I can call a function on Winlogon.exe , or the standard Gina (msgina.dll) , for example.

The premises are:

1. I can’t replace the GINA
2. I need a code that works inside a service (I am using Microsoft Visual C++).

Regards,

Marc G
August 18th, 2004, 04:29 AM
I don't know if this would work, but you could try with SendInput.

JohnCz
August 18th, 2004, 03:35 PM
I am afraid on NT this is impossible without rewriting GINA.

AdaraCD
August 19th, 2004, 04:27 AM
On XP you can use IShellDispatch4 and WindowsSecurity()

JohnCz
August 19th, 2004, 05:54 AM
Good point. MTeTrust mention NT service, but did not mention what OS.

MTeTrust
September 2nd, 2004, 09:27 AM
Dear AdaraCD,

Can you post any example code (C++) in order to use IShellDispatch4 ?

Regards.

AdaraCD
September 4th, 2004, 09:44 AM
IShellDispatch4 *pShell;

CoInitialize(NULL);

HRESULT hr = CoCreateInstance(CLSID_Shell, NULL, CLSCTX_INPROC_SERVER,
IID_IShellDispatch, (void**)&pShell);

if(SUCCEEDED(hr))
pShell->WindowsSecurity();

CoUninitialize();

MTeTrust
September 4th, 2004, 09:49 AM
Dear AdaraCD,

I am using VC++ 6.0 . When I try to use "IShellDispatch4", the object is undefined. Do I need to include any "non-standard" .H file ?

Regards,

e_vakili
December 17th, 2004, 04:55 PM
For using IShellDispatch4, you must include <shldisp.h> header file. Note that this object requires Windows XP.