ReadLockString - Read a data string that was written to memory with LockString

Top  Previous  Next

Syntax

 

<cString> := ReadLockString( <nAddress> )

 

Parameters

 

<nAddress>

 

Address of allocated memory block that was returned by LockString or LockNullString.

 

Return value

 

String found at <nAddress>.

 

Description

 

ReadLockString returns the data found in memory at address <nAddress> as a string. Unlike UnlockString it does not release the memory block. Use ReadLockString only with memory addresses that were returned by LockString or LockNullString.

 

If the locked string is of type STRINGTYPE_TEXT, STRINGTYPE_UNICODETEXT or STRINGTYPE_BINARY0, only the characters up to and not including the string terminator are read.

 

Classification

 

Core

 

Category

 

Pointers and Memory

 

Quick Info

 

Library: cckptcor.lib / cckptcor.dll

 

See also

 

LockString, LockNullString, LockStringLen, UnlockString, ReleaseLockString

 

Example

 

 

#INCLUDE "CockpitCoreLibs.ch"

 

FUNCTION Main

 

LOCAL address

 

* Allocate memory and fill it with zeroes

address := LockString("Here")

 

* Read the string

? ReadLockString( address )

 

* Release the allocated memory

ReleaseLockString( address )

 

RETURN NIL