Re: Userinit.exe fails no initialize!

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jeff Henkels (jeff_at_mapson.privatemail.com)
Date: 09/23/04


Date: Thu, 23 Sep 2004 08:00:23 -0400

Check the return value from CreateProcessAsUser; if it's zero, that
indicates the function failed and that you should call GetLastError to get
the specific cause of the failure.

"Sara Fonseca" <sara.fonseca@gmail.com> wrote in message
news:elAP43NoEHA.2948@TK2MSFTNGP11.phx.gbl...
>I am trying to rewrite gina on windows XP.
> My function WlxActivateUserShell goes like this in ginastub:
>
> si.cb = sizeof(STARTUPINFO);
> si.lpReserved = NULL;
> si.lpTitle = "userinit";
> si.dwX = si.dwY = si.dwXSize = si.dwYSize = 0;
> si.dwFlags = STARTF_USESHOWWINDOW;
> si.wShowWindow = SW_SHOW;
> si.lpReserved2 = NULL;
> si.cbReserved2 = 0;
> si.lpDesktop = pszDesktopName;
>
> result = CreateProcessAsUser(pgContext->UserToken,
> "userinit.exe",
> NULL, NULL, NULL, FALSE,
> CREATE_UNICODE_ENVIRONMENT,
> pEnvironment,
> NULL,
> &si,
> &pi );
>
> VirtualFree(pEnvironment, 0, MEM_RELEASE);
> return result;
>
>
>
>
> What could that be?
>
> thanks!
>
> Sara
>
>



Relevant Pages

  • (GDI Call) EnumDisplayDevices Failing for WTS Api
    ... The service thread that is calling CreateProcessAsUser ... null promptly on first call if sessionID is not Zero... ... zero at first shot if sessionID!=0. ...
    (microsoft.public.platformsdk.security)
  • Re: VerQueryValue() problem
    ... > happens when you call VerQueryValue()? ... >> If the specified name does not exist or the specified resource is not ... the return value is zero ... MSDN doesnt mention that I could call GetLastError() in case of an error. ...
    (microsoft.public.win2000.developer)
  • Cant run Message Queue P2P
    ... CreateMsgQueue function was back a handle.(GetLastError is Zero) ... But ReadMsgQueue and WriteMsgQueue function didn't succeed with that handle. ... GetLastError is ERROR_INVALID_HANDLE! ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Generic Text printing problems
    ... Details matter. ... >result of GetLastError is zero before the DeviceCapabilities call and ... Proving only that somewhere within DeviceCapabilities a function returned a ...
    (microsoft.public.win32.programmer.gdi)