Langkau ke kandungan utama

GW2RegisterInputMemory

Fungsi GW2RegisterInputMemory mendaftarkan fail input yang disimpan dalam memori kepada satu sesi.

Sinopsis

Fungsi GW2RegisterInputMemory mendaftarkan fail yang disimpan dalam penimbal yang ditunjukkan oleh inputFileBuffer bersaiz inputLength bait, dengan sesi yang ditandakan oleh session.

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

Pulangan

Mengembalikan nilai enum integer GW2_RetStatus. Nombor 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 */