User`s guide

Contents cxix
Allocate Communications Buffer—Function 123
This function allows the application to obtain exclusive control of a memory buffer to be used for read
and write structured field requests. A buffer address must be passed on to the functions that read and
write the structured field requests.
Prerequisite Functions
None.
WinHLLAPI(ALLOCCOMMBUFF,lpbyString,lpwLength,
lpwReturnnCode)
Parameter Description
Data String A 6-byte string with the following format:
Byte 1-2 16-bit buffer length requested.
(0<size<(64K-8)) or (0<size<X'FFF8')
Byte 3-6 Reserved.
Data Length Must be specified.
PS Position NA
Parameter Description
Data String A 6-byte string with the following format:
Byte 1-2 16-bit buffer length requested.
Byte 3-6 32-bit address of the allocated buffer.
Data Length NA (length of 8 is implied).
PS Position NA.
Code Description
WHLLOK The function was successful.
WHLLNOTCONNECTED An invalid presentation space was specified, or was not
connected for window services.
WHLLPARAMETERERROR An invalid option was specified.
WHLLSYSERROR The function failed due to a system error.
WHLLUNAVAILABLE The requested resource is not available.
The buffer address is placed in the returned parameter string. The requested buffer size, from 1 byte to
64K minus 8 bytes, is also in the parameter string. See the description of Query Communications
Buffer Size (122) for information regarding the size of the buffer.
Buffers obtained with this function cannot be shared among different processes. Applications that
attempt to share these buffers will experience unpredictable results.
Your Windows HLLAPI application must issue a Free Communications Buffer (124) function to free
the allocated memory for use by other programs.
The Reset System (21) function call frees any buffers allocated by this function.
No more than 10 buffers may be allocated to an application at one time.
Function Call
Call Parameters
Return Parameters
Return Codes
Remarks
Note