UniKey API Reference for C Language: Difference between revisions

From SecuTech Wiki
Jump to navigationJump to search
Created page with "category:UniKey APIs == Find a UniKey dongle == API Prototype<br>long UniKey_Find( WORD* pHandle ,<br>DWORD* pSetting1 , <br>DWORD* pSetting2 ) ; Description<br>Chec..."
 
No edit summary
Line 2: Line 2:


== Find a UniKey dongle ==
== Find a UniKey dongle ==




Line 12: Line 11:


Return values<br>Marco Value Meaning<br>SUCCESS 0 Success<br>ERROR_UNIKEY_NO_UNIEKY 200 No UniKey dongle
Return values<br>Marco Value Meaning<br>SUCCESS 0 Success<br>ERROR_UNIKEY_NO_UNIEKY 200 No UniKey dongle


== Find the Next UniKey dongle  ==
== Find the Next UniKey dongle  ==

Revision as of 14:04, 10 April 2012


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