Is it possible to allocate a buffer of shared memory? I tried with gloabalalloc and GMEM_SHARE as flag, but it doesn't work(i think it's no more available in win32). I need to access this block from different processes(i must jump to this buffer and execute the code it contains). Do you know a way to do that? I tried also with Vxdcall(PageModifyPermissions), but i'm not sure of the parameters passed to it and it doesnt work. Thank you
Posted on 2001-03-11 13:22:00 by /mi/
/mi/, I think you are in trouble with what you are after, the esentials of win32 is seperate memory space for each application. There is still a style for GlobalAlloc() GMEM_DDESHARE but it will not do what you want and DDE was a messy process at best. What I would suggest is a memory mapped file which can be accessed by normal 32 bit apps. There is an example in Iczelion's tutorials. This will not be available to a VxD from memory but VxD programming is not really my area so you may get better data elsewhere. Regards, hutch@pbq.com.au This message was edited by hutch--, on 3/11/2001 5:14:32 PM
Posted on 2001-03-11 16:13:00 by hutch--
Theres a memory mapped file tutorial on Iczelions site. That should be exactly what you want.
Posted on 2001-03-12 09:58:00 by Zadkiel
If you have a fairly specific need for the shared memory. Create a dll, and in it create a new segemnt:

.386
.model flat, stdcall
option casemap: none

include \masm32\.....
include .....
.
.
.

Share32 SEGMENT BYTE USE32
 ShareBuffer BYTE 01000h DUP(?)
Share32 ENDS

.data
.data?
.code
DllEntry PROC....
and when you link this DLL, include the following in the linking command line:

/SECTION:Share32,S
This means, that when any instance off the dll is loaded in any process. The segment 'Share32' is shared. The name Share32 does not have to be used either, you can call it whatever you want.
Posted on 2001-03-12 15:21:00 by George