# xxxAllocateContext()

This function allocates a global memory block for a data context. A handle to this memory is returned to the structured access layer. The structured access layer passes this handle back to all reader entry points.

## Syntax

    void * pascal _export xxxAllocateContext(
        void                     *pSALContext,
        LPARAM (pascal *fp)(void *,
        UINT                      LPARAM),
        Bool                     *pbOpenDoc,
        TPVAPIServices           *pVapi,
        DWORD                     dwFlags)

## Arguments

`pSALContext` | A pointer to the global data context structure of the structured access layer.
`fp` | A pointer to a structure of callback functions supported by the structured access layer.
`pbOpenDoc` | You must set this `BOOL` value to `TRUE` if the allocation of memory for the global data context structure is successful.
`pVapi` | A pointer to a structure providing memory management and character conversion functions. Because this functionality is proprietary to Micro Focus, `TPVAPIServices` is redefined as `void` in `kvcfsr.h`.
`dwFlags` | Run-time flags controlled by the structured access layer.

## Returns

- Upon success, a pointer to the global data context structure for the custom reader. This pointer is passed back to all other custom reader entry points.
- Upon error, a `NULL` pointer. This causes the structured access layer to shut down the process.

## Discussion

The global context structure should be `memset()` to zero in this function.

© Copyright 2016-2020 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a mail client, and then send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm