メイン コンテンツにスキップ

GW2RegisterInputMemory

GW2RegisterInputMemory 関数は、メモリに格納されている入力ファイルをセッションに登録します。

概要

GW2RegisterInputMemory 関数は、inputFileBuffer が指すバッファに格納された、サイズ inputLength バイトのファイルを、session. で示されるセッションに登録します。

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

戻り値

整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。

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