Transfers the license string to the WinDriver kernel module and returns information regarding the license type of the specified license string.
![]() | |
When using the high-level WDC library APIs, described in the
WinDriver PCI Manual, the license registration is done via the
WDC_DriverOpen() function, so you do not need to call
WD_License() directly.
|
DWORD WD_License(
HANDLE hWD,
WD_LICENSE *pLicense);
| Name | Type | Input/Output |
|---|---|---|
| hWD | HANDLE | Input |
| pLicense | WD_LICENSE* | |
| • cLicense | CHAR[] | Input |
| • dwLicense | DWORD | Output |
| • dwLicense2 | DWORD | Output |
| Name | Description |
|---|---|
| hWD | Handle to WinDriver's kernel-mode driver as
received from WD_Open() |
| pLicense | Pointer to a WinDriver license information structure: |
| • cLicense |
A buffer to contain the license string that is to be transferred to the
WinDriver kernel module. If an empty string is transferred, then WinDriver kernel
module returns the current license type to the parameter
dwLicense.
|
| • dwLicense |
Returns the license type of the specified license string
(cLicnese). The return value is a bit-mask of license flags,
defined as an enum in windrvr.h. Zero
signifies an invalid license string. Additional flags for determining the
license type are returned in dwLicense2, if needed.
|
| • dwLicense2 |
Returns additional flags for determining the license type, if
dwLicense cannot hold all the relevant information
(otherwise — zero)
|
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate
error code otherwise
When using a registered version, this function must be called before any other
WinDriver API call, apart from WD_Open()
Example usage: Add registration routine to your application:
DWORD RegisterWinDriver()
{
HANDLE hWD;
WD_LICENSE lic;
DWORD dwStatus = WD_INVALID_HANDLE;
hWD = WD_Open();
if (hWD!=INVALID_HANDLE_VALUE)
{
BZERO(lic);
/* Replace the following string with your license string: */
strcpy(lic.cLicense, "12345abcde12345.CompanyName");
dwStatus = WD_License(hWD, &lic);
WD_Close(hWD);
}
return dwStatus;
}