<p>The licensing system API is an integral part of DogProtect API and its SDK. API allows you to specify a serial number and retrieve all information about it: whether it suits the program or not, is the serial number expired, the name this product is registered to and so on. Also, the API provides a hardware identifier of the computer the program runs on.</p><strongid=
<p>The input <strong>SerialNumber</strong> parameter must contain a pointer to a null-terminated string ('\0') containing a base-64 encoded serial number. The function returns a bit mask of serial number status flags, the same as the one <strong>DogProtectGetSerialNumberState()</strong> returns. You can read more about flags below. The serial number is "good" if the function returned 0.</p><br/>
<p>If at least one flag is set, there is a problem with the serial number. The program shouldn't work if at least one bit is set. The detailed description of flags and their values is listed in the table below:</p>
<tableborder="1"cellspacing="0"cellpadding="2">
<tr>
<th>Flag</th>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>SERIAL_STATE_FLAG_CORRUPTED</td>
<td>0x00000001</td>
<td>The licensing system is corrupted. Possible reasons are: incorrect setup of the protection project, cracking attempt.</td>
</tr>
<tr>
<td>SERIAL_STATE_FLAG_INVALID</td>
<td>0x00000002</td>
<td>The serial number is incorrect. The flag is set if the licensing system cannot decrypt the serial number.</td>
<td>Hardware identifier does not match the hardware identifier prescribed in the key.</td>
</tr>
<tr>
<td>SERIAL_STATE_FLAG_MAX_BUILD_EXPIRED</td>
<td>0x00000040</td>
<td>The serial number does not match the current version of the protected program. You can obtain the maximum build date of the program this serial number matches by calling
<strong>DogProtectSerialNumberData</strong> structure, where all necessary information will be written to. The second parameter is the size of the structure passed in the first parameter. It is required to control the structure's format. The function returns FALSE if the licensing system is corrupted (see the SERIAL_STATE_FLAG_CORRUPTED flag), if a zero address of the structure is provided or if the passed size of the structure is incorrect. In all other cases, the function returns TRUE and records all information about the serial number to the provided address. Below are the elements of the structure:</p>
<p>The first parameter is a pointer to a memory area where the identifier is written to. The second parameter is the size of this area. The function returns the number of bytes written inclusive of the trailing zero byte ('\0'). If NULL is provided in the first parameter, the function returns the number of bytes required to store the hardware identifier. Here is the correct way to use the function:</p>