ข้ามไปยังเนื้อหาหลัก

GW2RegisterLicenceFile

GW2RegisterLicenceFile ใช้ลงทะเบียนไฟล์ licence กับเซสชันหนึ่งรายการ

หากไม่มีการลงทะเบียนทั้ง GW2RegisterLicenceFile หรือ GW2RegisterLicenceMemory กับเซสชัน Editor จะพยายามค้นหา licence ในตำแหน่งเริ่มต้น โดยเป็นไฟล์ชื่อ gwkey.lic ที่อยู่ในโฟลเดอร์เดียวกับไลบรารีของ Editor หากไม่พบ ไลบรารีจะถือว่าไม่มี licence และบางกระบวนการอาจล้มเหลวเนื่องจากปัญหา licence หมดอายุ

สรุป

ฟังก์ชัน GW2RegisterLicenceFile จะร้องขอให้เซสชัน session ใช้ licence ที่ระบุไว้ในไฟล์ซึ่งมีชื่อเป็นสตริงที่ filename ชี้อยู่ Licence นี้จะถูกนำไปใช้กับการประมวลผลทั้งหมดที่ Glasswall ดำเนินการสำหรับเซสชันนั้น


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

ส่งกลับ

ส่งกลับค่า enum GW2_RetStatus แบบจำนวนเต็ม ตัวเลขติดลบหมายถึงล้มเหลว

ตัวอย่าง


#include "glasswall.core2.api.h"

HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
if (GW2RegisterLicenceFile(session, "gwkey.lic") < 0)
/* deal with error */
else
/* the file has been successfully registered */

...

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