DosGetNamedSharedMem obtains access to a named shared memory object.

Getting a named shared memory object allocates the virtual address (of the shared memory object) in the virtual-address space of the process.

When the name of the shared memory object is specified, the name string provided must include the prefix "\SHAREMEM\".

With the Intel 80386 processor, execute and read access are equivalent. Also, write access implies both read and execute access.

The value ppb returned to the process issuing this function is the same as that returned to the process that created the shared memory object.

Error code 31 (ERROR_GEN_FAILURE) is returned when the segment's maximum reference count of 65535 is exceeded.

Note: DosAllocMem and DosAllocSharedMem both allocate a block of memory of the size requested rounded to the nearest page. On OS/2 Warp, the system allocates a 64K object without attributes on every allocation.

For example, for a DosAllocMem call with a size of 1, the following occurs:

Note:

When you allocate a memory object with the PAG_EXECUTE attribute, it is implied that this memory object also has the PAG_READ attribute. However, when querying the attributes of a memory object, you will get the following results:


[Back] [Next]