Allocating shared memory windows
Enabling NetSecOps with comprehensive network and security visibility, analysis, and automated response in a consolidated product set. Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance. Characters Remaining: All Rights Reserved.
See Trademarks for appropriate markings. View All Products. Services Consulting Education Modernization Outsourcing. Characters Remaining: Please provide feedback! How much shared memory can be allocated on bit Windows? Printable View.
Title How much shared memory can be allocated on bit Windows? URL Name P When all handles are closed, the system can free the section of the paging file that the object uses. A second process can access the string written to the shared memory by the first process by calling the OpenFileMapping function specifying the same name for the mapping object as the first process.
The process can display this string as it would any other string. In this example, the message box displayed contains the message "Message from first process" that was written by the first process. Skip to main content. This browser is no longer supported. Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. Sharing memory between two processes C, Windows Ask Question.
Asked 12 years, 5 months ago. Active 6 years ago. Viewed 74k times. Is there any way to share memory between two processes? Is this possible? Code is appreciated. Improve this question. Community Bot 1 1 1 silver badge.
What sort of program? Windows, GUI, console? I can run from a service, or a GUI or a console — wonderer. Add a comment.
Active Oldest Votes. This stub will likely need to be written in assembler. Execute your stub using CreateRemoteThread. The processes will then have a common shared memory segment. Use variable-sized shared memory. Your stub gets the size and either the name of or a handle to the shared memory. This is appropriate if you need only exchange data once. Note that the size of a shared memory segment cannot be easily changed after creation.
Use a named pipe. Your stub gets the name of or a handle to the pipe. This is appropriate if you need to exchange data multiple times. You could also just use a fixed name, which is probably simpler. Improve this answer. As a non-windows person who has only a notional idea of what's going on here, should I be a little freaked out that this possible? Is there a comparable unix process for doing this?
Yes, this can be done in unix. Then have the code do whatever. To clarify, the above was for Linux. Other unixes will likely have something similar. If you want your own thread, call out to libpthread from your injected stub. This sounds like a good solution. I know how to inject and I have working code already. Could you post a sample how on how to use the entire thing what you just described. Not right now, I'm afraid.
0コメント