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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Address passing between two processes

Address passing between two processes

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 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.
  • W Offline
    W Offline
    Wenrich
    wrote on last edited by
    #1

    Imagine the following situation: I pass the address of an integer varialbe of process A to process B, and have process B to write a value to this address. 1> would an Access Violation exception be DEFINITELY raised? 2> if process B happens to have a non-constant variable (i.e. writable) locating at the same address as the one passed to it, would an AV exception be raised? if not, does that mean process B would simply change its own variable value? Thanks a lot! Wenrich

    T S W 3 Replies Last reply
    0
    • W Wenrich

      Imagine the following situation: I pass the address of an integer varialbe of process A to process B, and have process B to write a value to this address. 1> would an Access Violation exception be DEFINITELY raised? 2> if process B happens to have a non-constant variable (i.e. writable) locating at the same address as the one passed to it, would an AV exception be raised? if not, does that mean process B would simply change its own variable value? Thanks a lot! Wenrich

      T Offline
      T Offline
      Taka Muraoka
      wrote on last edited by
      #2

      You can't share memory between processes like this. You have to use memory mapped files.


      he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed) Awasu v0.4a[^]: A free RSS reader with support for Code Project.

      N 1 Reply Last reply
      0
      • T Taka Muraoka

        You can't share memory between processes like this. You have to use memory mapped files.


        he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed) Awasu v0.4a[^]: A free RSS reader with support for Code Project.

        N Offline
        N Offline
        Neville Franks
        wrote on last edited by
        #3

        Sounds like school homework time to me.:omg: Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program

        1 Reply Last reply
        0
        • W Wenrich

          Imagine the following situation: I pass the address of an integer varialbe of process A to process B, and have process B to write a value to this address. 1> would an Access Violation exception be DEFINITELY raised? 2> if process B happens to have a non-constant variable (i.e. writable) locating at the same address as the one passed to it, would an AV exception be raised? if not, does that mean process B would simply change its own variable value? Thanks a lot! Wenrich

          S Offline
          S Offline
          Stephane Rodriguez
          wrote on last edited by
          #4

          Anytime you cross the process boundary, you've got to use specialized APIs. If the need is to do so is simple, just use ReadProcessMemory, or WriteProcessMemory which are 2 standards WIN32 API functions.

          1 Reply Last reply
          0
          • W Wenrich

            Imagine the following situation: I pass the address of an integer varialbe of process A to process B, and have process B to write a value to this address. 1> would an Access Violation exception be DEFINITELY raised? 2> if process B happens to have a non-constant variable (i.e. writable) locating at the same address as the one passed to it, would an AV exception be raised? if not, does that mean process B would simply change its own variable value? Thanks a lot! Wenrich

            W Offline
            W Offline
            Wenrich
            wrote on last edited by
            #5

            It's not home work, not an assignment. i just want to find out how exactly an AV exception is raised. This question is such one that confused me. Please focus on what would happen under this situation rather than how to do the "passing". Thank you!

            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