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

GW2RegisterLicenceMemory

GW2RegisterLicenceMemory は、メモリ内に保持された licence file をセッションに登録します。

GW2RegisterLicenceFileGW2RegisterLicenceMemory のいずれもセッションに登録されていない場合、Editor はデフォルトの場所でライセンスを検索しようとします。これは Editor library と同じフォルダーにある gwkey.lic というファイルです。これが見つからない場合、library はライセンス未登録と見なされ、一部の処理がライセンス有効期限の問題により失敗する可能性があります。

概要

セッション session に対して、GW2RegisterLicenceMemory 関数は、Glasswall がファイルを処理する際に使用する licence を登録します。licenceContents は licence データへのポインタであり、licenceLength は licence データのサイズをバイト単位で指定します。


#include "glasswall.core2.api.h"
int GW2RegisterLicenceMemory(Session session,
const char *licenceContents,
size_t licenceLength);

戻り値

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


#include "glasswall.core2.api.h"

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

. . .

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