주요 콘텐츠로 건너뛰기

GW2RegisterPoliciesMemory

GW2RegisterPoliciesMemory는 메모리에 보관된 콘텐츠 관리 policy XML 파일을 세션에 등록합니다.

GW2RegisterPoliciesFile 또는 GW2RegisterPoliciesMemory 중 어느 것도 세션에 등록되지 않은 경우, 기본 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 enum 값을 반환합니다. 음수는 실패를 나타냅니다.

예제


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