Click to See Complete Forum and Search --> : HELP!! GINA


Kelvin
May 3rd, 1999, 11:31 PM
I modified the msdn sample gina.dll to my own mygina.dll, now i have two problems.
1) whenever my NT started up, i get an error saying user32.dll and nddegant.dll initialization fail. and i need to go to
tasklist to manual start my user shell.
here is my code for the WlxActivateUserShell(....) function.



BOOL
WINAPI
WlxActivateUserShell(
PVOID pWlxContext,
PWSTR pszDesktop,
PWSTR pszMprLogonScript,
PVOID pEnvironment
)
{

char szText[MAX_PATH];

char* pszScan;
STARTUPINFO si;
PROCESS_INFORMATION pi;
PGlobals pGlobals;
DWORD StartCount;

pGlobals = (PGlobals) pWlxContext;

GetProfileString(WINLOGON_APP, USERINIT, USERINIT_DEFAULT, (char*)szText, MAX_PATH);

StartCount = 0;

pszScan = strtok(szText, ",");

while (pszScan)
{
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(STARTUPINFO);
si.lpTitle = (char*)pszScan;
si.dwX = si.dwY = si.dwXSize = si.dwYSize = 0L;
si.dwFlags = 0;
si.wShowWindow = SW_SHOW; // at least let the guy see it
si.lpReserved2 = NULL;
si.cbReserved2 = 0;
si.lpDesktop = (char*)pszDesktop;

// DebugLog((DEB_TRACE, "Starting '%ws' as user\n", pszScan));

int imp = ImpersonateLoggedOnUser(pGlobals->hUserToken);
if (CreateProcessAsUser(pGlobals->hUserToken, // Token to run as
NULL, // App name
pszScan, // Command Line
NULL, // Process SD
NULL, // Thread SD
FALSE, // No inherit
CREATE_UNICODE_ENVIRONMENT,
pEnvironment,
NULL,
&si,
&pi))
{
StartCount++;
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}

RevertToSelf();

pszScan = strtok(NULL, ",");


}
return(StartCount > 0);

}

what could be wrong??