Lewati ke konten utama

GW2RegisterInputMemory

Fungsi GW2RegisterInputMemory mendaftarkan file input yang disimpan di memori ke sebuah sesi.

Sinopsis

Fungsi GW2RegisterInputMemory mendaftarkan file yang disimpan dalam buffer yang ditunjuk oleh inputFileBuffer dengan ukuran inputLength byte, ke sesi yang ditandai oleh session.

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

Hasil pengembalian

Mengembalikan nilai enum GW2_RetStatus berupa integer. Angka negatif menunjukkan kegagalan.

Contoh

#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 */