Re: MSGINA with Novell
From: Brandon Swamy (Brandon.Swamy_at_gd-ais.com)
Date: 06/25/04
- Next message: Abe Simpson: "AES (Rijndael) Encryption with CryptoAPI"
- Previous message: Pieter Philippaerts: "Re: SSL Algorithms and Cipher Strengths"
- In reply to: Les T.: "MSGINA with Novell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
- Next message: Abe Simpson: "AES (Rijndael) Encryption with CryptoAPI"
- Previous message: Pieter Philippaerts: "Re: SSL Algorithms and Cipher Strengths"
- In reply to: Les T.: "MSGINA with Novell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|