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. RTL_USER_PROCESS_PARAMETERS.CommandLine is only for current process?

RTL_USER_PROCESS_PARAMETERS.CommandLine is only for current process?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 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.
  • J Offline
    J Offline
    Jack Rong
    wrote on last edited by
    #1

    I used NtQueryInformationProcess to get PROCESS_BASIC_INFORMATION and PEB and then RTL_USER_PROCESS_PARAMETERS. But CommandLine of RTL_USER_PROCESS_PARAMETERS is always associated with the currect process although I passed in different PID into NtQueryInformationProcess() call. By the way, I am using XP64. Can you help. Thanks Jack Rong

    C 1 Reply Last reply
    0
    • J Jack Rong

      I used NtQueryInformationProcess to get PROCESS_BASIC_INFORMATION and PEB and then RTL_USER_PROCESS_PARAMETERS. But CommandLine of RTL_USER_PROCESS_PARAMETERS is always associated with the currect process although I passed in different PID into NtQueryInformationProcess() call. By the way, I am using XP64. Can you help. Thanks Jack Rong

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      Have you read the following notice in documentation [^]: [NtQueryInformationProcess may be altered or unavailable in future versions of Windows. Applications should use the alternate functions listed in this topic.] ?

      Jack Rong wrote:

      although I passed in different PID into NtQueryInformationProcess() call.

      You should pass the process handle, shouldn't you? :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      J 1 Reply Last reply
      0
      • C CPallini

        Have you read the following notice in documentation [^]: [NtQueryInformationProcess may be altered or unavailable in future versions of Windows. Applications should use the alternate functions listed in this topic.] ?

        Jack Rong wrote:

        although I passed in different PID into NtQueryInformationProcess() call.

        You should pass the process handle, shouldn't you? :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        J Offline
        J Offline
        Jack Rong
        wrote on last edited by
        #3

        Thanks for your response. Yes, I do pass the process handle, here is the example, hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, mypid ); NtQueryInformationProcess (hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), &dwSize); Where "mypid" is what I want and is not current PID. But the CommandLine I got is the Current Process's CommandLine. So strange! Yes, I realize that. But I am not sure which new function can be used in order to replace the "NtQueryInformationProcess()" though. Jack

        C 1 Reply Last reply
        0
        • J Jack Rong

          Thanks for your response. Yes, I do pass the process handle, here is the example, hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, mypid ); NtQueryInformationProcess (hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), &dwSize); Where "mypid" is what I want and is not current PID. But the CommandLine I got is the Current Process's CommandLine. So strange! Yes, I realize that. But I am not sure which new function can be used in order to replace the "NtQueryInformationProcess()" though. Jack

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          How do you get the command line? I don't see such a option in the documentation. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          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