Skip to main content
Version: 16.8.2

GW2RegisterPoliciesFile

The GW2RegisterPoliciesFile registers the content management policy XML file to a session.

If neither GW2RegisterPoliciesFile or GW2RegisterPoliciesMemory is registered with a session, the default policies will be applied to that session. The default policy sets all content management switches to Sanitise.

Synopsis

The GW2RegisterPoliciesFile function requests that session uses the policies specified in the file whose name is the string pointed to by filename. The format of the policies is in the format specified by format. The policies will be applied to all processing performed by Glasswall for that session.


#include "glasswall.core2.api.h"
int GW2RegisterPoliciesFile(Session session, const char *filename, Policy_format format);

Returns

Returns an integer GW2_RetStatus enum value. Negative numbers indicate a failure.

Example


#include "glasswall.core2.api.h"

HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
if (GW2RegisterPoliciesFile(session, "Office_Binary_Policies.xml", PF_XML) < 0)
/* deal with error */
else
/* the file has been successfully registered */

...

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