Differences
This shows you the differences between two versions of the page.
| en:docs:fapi:dosgetshrseg [2021/08/20 08:43] – created prokushev | en:docs:fapi:dosgetshrseg [2021/09/16 15:00] (current) – prokushev | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{page> | {{page> | ||
| + | |||
| + | ====== DosGetShrSeg ====== | ||
| This call accesses a shared memory segment previously allocated by another process. | This call accesses a shared memory segment previously allocated by another process. | ||
| - | ==Syntax== | + | ===== Syntax |
| - | | + | <code c> |
| + | DosGetShrSeg (Name, Selector) | ||
| + | </ | ||
| - | ==Parameters== | + | ===== Parameters ===== |
| - | ;Name (PSZ) - input : Address of the name string associated with the shared memory segment to be accessed. The name is an ASCIIZ string in the format of an OS/2 filename in a subdirectory called \SHAREMEM\, for example, \SHAREMEM\PUBLIC.DAT. | + | |
| - | ;Selector (PSEL) - output : Address of the selector for the shared memory segment. | + | |
| - | ==Return Code== | + | * Name ([[PSZ]]) - input : Address of the name string associated with the shared memory segment to be accessed. The name is an ASCIIZ string in the format of an OS/2 filename in a subdirectory called \SHAREMEM\, for example, \SHAREMEM\PUBLIC.DAT. |
| - | ;rc (USHORT) - return:Return code descriptions are: | + | * Selector ([[PSEL]]) - output : Address of the selector for the shared memory segment. |
| - | *0 NO_ERROR | + | |
| - | *2 ERROR_FILE_NOT_FOUND | + | |
| - | *4 ERROR_TOO_MANY_OPEN_FILES | + | |
| - | *123 ERROR_INVALID_NAME | + | |
| - | ==Remarks== | + | ===== Return Code ===== |
| - | DosGetShrSeg provides access to a named shared segment allocated by another process with [[DosAllocShrSeg]]. The selector returned by DosGetShrSeg is the same as the one returned by the DosAllocShrSeg call. | + | |
| - | A usage count is maintained for a named shared segment. Issuing DosGetShrSeg increments the count, and issuing [[DosFreeSeg]] decrements the count. When the usage count equals zero, the named shared segment is deallocated. Once the segment has been deallocated, | + | rc ([[USHOR]]T) - return: Return code |
| + | |||
| + | *0 NO_ERROR | ||
| + | *2 ERROR_FILE_NOT_FOUND | ||
| + | *4 ERROR_TOO_MANY_OPEN_FILES | ||
| + | *123 ERROR_INVALID_NAME | ||
| + | |||
| + | ===== Remarks ===== | ||
| + | |||
| + | DosGetShrSeg provides access to a named shared segment allocated by another process with [[DosAllocShrSeg]]. The selector returned by DosGetShrSeg is the same as the one returned by the [[DosAllocShrSeg]] call. | ||
| + | |||
| + | A usage count is maintained for a named shared segment. Issuing DosGetShrSeg increments the count, and issuing [[DosFreeSeg]] decrements the count. When the usage count equals zero, the named shared segment is deallocated. Once the segment has been deallocated, | ||
| To access shared memory that is allocated by another process with [[DosAllocSeg]] and [[DosAllocHuge]] requests, a process issues [[DosGetSeg]]. | To access shared memory that is allocated by another process with [[DosAllocSeg]] and [[DosAllocHuge]] requests, a process issues [[DosGetSeg]]. | ||
| - | ==Bindings== | + | ===== Bindings ===== |
| - | ===C=== | + | |
| - | <PRE> | + | ==== C ==== |
| + | |||
| + | <code c> | ||
| #define INCL_DOSMEMMGR | #define INCL_DOSMEMMGR | ||
| Line 35: | Line 45: | ||
| USHORT | USHORT | ||
| - | </PRE> | + | </code> |
| + | |||
| + | ==== MASM ==== | ||
| - | ===MASM=== | + | <code asm> |
| - | <PRE> | + | |
| EXTRN DosGetShrSeg: | EXTRN DosGetShrSeg: | ||
| INCL_DOSMEMMGR | INCL_DOSMEMMGR | ||
| Line 47: | Line 58: | ||
| Returns WORD | Returns WORD | ||
| - | </PRE> | + | </code> |
| {{page> | {{page> | ||




