I'm trying to make use of a SecuGen Fingerprint scanner using Python, the SDK lib I'm using is sgfplib.dll
. I have a C++ program that makes use of this DLL and access the hardware using C++ and the very same DLL.
I can also access the device using the Windows Biometric Framework (winbio.dll
), Python and ctypes but this framework don't have the functionallity I need.
The thing is, using the sgfplib.dll
, after creation of the main library object I get a handle of the dll just fine, but anytime I try to call any other function I'll get an OSError: exception: access violation reading|writing 0x###########
.
I've searched both the site and google looking for similar errors but nothing seems close to my problem. I got the DLLs in my system32
folder and I also tried putting them in the scripts dir without any luck
The address in the error does change if I change the devname or if I call a diff function.
Can anyone point me in the right direction or provide some more info on this kind of errors?
Here's a min reproducible example:
import ctypes
from ctypes import wintypes
lib = ctypes.WinDLL(r"..\pathToTheDLLsDir\sgfplib.dll")
session_handle = ctypes.c_uint32()
devname = ctypes.wintypes.DWORD()
devname = "SG_DEV_FDU05" # 5
err = lib.SGFPM_Create(ctypes.byref(session_handle)) # create an SGFPM object and
print('CREATE', err) # 0 # return a handle to the object
err = lib.SGFPM_Init(ctypes.byref(session_handle), devname) # OSError: exception: access
print('INIT', err) # violation reading 0x00000000AFE3FB10