Re: Strange Behavior with CreateProcessWithLogonW

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

From: Gary Chanson (gchanson_at_No.Spam.TheWorld.net)
Date: 10/29/04

  • Next message: Krishna Monian: "Re: Strange Behavior with CreateProcessWithLogonW"
    Date: Fri, 29 Oct 2004 14:26:04 -0400
    
    

    "Krishna Monian" <KrishnaMonian@discussions.microsoft.com> wrote in message
    news:25558FF8-6CFE-43AB-8D4A-2652FA0C26B2@microsoft.com...
    > Hi,
    >
    > I am writing some sort of a processwatchdog that starts a process from
    > within it, and keeps a watch on it. Initially I was using the
    CreateProcess
    > call. I also create a pipe using CreatePipe so that I can read the stdout
    of
    > the process I start from within the watchdog application. I also print out
    > whatever I read to the stdout of the watchdog process. This was working
    fine.
    > I have now changed the code to use CreateProcessWithLogonW so that the
    > process I am create runs under a separate user. In both cases the process
    is
    > created with the following command-line:
    > "cmd /c <command line of the process>"
    >
    > However, after the change to CreateProcessWithLogonW I am seeing some
    > strange behavior. Whatever I print out from the watchdog process (using
    > printf) goes to the command prompt that pops up due to the "cmd /c ...."
    > command, instead of going to the prompt where the watchdog process was
    > started from. What is even more strange is that on one of the machines
    that I
    > tested it on, it seems to work fine.
    >
    > I am completely baffled on this. Could anyone tell me what is going on
    over
    > here?

        I doubt that your program is actually displaying its output on a
    different console window. I expect that the output is actually coming from
    the program attached to that console window. I'd suggest looking closely at
    the code which implements your pipe connection.

    -- 
    -GJC [MS Windows SDK MVP]
    -Software Consultant (Embedded systems and Real Time Controls)
    - http://www.mvps.org/ArcaneIncantations/consulting.htm
    -gchanson@mvps.org
    

  • Next message: Krishna Monian: "Re: Strange Behavior with CreateProcessWithLogonW"

    Relevant Pages

    • RE: Strange Behavior with CreateProcessWithLogonW
      ... > whatever I read to the stdout of the watchdog process. ... > I have now changed the code to use CreateProcessWithLogonW so that the ... > strange behavior. ... What is even more strange is that on one of the machines that I ...
      (microsoft.public.win32.programmer.kernel)
    • Strange Behavior with CreateProcessWithLogonW
      ... whatever I read to the stdout of the watchdog process. ... I have now changed the code to use CreateProcessWithLogonW so that the ... printf) goes to the command prompt that pops up due to the "cmd /c ...." ...
      (microsoft.public.win32.programmer.kernel)
    • Problems with CreatePipe and CreateProcessWithLogonW
      ... whatever I read to the stdout of the watchdog process. ... I have now changed the code to use CreateProcessWithLogonW so that the ... printf) goes to the command prompt that pops up due to the "cmd /c ...." ...
      (microsoft.public.platformsdk.security)
    • Re: How to run a program silently with CreateProcessWithLogonW()?
      ... If you want to prevent a console window from being shown, ... other flags in CreateProcess. ... when I use CreateProcessWithLogonW, the console windows keeps showing up. ...
      (microsoft.public.win32.programmer.kernel)