//NetRockey4 ND dongle Delphi API
unit head;
interface
type
TRockey =  function( fun: Word ;var Handle:Word;var lp1,lp2:LongWord;
          var P1,P2,P3,P4:Word;var buf:Byte):Word;stdcall;

var
Rockey:TRockey;
const
RY_FIND                        	=1 ;		{Find Dongle}
RY_FIND_NEXT			        =2 ;		{Find Next Dongle}
RY_OPEN                        	=3 ;		{Open Dongle}
RY_CLOSE                       	=4 ;		{Close Dongle}
RY_READ                        	=5 ;		{Read Dongle}
RY_WRITE                       	=6 ;		{Write Dongle}
RY_RANDOM                      	=7 ;		{Generate Random Number}
RY_SEED                      	=8 ;		{Generate Seed Code}
RY_WRITE_USERID					=9 ;		{Write User ID}
RY_READ_USERID				   	=10;		{Read User ID}
RY_SET_MOUDLE		 			=11;		{Set Module}
RY_CHECK_MOUDLE		     		=12;		{Check Module}
RY_WRITE_ARITHMETIC            	=13;		{Write Arithmetic}
RY_CALCULATE1		       		=14;		{Calculate 1}
RY_CALCULATE2		       		=15;		{Calculate 2}
RY_CALCULATE3		       		=16;		{Calculate 3}
RY_DECREASE		       			=17;		{Decrease Module Unit}

{Error Code}
ERR_SUCCESS						=0;		{Success}
ERR_NO_PARALLEL_PORT			=1;		{No parallel port on the computer}
ERR_NO_DRIVER					=2;		{No install drivers}
ERR_NO_ROCKEY	                =3;		{No rockey dongle}
ERR_INVALID_PASSWORD			=4;		{Found rockey dongle, but base password is wrong}
ERR_INVALID_PASSWORD_OR_ID 		=5;		{Wrong password or rockey HID}
ERR_SETID						=6;		{Set rockey HID wrong}
ERR_INVALID_ADDR_OR_SIZE		=7;		{Read/Write address is wrong}
ERR_UNKNOWN_COMMAND        		=8;		{No such command}
ERR_NOTBELEVEL3		      		=9;		{Inside error}
ERR_READ						=10;	{Read error}
ERR_WRITE                  		=11;	{Write error}
ERR_RANDOM                 		=12;	{Random error}
ERR_SEED                   		=13;	{Seed Code error}
ERR_CALCULATE              		=14;	{Calculate error}
ERR_NO_OPEN						=15;	{No open dongle before operate dongle}
ERR_OPEN_OVERFLOW          		=16;	{Too more open dongle(>16)}
ERR_NOMORE						=17;	{No more dongle}
ERR_NEED_FIND					=18;	{No Find before FindNext}
ERR_DECREASE					=19;	{Decrease error}
ERR_AR_BADCOMMAND				=20;	{Arithmetic instruction error}
ERR_AR_UNKNOWN_OPCODE			=21;	{Arithmetic operator error}
ERR_AR_WRONGBEGIN				=22;	{Const number can't use on first arithmetic instruction}
ERR_AR_WRONG_END				=23;	{Const number can't use on last arithmetic instruction}
ERR_AR_VALUEOVERFLOW			=24;	{Const number > 63}
ERR_UNKNOWN						=$ffff;	{Unknown error}
ERR_RECEIVE_NULL				=$100;	{Receive null}
ERR_PRNPORT_BUSY				=$101;	{Parallel busy}

implementation

end.





