Skip to main content
Version: 16.9.0

GW2RegisterInputMemory

The GW2RegisterInputMemory function registers the input file which is stored in memory to a session.

Synopsis

The GW2RegisterInputMemory function registers the file which is stored in the buffer pointed to by inputFileBuffer of size inputLength bytes, with the session denoted by session.

#include "glasswall.core2.api.h"
int GW2RegisterInputMemory(Session session, const char *inputFileBuffer, size_t inputLength);

Returns

Returns an integer GW2_RetStatus enum value. Negative numbers indicate a failure.

Example

#include "glasswall.core2.api.h"
...
HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
{
/* ... load file contents into buffer 'buf' and log the file size in 'size' ... */
if (GW2RegisterInputMemory(session, buf, size))
/* deal with error */
else
/* continue processing */
...
}

/* later */
if (GW2CloseSession(session))
/* error closing session */