Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problem with CreateProcessAsUser( ) ? [modified]

Problem with CreateProcessAsUser( ) ? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kushagra Tiwari
    wrote on last edited by
    #1

    Hello ALL, In one of my applications running under local user account, I need to spawn a process internally from system account.I was using OpenProcessToken () and was trying to collect token of winlogon.exe running under system account and was specifying flag as TOKEN_ALL_ACCESS but this fails. Also if I specify the FLAG as TOKEN_QUERY then I get the handle but then trying to CreateProcesswithUser resulted in Error "Access is denied". Can some body suggest me a solution through which I can spawn a new process through SYSTEM account when my process itself is running through a user account . Regards, Kushagra I hate to code but I luv to develop :)

    modified on Friday, October 9, 2009 3:29 AM

    R 1 Reply Last reply
    0
    • K Kushagra Tiwari

      Hello ALL, In one of my applications running under local user account, I need to spawn a process internally from system account.I was using OpenProcessToken () and was trying to collect token of winlogon.exe running under system account and was specifying flag as TOKEN_ALL_ACCESS but this fails. Also if I specify the FLAG as TOKEN_QUERY then I get the handle but then trying to CreateProcesswithUser resulted in Error "Access is denied". Can some body suggest me a solution through which I can spawn a new process through SYSTEM account when my process itself is running through a user account . Regards, Kushagra I hate to code but I luv to develop :)

      modified on Friday, October 9, 2009 3:29 AM

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      Kushagra Tiwari wrote:

      I was using OpenProcessToken () and was trying to collect token of winlogon.exe running under system account and was specifying flag as TOKEN_ALL_ACCESS but this fails.

      The API documentation states that you could call GetLastError()[^] to get extended information on the reason for failure. Have you tried that?

      It is a crappy thing, but it's life -^ Carlo Pallini

      K 1 Reply Last reply
      0
      • R Rajesh R Subramanian

        Kushagra Tiwari wrote:

        I was using OpenProcessToken () and was trying to collect token of winlogon.exe running under system account and was specifying flag as TOKEN_ALL_ACCESS but this fails.

        The API documentation states that you could call GetLastError()[^] to get extended information on the reason for failure. Have you tried that?

        It is a crappy thing, but it's life -^ Carlo Pallini

        K Offline
        K Offline
        Kushagra Tiwari
        wrote on last edited by
        #3

        I got "Access is denied" (using getlasterror())error while trying to call openprocesstoken as I already mentioned. But some how I want to spawn a process through system account while my base process is running under user account. Kushagra

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups