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. Restart the process

Restart the process

Scheduled Pinned Locked Moved C / C++ / MFC
helpperformancequestion
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.
  • M Offline
    M Offline
    mpapeo
    wrote on last edited by
    #1

    Hello, I have a problem in my C program code. I want to restart or recreate a process which was suspended and its state was saved in a binary file and then terminated. Now i want to recreate/restart it using its previous state. I tried to use the functions below but it seems the functions do not work. Help me please, part of my code: case 6://restarting the process lpBaseAddress = 0; hProcess = mbi.BaseAddress; SetThreadContext( hThread, lpContext ); WriteProcessMemory( hProcess, // handle to process whose memory is written to lpBaseAddress, // address to start writing to lpBuffer, // pointer to buffer to write data to nSize, // number of bytes to write lpNumberOfBytesWritten // actual number of bytes written ); ResumeThread(pi.hThread);// identifies thread to restart GetLastError(); break; what am i missing here, or i have to call the createprocess() function again? oam

    A 1 Reply Last reply
    0
    • M mpapeo

      Hello, I have a problem in my C program code. I want to restart or recreate a process which was suspended and its state was saved in a binary file and then terminated. Now i want to recreate/restart it using its previous state. I tried to use the functions below but it seems the functions do not work. Help me please, part of my code: case 6://restarting the process lpBaseAddress = 0; hProcess = mbi.BaseAddress; SetThreadContext( hThread, lpContext ); WriteProcessMemory( hProcess, // handle to process whose memory is written to lpBaseAddress, // address to start writing to lpBuffer, // pointer to buffer to write data to nSize, // number of bytes to write lpNumberOfBytesWritten // actual number of bytes written ); ResumeThread(pi.hThread);// identifies thread to restart GetLastError(); break; what am i missing here, or i have to call the createprocess() function again? oam

      A Offline
      A Offline
      Anand for every one
      wrote on last edited by
      #2

      See you said you terminated the process. Then how can you resume it ? Only Suspended process can Resumed. Not Terminated Process. You should not terminate it.Just Suspend it.

      M 1 Reply Last reply
      0
      • A Anand for every one

        See you said you terminated the process. Then how can you resume it ? Only Suspended process can Resumed. Not Terminated Process. You should not terminate it.Just Suspend it.

        M Offline
        M Offline
        mpapeo
        wrote on last edited by
        #3

        In process migration, there should be a way of restarting a suspended process(check pointed process) in the other machine on the network. Ifact i want to used the saved process information like baseaddress, context e.t.c after it was suspended. So there should be a possible way. But the big question how???? oam

        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