(GDI Call) EnumDisplayDevices Failing for WTS Api

anonymous_at_discussions.microsoft.com
Date: 12/18/03

  • Next message: GC: "Container Name value gets corrupted after call to createFilePKCS10."
    Date: Thu, 18 Dec 2003 01:44:47 -0800
    
    

    Ok, let me phrase this differently. The Caller
    is a process as in CreateProcessAsUser, and the
    specific user i changed to act as TCB. cant get
    much higher than that.

    But yet, if the sessionID is anything other than
    0, i cannot do the enum - even if i do an
    OpenWindowStation, SetProcessWindowStation,
    OpenInputDesktop and what not.

    The service thread that is calling CreateProcessAsUser
    is also Doing

    BOOL Retval=SetTokenInformation(hToken, TokenSessionId,
    &dwSessionId,sizeof(DWORD)) ;

    where dwSessionId=0, and hToken is valid. Retval==TRUE
    upon return.

    However, EnumDisplayDevices is still not working, returning
    null promptly on first call if sessionID is not Zero...

    I am pretty much at my wits end now.....

    in XP Environment (fast user). ie, always returning
    zero at first shot if sessionID!=0. Tried
    a bunch of stuff, no luck. My posting below from
    the gdi newsgroup reproduced :

    >-----Original Message-----
    >Yes, this call is returning No devices.
    >i am loadlibbling a dll. However, before that
    >i do call AttachtoDesktop.
    >help appreciated.
    >.
    >
    .


  • Next message: GC: "Container Name value gets corrupted after call to createFilePKCS10."

    Relevant Pages

    • Re: Spawning a Program From a Serivce Under Terminal Services?
      ... Try using CreateProcessAsUser. ... token first to specify which terminal session the process should run as. ... >connections to a Virtual Serial Port which it has created and is servicing. ... I can get the SessionId ...
      (microsoft.public.win32.programmer.kernel)
    • Re: Userinit.exe fails no initialize!
      ... Check the return value from CreateProcessAsUser; if it's zero, ... indicates the function failed and that you should call GetLastError to get ...
      (microsoft.public.win32.programmer.kernel)