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

GW2RegisterPoliciesMemory

GW2RegisterPoliciesMemory は、メモリ内に保持されたコンテンツ管理 policy XML ファイルをセッションに登録します。

GW2RegisterPoliciesFileGW2RegisterPoliciesMemory のいずれもセッションに登録されていない場合、そのセッションにはデフォルトの policy が適用されます。デフォルトの policy では、すべてのコンテンツ管理スイッチが Sanitise に設定されます。

概要

セッション session に対して、GW2RegisterPoliciesMemory 関数は、Glasswall がファイルを処理する際に使用する policies を登録します。policies は policies データへのポインター、policiesLength は policies データのサイズをバイト単位で指定し、policiesFormat は policies データの形式を指定します。


#include "glasswall.core2.api.h"
int GW2RegisterPoliciesMemory(Session session,
const char *policies,
size_t policiesLength,
Policy_format format);

戻り値

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


#include "glasswall.core2.api.h"

Session session = GW2OpenSession();
char *policies = NULL;
size_t size = 0;
if (!session)
/* deal with error */
else
{
/* ... load 'policies' with a pointer to the policies content ... */
if (GW2RegisterPoliciesMemory(session, policies, size, PF_XML) < 0)
/* deal with error */
else
/* continue processing */
}

. . .

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