Re: Win32 service starting application (OpenProcessToken and ImpersonateLoggedOnUser)

From: vipin (vipin_at_nospam.com)
Date: 02/04/05

  • Next message: pike: "Re: Problems with public key decryption with RSA"
    Date: Fri, 4 Feb 2005 00:10:23 -0800
    
    

    No way unless you get the hToken, for that you have to prompt the user to
    get the user credentials.

    Thanks
    Vipin

    "Mark" <usenet@markNOSPAMPLEASEshaw.plus.com> wrote in message
    news:4202ba4b$0$45189$ed2e19e4@ptn-nntp-reader04.plus.net...
    >
    > "Vince Morgan" <vir@optusnet.com.au> wrote in message
    > news:420241fd$0$2424$afc38c87@news.optusnet.com.au...
    >>
    >> "Mark Shaw" wrote in message
    >> > unsigned long hProcess = 0;
    >> > ret = this->GetPIDofProcessName((char *)shellName, hProcess);
    >> > if (ret != 0)
    >> > return -1;
    >> > LogString2("Service detected shell PID is %ld\n", hProcess);
    >> >
    >> > HANDLE hToken = NULL;
    >>
    >>
    >> Changing the value of hProcess here has me a little curious
    >>
    >
    > I cant call GetCurrentProcess() because the current process is the service
    > which is operating under LocalSystem. The shell is operating as the local
    > user, and its the PID of the shell I thought would get an acceptable
    > token.
    > Right?
    >
    >
    >


  • Next message: pike: "Re: Problems with public key decryption with RSA"

    Relevant Pages

    • Re: Win32 service starting application (OpenProcessToken and ImpersonateLoggedOnUser)
      ... get the user credentials. ... >> Changing the value of hProcess here has me a little curious ... > which is operating under LocalSystem. ... The shell is operating as the local ...
      (microsoft.public.win32.programmer.kernel)
    • c.u.s. FAQ, take two
      ... It spells "unix" in lower case letters ... The other level is how to write shell scripts. ... How do I get a script to update my current environment? ... POSIX (Portable Operating System Interface) and SUS (Single Unix ...
      (comp.unix.shell)
    • Re: Call for input on comp.unix.shell FAQ
      ... That's not the point of this FAQ, ... > One is the use of the shell itself as an interface to the operating ... > The other level is how to write shell scripts. ... > the shell script needs to accomplish, ...
      (comp.unix.shell)
    • Re: Shell Command Doesnt Create TXT file as expected
      ... > Private Declare Function OpenProcess _ ... > Call your Shell command in this form with the appropriate Shell ... > hProcess = OpenProcess ... I also tried to use the suggested MS approach with a different command (I ...
      (microsoft.public.vb.general.discussion)
    • Re: More difficult question - how do I wait until another application closes?
      ... another window (MS-DOS window). ... This method doesn't use Shell -- it uses CreateProcessA (and provides ... Private Declare Function OpenProcess _ ... WaitForSingleObject hProcess, -1 ...
      (comp.lang.basic.visual.misc)