1 protect-u library file list, 2 protect-u library functions, 3 protect-u function parameters – Acrosser AR-B1673 User Manual
Page 37: Protect-u library

AR-B1673 User’s Guide
1. Protect-U library
1.1 PROTECT-U LIBRARY FILE LIST
Protect-U dynamic library files consist of four files:
1. ProtectU.dll
2. ProtectU.lib
3. boardsecu.h
4. DIO.sys
Two most important files are “ProtectU.dll” and “DIO.sys”. These two files must always be put in the same directory
as the user-application directory.
1.2 PROTECT-U LIBRARY FUNCTIONS
Protect-U library export 4(four) functions for user-application use. Those functions are:
a. InitSecuritySystem()
b. CheckId()
c. CloseSecuritySystem()
d. ReadStatus()
Three most important functions are “InitSecuritySystem()”, “CheckId”, and “CloseSecuritySystem()”.
“InitSecuritySystem()” is used to initialize and prepare the Protect-U security system. This function must be called
in the beginning of the application, before calling “CheckId()” or the application will not work.
“CheckId()” is the core command of Protect-U security system. User can call this function repeatedly any number
of times, anywhere between calling “InitSecuritySystem()” and calling “CloseSecuritySystem()”.
“CheckId” need two values for its input, one is Manufacture-Code and the other is “Serial-Number”. “CheckId()” will
compute if these two values match the values embedded in the computer-board, and will return 0(zero) when
succeed or other value when failed. Succeed means the board is the right board with the correct
Manufacture-Code and Serial-Number. The user application is free to decide what they will do after they receive
the result from “CheckId”.
“CloseSecuritySystem()” is used to close the Protect-U security system and return the resources to the
operating-system. This function must be called in the end of the application, after calling “CheckId()”.
“ReadStatus()” is used to help the programmer using Protect-U library to debug his/her application. The input for
“ReadStatus()” is the value returned by “CheckId()”. The output is a string which explain what is the result of calling
“CheckId()”.
1.3 PROTECT-U FUNCTION PARAMETERS
Function : void InitSecuritySystem(const int iobase = 0x200)
One optional input parameter, no return value. Input value is the IO-base address for Protect-U system.
Must be called before using CheckId().
Function : int CheckId(const char manufacture_code[], const char serial_number[])
Two input parameters, one return value. First input is a 16-byte length array-of-characters, second input is
a 7-byte length array-of-characters. The input values have to match the value embedded in the board
(please consult Acrosser if there’s any question). Specifically for Microsoft Visual Basic, just use String
value-type. Example :
In C/C++ language
: char ManufactureCode[16];
char
SerialNumber[7];
In Visual Basic : Dim ManufactureCode As String * 16
Dim SerialNumber As String * 7
Output is zero when CheckId() is correct, other values when error.
Function : void CloseSecuritySystem()
No input parameter, no return value. Must be called after using CheckId().
Function : void ReadStatus(char buffer[], const int status)
Two input parameters. First input is an empty array-of-characters with a minimal length of 50-byte
characters, second input is the value return by CheckId().
In C/C++ language
: char buffer[50];
int
status;
In Visual Basic : Dim buffer As String * 50
37