Re: MSGINA with Novell

From: Brandon Swamy (Brandon.Swamy_at_gd-ais.com)
Date: 06/25/04


Date: Thu, 24 Jun 2004 18:06:32 -0400

As far as I can tell, the reason the WlxActivateUserShell from MSGina.dll
won't work is exactly what you think it is. If you look at the sample code
provided, it calls the CreateProcessAsUser() function, and uses the
usertoken from LogonUser. If you use your own WlxLoggedOutSAS, this token
will be NULL when the default GINA function tries to call
CreateProcessAsUser, so Winlogon will die.

To run applications, you'll need to write your own WlxStartApplication. A
sample is provided in MSDN. As far as why the start bar doesn't work and
your login scripts don't run, I'm not quite sure. Sorry.

"Les T." <LesT@discussions.microsoft.com> wrote in message
news:ECD3F39C-AFF5-4736-B5DA-D2B145D9EA56@microsoft.com...
> I am modifying the MSGINA stub example to create a custom UI and
authentication subsystem. The WlxLoggedOutSAS function seems to work
correctly because my login successfuly starts. The problem occurs in the
WlxActivateUserShell function. In this function I simply allow the default
gina's function to handle the processing. I get an exception by Winlogon
when it tries to dereference a pointer at address 0x58. I assume that I
have not set up a structure correctly that Winlogon needs. If I replace the
WlxActivateUserShell function with the MSDN sample code, it will log in but
I can't run any applications, the start bar doesn't work, and the login
scripts aren't executed. I assume that I am not using the same gina context
structure defnition that MSGINA uses.
>
> WlxLoggedOutSAS: (debug code)
> ---------------------------------------
>
> PGINA_CONTEXT context = (PGINA_CONTEXT)pWlxContext;
>
> AfxMessageBox(_T("WlxLoggedOutSAS"));
>
> LoginDlg dlg;
>
> CString defaultUserName = _T("");
>
> GetDefaultUserName(defaultUserName);
>
> dlg.mUserName = defaultUserName;
>
> if (dlg.DoModal() == IDOK)
> {
>
> TOKEN_STATISTICS userStats;
> DWORD cbStats;
>
> // Attempt to log on the user.
> // Assignments for pwszUser, pwszDomain, and pwszPassword
> // handled elsewhere.
> if (!LogonUser(dlg.mUserName,
> NULL,
> dlg.mPassword,
> LOGON32_LOGON_UNLOCK,
> LOGON32_PROVIDER_DEFAULT,
> phToken))
> {
> return WLX_SAS_ACTION_NONE;
> }
>
> // Check the user token.
> if (!(*phToken))
> {
> return WLX_SAS_ACTION_NONE;
> }
>
> // Save the user token in the GINA context
> context->UserToken = *phToken;
>
> // Pass back null profile and options.
> *pdwOptions = 0;
> *pProfile = NULL;
>
> // Get the authenticationid from the user token.
> if (!GetTokenInformation(*phToken,
> TokenStatistics,
> (PVOID) &userStats,
> sizeof(TOKEN_STATISTICS),
> &cbStats))
> {
> return WLX_SAS_ACTION_NONE;
> }
> else
> {
> *pAuthenticationId = userStats.AuthenticationId;
> }
>
> // Pass back multiple provider information.
> pMprNotifyInfo->pszUserName = DupString(dlg.mUserName);
> pMprNotifyInfo->pszDomain = DupString(CString("CPPCCDKM01"));
> pMprNotifyInfo->pszPassword = DupString(dlg.mPassword);
> pMprNotifyInfo->pszOldPassword = NULL;
>
> return WLX_SAS_ACTION_LOGON;
> }
>
> return WLX_SAS_ACTION_NONE;
>
> ---------------------------
> End WlxLoggedOutSAS



Relevant Pages

  • Re: Replacement GINA using smart cards fail to display user Taskbar and user Icons.
    ... have put code in place to filter the WlxLoggedOutSAS to MSGINA.DLL and the ... > Taskbar is a main component of shell, and from your description, taskbar ... > WlxActivateUserShell, I could not find any problems inside it. ... > Microsoft Online Partner Support ...
    (microsoft.public.platformsdk.security)
  • GINA: token becomes invalid all of a sudden
    ... In my gina.dll, after several logins and logouts, the token becomes invalid ... all of a sudden between WlxLoggedOutSAS and WlxActivateUserShell. ... The token is obtained from LogonUser called within WlxLoggedOutSAS. ... ImpersonateLoggedOnUser fails with the very same token. ...
    (microsoft.public.win32.programmer.kernel)
  • Gina - WlxActivateUserShell is never called
    ... I am writing a custom Gina running on XP. ... In WlxLoggedOutSAS I return WLX_SAS_ACTION_LOGON ... But WlxActivateUserShell never gets called, instead WlxDisplaySASNotice gets ...
    (microsoft.public.platformsdk.security)