UniKey API Reference for C Language
Find a UniKey dongle
API Prototype
long UniKey_Find( WORD* pHandle ,
DWORD* pSetting1 ,
DWORD* pSetting2 ) ;
Description
Check if a specific UniKey is attached to the USB port. This is the first API to start a UniKey session.
Parameters
Parameter Meaning
*pHandle [out] Dongle handle
*pSetting1 *[in] Working Mode (UniKey PRO only), useless for UniKey STD
[out] Hardware ID
*pSetting2 *[in] Access Mode (UniKey PRO only), useless for UniKey STD(UniKey PRO only)
[out] Number of dongle attached , useless for UniKey STD
Return values
Marco Value Meaning
SUCCESS 0 Success
ERROR_UNIKEY_NO_UNIEKY 200 No UniKey dongle
Find the Next UniKey dongle
API Prototype
Long UniKey_Find_Next( WORD* pHandle ,
DWORD* pSetting1 ,
DWORD* pSetting2 ) ;
Description
Check if another UniKey is attached to the USB port.
Parameters
Parameter Meaning
*pHandle [out] Dongle handle
*pSetting1 *[in] Working Mode (UniKey PRO only), useless for UniKey STD
[out] Hardware ID
*pSetting2 *[in] Access Mode (UniKey PRO only), useless for UniKey STD(UniKeyPro only)
[out] Number of dongle attached , useless for UniKey STD
Return values
Marco Value Meaning
SUCCESS 0 Success
ERROR_UNIKEY_NOMORE 214 No more dongle
ERROR_UNIKEY_NEED_FIND 215 No Find before Find_Next
Logon UniKey Dongle
API Prototype
long UniKey_User_Logon( WORD* pHandle ,
WORD* pPassword1 ,
WORD* pPassword2 ) ;
-------------------------------------------------------------------------------------------
For UniKey Drive, the API Prototype is UniKey_User_Logon (WORD* pHandle, DWORD* pPassword1, DWORD* pPassword2);
-------------------------------------------------------------------------------------------
Description
Logon a UniKey dongle with specified passwords. This API should be called in the released software in order to improve security.
Parameters
Parameter Meaning
*pPassword1 [in]Password 1
*pPassword2 [in]Password 2
*pHandle [out] Dongle handle
Return values
Marco Value Meaning
SUCCESS 0 Success
ERROR_UNIKEY_NOT_FOUND 200 No UniKey dongle
ERROR_UNIKEY_INVALID_PASSWORD 201 UniKey dongle found, but Basic passwords are incorrect
ERROR_UNIKEY_INVALID_PASSWORD_OR_ID 202 Wrong password or UniKey HID
Logon UniKey Dongle in vendor mode
API Prototype
long UniKey_Vender_Logon( WORD* pHandle ,
WORD* pPassword1 ,
WORD* pPassword2 ,
WORD* pPassword3 ,
WORD* pPassword4 ) ;
---------------------------------------------------------------------------------------------------
For UniKey Drive, the API Prototype is UniKey_Vender_Logon(WORD* pHandle, DWORD* pPassword1, DWORD* pPassword2, DWORD* pPassword3, DWORD* pPassword4);
---------------------------------------------------------------------------------------------------
Description
Logon a UniKey dongle in vendor mode with specified passwords. This API helps software vendors to logon the UniKey dongle in vendor mode, and get the full permission to UniKey dongle.
---------------------------------------------------------------------------------------------------
We do NOT advise you to enclose this API in the final released software. This API is only for software vendor’s usage.
--------------------------------------------------------------------------------------------------
If password3 or password4 is wrong while password1 and password2 is correct, the dongle is also logged on in user mode automatically.
---------------------------------------------------------------------------------------------------
Parameters
Parameter Meaning
*pPassword1 [in]Password 1
*pPassword2 [in]Password 2
*pPassword3 [in]Password 3
*pPassword4 [in]Password 4
*pHandle [out] Dongle handle
Return values
Marco Value Meaning
SUCCESS 0 Success
ERROR_UNIKEY_NOT_FOUND 200 No UniKey dongle
ERROR_UNIKEY_INVALID_PASSWORD 201 Found UniKey dongle, but Basic passwords are incorrect
ERROR_UNIKEY_INVALID_PASSWORD_OR_ID 202 Wrong password or UniKey HID