next up previous contents
Next: 6. Kernel PlugIn User-Mode Up: 5. General WD_xxx Functions Previous: 5.8 WD_Sleep()   Contents


5.9 WD_License()


PURPOSE

$\bullet$Transfers the license string to the WinDriver kernel module and returns information regarding the license type of the specified license string.

NOTE: 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 no need to call WD_License() directly.


PROTOTYPE

DWORD WD_License(
    HANDLE hWD,
    WD_LICENSE *pLicense);


PARAMETERS

Name Type Input/Output
$\bullet$hWD HANDLE Input
$\bullet$pLicense WD_LICENSE*  
$\gg$cLicense CHAR[] Input
$\gg$dwLicense DWORD Output
$\gg$dwLicense2 DWORD Output


DESCRIPTION

Name Description
hWD The handle to WinDriver's kernel-mode driver received from WD_Open() [5.2]
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)


RETURN VALUE

Returns WD_STATUS_SUCCESS (0) on success, or an appropriate error code otherwise [A].


REMARKS


EXAMPLE

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;
}