!**************************************************************************************
!*  Copyright (c) 2003,Beijing Senselock Info & Secu Inc.
!*  All rights reserved.
!* 
!*  FileName:s4.fi
!*  Briefs:functions declaration and constant definitions of SenseLock Dll
!*
!*  Version:2.3
!*  Authore:chenying chen
!*  Date£º2004/03
!*
!*******************************************************************************************
	
	INTERFACE !lib = sense4.lib (+sense4.lib)
		INTEGER*4 FUNCTION	S4Enum(s4CtxList, dwListSize)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4Enum@8' :: S4Enum
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4Enum'   :: S4Enum
		!DEC$ ENDIF

		!DEC$ ATTRIBUTES REFERENCE :: s4CtxList
	    !DEC$ ATTRIBUTES REFERENCE :: dwListSize
		
		use s4module
	    type(SENSE4_CONTEXT) :: s4CtxList
 		INTEGER*4     dwListSize
		END function
	END INTERFACE
	
	INTERFACE !lib = sense4.lib (+sense4.lib)
		INTEGER*4 FUNCTION  S4Open(s4Ctx)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4Open@4' :: S4Open
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4Open'  :: S4Open
		!DEC$ ENDIF

		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		END function
	END INTERFACE

	INTERFACE !lib = sense4.lib (+sense4.lib)
		INTEGER*4 FUNCTION  S4Close(s4Ctx)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4Close@4' :: S4Close
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4Close'  :: S4Close
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		END function
	end interface

	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4Control(s4Ctx, &
									ctlCode, &
									inBuff, &
									inBuffLen, &
									outBuff, &
									outBuffLen, &
									lpBytesReturned)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4Control@28' :: S4Control
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4Control'  :: S4Control
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES VALUE :: ctlCode
		!DEC$ ATTRIBUTES REFERENCE :: inBuff
		!DEC$ ATTRIBUTES VALUE :: inBuffLen
		!DEC$ ATTRIBUTES REFERENCE :: outBuff
		!DEC$ ATTRIBUTES VALUE :: outBuffLen
		!DEC$ ATTRIBUTES REFERENCE :: lpBytesReturned
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		integer*4 ctlCode
		character      inBuff
		integer*4 inBuffLen
		BYTE	  outBuff
		integer*4 outBuffLen
		integer*4 lpBytesReturned
		end function
	end interface

	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4CreateDir(s4Ctx, &
										lpszDirID, &
										dwDirSize, &
										dwFlags)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4CreateDir@16' :: S4CreateDir
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4CreateDir'  :: S4CreateDir
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES REFERENCE :: lpszDirID
		!DEC$ ATTRIBUTES VALUE :: dwDirSize
		!DEC$ ATTRIBUTES VALUE :: dwFlags

		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		character*(*)   lpszDirID      
		integer*4		dwDirSize
		integer*4		dwFlags
		end function
	end interface

	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4ChangeDir(s4Ctx,lpszPath)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4ChangeDir@8' :: S4ChangeDir
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4ChangeDir'  :: S4ChangeDir
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES REFERENCE :: lpszPath
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		character*(*)   lpszPath      
		end function
	END INTERFACE

	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4EraseDir(s4Ctx,lpszDirID)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4EraseDir@8' :: S4EraseDir
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4EraseDir'  :: S4EraseDir
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES VALUE :: lpszDirID
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		integer   lpszDirID      
		end function
	END INTERFACE


	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4VerifyPin(s4Ctx, &
										lpPin, &
										dwPinLen, &
										dwPinType)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4VerifyPin@16' :: S4VerifyPin
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4VerifyPin'  :: S4VerifyPin
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES REFERENCE :: lpPin
		!DEC$ ATTRIBUTES VALUE :: dwPinLen
		!DEC$ ATTRIBUTES VALUE :: dwPinType
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		character		lpPin
		integer*4		dwPinLen
		integer*4		dwPinType      
		end function
	END INTERFACE



	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4ChangePin(s4Ctx, &
										lpOldPin, &
										dwOldPinLen, &
										lpNewPin, &
										dwNewPinLen, &
										dwPinType)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4ChangePin@24' :: S4ChangePin
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4ChangePin'  :: S4ChangePin
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES REFERENCE :: lpOldPin
		!DEC$ ATTRIBUTES VALUE :: dwOldPinLen
		!DEC$ ATTRIBUTES REFERENCE :: lpNewPin
		!DEC$ ATTRIBUTES VALUE :: dwNewPinLen
		!DEC$ ATTRIBUTES VALUE :: dwPinType
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		character		lpOldPin
		integer*4		dwOldPinLen
		character		lpNewPin
		integer*4		dwNewPinLen
		integer*4		dwPinType      
		end function
	END interface


	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4WriteFile(s4Ctx, &
										lpszFileID, &
										dwOffset, &
										lpBuffer, &
										dwBufferSize, &
										dwFileSize, &
										lpBytesWritten, &
										dwFlags, &
										bFileType)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4WriteFile@36' :: S4WriteFile
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4WriteFile'  :: S4WriteFile
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES REFERENCE :: lpszFileID
		!DEC$ ATTRIBUTES VALUE :: dwOffset
		!DEC$ ATTRIBUTES REFERENCE :: lpBuffer
		!DEC$ ATTRIBUTES VALUE :: dwBufferSize
		!DEC$ ATTRIBUTES VALUE :: dwFileSize
		!DEC$ ATTRIBUTES REFERENCE :: lpBytesWritten
		!DEC$ ATTRIBUTES VALUE :: dwFlags
		!DEC$ ATTRIBUTES VALUE :: bFileType
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		character*(*)	lpszFileID
		integer*4		dwOffset
		character		lpBuffer
		integer*4		dwBufferSize
		integer*4		dwFileSize
		integer*4		lpBytesWritten
		integer*4		dwFlags
		BYTE			bFileType      
		end function
	END INTERFACE


	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4Execute(s4Ctx, &
									lpszFileID, &
									lpInBuffer, &
									dwInbufferSize, &
									lpOutBuffer, &
									dwOutBufferSize, &
									lpBytesReturned)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4Execute@28' :: S4Execute
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4Execute'  :: S4Execute
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES REFERENCE :: lpszFileID
		!DEC$ ATTRIBUTES REFERENCE :: lpInBuffer
		!DEC$ ATTRIBUTES VALUE :: dwInbufferSize
		!DEC$ ATTRIBUTES REFERENCE :: lpOutBuffer
		!DEC$ ATTRIBUTES VALUE :: dwOutBufferSize
		!DEC$ ATTRIBUTES REFERENCE :: lpBytesReturned
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		character*(*)	lpszFileID
		character			lpInBuffer
		integer*4		dwInBufferSize
		character			lpOutBuffer
		integer*4		dwOutBufferSize
		integer*4		lpBytesReturned
		end function
	END INTERFACE

	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4ExecuteEx(s4Ctx, &
									lpszFileID, &
									dwFlag, &
									lpInBuffer, &
									dwInbufferSize, &
									lpOutBuffer, &
									dwOutBufferSize, &
									lpBytesReturned)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4ExecuteEx@32' :: S4ExecuteEx
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4ExecuteEx'  :: S4ExecuteEx
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES REFERENCE :: lpszFileID
		!DEC$ ATTRIBUTES VALUE :: dwFlag
		!DEC$ ATTRIBUTES REFERENCE :: lpInBuffer
		!DEC$ ATTRIBUTES VALUE :: dwInbufferSize
		!DEC$ ATTRIBUTES REFERENCE :: lpOutBuffer
		!DEC$ ATTRIBUTES VALUE :: dwOutBufferSize
		!DEC$ ATTRIBUTES REFERENCE :: lpBytesReturned
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		character*(*)	lpszFileID
		integer*4	dwFlag
		character			lpInBuffer
		integer*4		dwInBufferSize
		character			lpOutBuffer
		integer*4		dwOutBufferSize
		integer*4		lpBytesReturned
		end function
	END INTERFACE


	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4CreateDirEx(s4Ctx, &
									lpszFileID, &
									dwDirSize, &
									dwFlags, &
									pCreateDirInfo)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4CreateDirEx@20' :: S4CreateDirEx
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4CreateDirEx'  :: S4CreateDirEx
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES REFERENCE :: lpszFileID
		!DEC$ ATTRIBUTES vALUE :: dwDirSize
		!DEC$ ATTRIBUTES VALUE :: dwFlags
		!DEC$ ATTRIBUTES REFERENCE :: pCreateDirInfo
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		character*(*)	lpszFileID
		integer*4	dwDirSize
		integer*4	dwFlags
	   type(S4CREATEDIRINFO):: pCreateDirInfo
		end function
	END INTERFACE


	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4OpenEx(s4Ctx, &
						pS4OpenInfo)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4OpenEx@8' :: S4OpenEx
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4OpenEx'  :: S4OpenEx
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES REFERENCE :: pS4OpenInfo
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
	    type(S4OPENINFO):: pS4OpenInfo
		end function
	END INTERFACE
	

	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function S4Startup()
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4Startup@0' :: S4Startup
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4Startup'  :: S4Startup
		!DEC$ ENDIF
		use s4module
		end function
	END INTERFACE	

	interface !lib = sense4.lib (+sense4.lib)
	integer*4  function S4Cleanup()
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_S4Cleanup@0' :: S4Cleanup
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'S4Cleanup'  :: S4Cleanup
		!DEC$ ENDIF
		use s4module
		end function
	END INTERFACE	

	interface !lib = sense4.lib (+sense4.lib)
		integer*4  function PS4WriteFile(s4Ctx, &
										lpszFileID, &
										lpszPCFilePath, &
										lpdwFileSize, &
										dwFlags, &
										dwFileType, &
										lpdwBytesWritten)
		!DEC$ IF DEFINED(_X86_)
		!DEC$ ATTRIBUTES STDCALL, ALIAS : '_PS4WriteFile@28' :: PS4WriteFile
		!DEC$ ELSE
		!DEC$ ATTRIBUTES STDCALL, ALIAS :  'PS4WriteFile'  :: PS4WriteFile
		!DEC$ ENDIF
		!DEC$ ATTRIBUTES REFERENCE :: s4Ctx
		!DEC$ ATTRIBUTES REFERENCE :: lpszFileID
		!DEC$ ATTRIBUTES REFERENCE :: lpszPCFilePath
		!DEC$ ATTRIBUTES REFERENCE :: lpdwFileSize		
		!DEC$ ATTRIBUTES VALUE :: dwFlags
		!DEC$ ATTRIBUTES VALUE :: dwFileType
		!DEC$ ATTRIBUTES REFERENCE :: lpdwBytesWritten		
		use s4module
	    type(SENSE4_CONTEXT) :: s4Ctx
		character*(*)		lpszFileID
		character*(*)		lpszPCFilePath
		integer*4		lpdwFileSize		
		integer*4		dwFlags
		integer*4		dwFileType 
	  	integer*4		lpdwBytesWritten    
		end function
	END INTERFACE	