GW2RegisterImportMemory

Prev Next

The GW2RegisterImportMemory function registers the memory location containing the interchange file required for import. The interchange file is the zip file produced from the export process and the memory location is provided by GW2RegisterExportMemory. Using the GW2RegisterImportMemory function activates the Import Process Mode for the session.

#include "glasswall.core2.api.h"
int GW2RegisterImportMemory(Session session, char *importFileBuffer, size_t *importLength);

Parameters

โ€ƒ session The ID of the session as returned by GW2OpenSession

โ€ƒ importFileBuffer The memory location containing the interchange file required for import. The memory location is provided by GW2RegisterExportMemory.

โ€ƒ importLength The length of `importFileBuffer` in bytes.

Returns

Returns an integer indicating whether the function call was successful. Negative numbers indicate a failure. See the Return Types table for an explanation of the return codes.

Synopsis

public int RegisterImportMemory(
    int session,
    byte[] importFileBuffer)

Returns

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

Synopsis

import com.glasswall.core2javabridge.*;

public int GW2RegisterImportMemory(int session, byte[] importBuffer) throws GlasswallException, NullPointerException

public int GW2RegisterImportMemory(int session, byte[] importBuffer, int length) throws GlasswallException, NullPointerException

Note:

Please refer to API Overview for Return Types and valid enumerators for format.

The length of the fileBuffer may optionally be specified.

Returns

The GW2RegisterImportMemory function returns a GW2_RetStatus enumeration converted to int. The value will be negative if an error occurred. 0 indicates success.

Please refer to API Overview for Return Types and their details.

A GlasswallException exception will be thrown if session is invalid, or if the import buffer could not be retrieved.

A NullPointerException exception will be thrown if importBuffer buffer is null or empty.

Synopsis

Registers a .zip file to be imported for the given session. The constructed file will be created during the session's run_session call.

def register_import(self, session: int, input_file: Union[str, bytes, bytearray, io.BytesIO]):
    """ Registers a .zip file to be imported for the given session. The constructed file will be created during the session's run_session call.

    Args:
        session (int): The session integer.
        input_file (Union[str, bytes, bytearray, io.BytesIO]): The input import file path or bytes.

    Returns:
        gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attribute 'status' indicating the result of the function call. If output_file is None (memory mode), 'buffer', and 'buffer_length' are included containing the file content and file size.
    """

Returns

gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attribute 'status' indicating the result of the function call. If output_file is None (memory mode), 'buffer', and 'buffer_length' are included containing the file content and file size.

The status attribute is an integer GW2_RetStatus enum value. Negative numbers indicate a failure.

Synopsis

This function registers an import memory location against a specified session.

/**
* @param {number} session The ID of the session.
* @param {string} importFileBuffer A pointer to the specified memory location.
* @param {number} importLength The size of the file buffer.
*/

GW2RegisterImportMemory(session, import_File_Buffer, import_File_Buffer_Length)

Returns

The status attribute is an integer GW2_RetStatus enum value. Negative numbers indicate a failure.