|
Last change
on this file since 358 was 26, checked in by RBRi, 19 years ago |
|
+ helpmgr files
|
-
Property svn:eol-style
set to
native
|
|
File size:
1.5 KB
|
| Line | |
|---|
| 1 | #ifndef SHAREDMEMORY_H
|
|---|
| 2 | #define SHAREDMEMORY_H
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 | // Encapsulates a basic shared memory block. After creating,
|
|---|
| 6 | // the Data pointer can be used to read or write the data
|
|---|
| 7 | // in the memory.
|
|---|
| 8 |
|
|---|
| 9 | typedef struct
|
|---|
| 10 | {
|
|---|
| 11 | void* FPointer;
|
|---|
| 12 | BOOL FFirst; // true if this object created the shared mem block
|
|---|
| 13 | } TSharedMemory;
|
|---|
| 14 |
|
|---|
| 15 | APIRET GetSharedMemory( char* Name,
|
|---|
| 16 | ULONG Size,
|
|---|
| 17 | TSharedMemory* pSharedMemory );
|
|---|
| 18 |
|
|---|
| 19 | void ReleaseSharedMemory( TSharedMemory* pSharedMemory );
|
|---|
| 20 |
|
|---|
| 21 | // Encapsulates a shared memory block which can be suballocated
|
|---|
| 22 | // into smaller areas.
|
|---|
| 23 | // Allocate and Free are used to allocate these areas.
|
|---|
| 24 | // A space can be reserved for using as a normal shared mem block.
|
|---|
| 25 | // Otherwise the Data property should not be used.
|
|---|
| 26 |
|
|---|
| 27 | typedef struct
|
|---|
| 28 | {
|
|---|
| 29 | TSharedMemory FMem;
|
|---|
| 30 | void* FAllocationArea;
|
|---|
| 31 | } TSubAllocatedSharedMemory;
|
|---|
| 32 |
|
|---|
| 33 | APIRET GetSubAllocatedSharedMemory( char* Name,
|
|---|
| 34 | ULONG Size,
|
|---|
| 35 | ULONG ReserveSize, // size to reserve at start of memory
|
|---|
| 36 | TSubAllocatedSharedMemory* pSharedMemory );
|
|---|
| 37 |
|
|---|
| 38 | // suballocate space of the given size
|
|---|
| 39 | APIRET SubAllocate( TSubAllocatedSharedMemory* pSharedMemory,
|
|---|
| 40 | ULONG Size,
|
|---|
| 41 | void** p );
|
|---|
| 42 |
|
|---|
| 43 | // free the given space.
|
|---|
| 44 | void SubDeAllocate( TSubAllocatedSharedMemory* pSharedMemory,
|
|---|
| 45 | void** p );
|
|---|
| 46 |
|
|---|
| 47 | void ReleaseSubAllocatedSharedMemory( TSubAllocatedSharedMemory* pSharedMemory );
|
|---|
| 48 |
|
|---|
| 49 | APIRET OpenOrCreateMutex( PSZ pszName,
|
|---|
| 50 | PHMTX phmtx );
|
|---|
| 51 |
|
|---|
| 52 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.