INtime SDK Help
CIMemory
This topic contains these sections:

The CIMemory class encapsulates the RT shared memory object; it allows sharing memory between RT and Windows applications. The CIMemory class is typically used as it is.

Class members

Constructor

Destructor

Create

GetPointer

GetSize

The following member variables are only available to the members of the class and its derived classes:

DWORD    m_dwLen;
PVOID    m_p;
BOOLEAN  m_bAllocated;

CIMemory::Constructor

The constructor has no arguments. It creates an unattached object.

CIMemory::Destructor

If the object is attached, the destructor detaches it; then it destroys the object.

CIMemory::Create

If the object is already attached, it is first detached. Then this call creates shared memory and attaches it to the object.

Syntax

DWORD CIMemory::Create(
    char * pszName, 
    DWORD dwLen,
    PVOID pAddr
);

Parameters

pszName
Specifies a name that, if not empty, is used to catalog the RT object.
dwLen
Indicates the number of bytes to be shared.
pAddr
Specifies the memory to be shared; if NULL or omitted, new memory is allocated. The result is a status indicating success or failure.

Status

E_OK
No exceptional conditions occurred.
E_MEM
There is not enough memory in the current process.
E_LIMIT
The current process reached its RT object limit, or the object directory is full.
E_SLOT
You cannot create more RT objects because the GDT is full.
E_CONTEXT
The object directory already contains the name being cataloged.
E_PARA
The name is too long or is improperly formatted.

CIMemory::GetPointer

With this call the thread obtains a pointer for addressing the memory.

Syntax

PVOID CIMemory::GetPointer(void);

The result is a pointer that can be used to address the memory (a type cast will be required), or NULL if the call fails.

Status

E_OK
No exceptional conditions occurred.
E_EXIST
The object is not attached.

CIMemory::GetSize

This call returns the size in bytes of the memory.

Syntax

DWORD CIMemory::GetSize(void);

The result is the number of bytes in the memory, or 0 if the call fails.

Status

E_OK
No exceptional conditions occurred.
E_EXIST
The object is not attached.
See Also

Memory