#
#  dtwainapi.py
# 
#  This file is part of the Dynarithmic TWAIN Library (DTWAIN).                          
#  Copyright (c) 2002-2026 Dynarithmic Software.                                         
#                                                                                        
#  Licensed under the Apache License, Version 2.0 (the "License");                       
#  you may not use this file except in compliance with the License.                      
#  You may obtain a copy of the License at                                               
#                                                                                        
#      http://www.apache.org/licenses/LICENSE-2.0                                        
#                                                                                        
#  Unless required by applicable law or agreed to in writing, software                   
#  distributed under the License is distributed on an "AS IS" BASIS,                     
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.              
#  See the License for the specific language governing permissions and                   
#  limitations under the License.                                                        
#                                                                                        
#  FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY                   
#  DYNARITHMIC SOFTWARE. DYNARITHMIC SOFTWARE DISCLAIMS THE WARRANTY OF NON INFRINGEMENT 
#  OF THIRD PARTY RIGHTS.                                                                
# 

import ctypes as ct
import struct 
import os

import ctypes

# --- Basic TWAIN types ---
TW_UINT16 = ct.c_uint16
TW_UINT32 = ct.c_uint32
TW_INT16  = ct.c_int16

TW_STR32 = ct.c_char * 34  # TW_STR32 is 34 bytes

# --- TW_VERSION ---
class TW_VERSION(ct.Structure):
    _pack_ = 1
    _fields_ = [
        ("MajorNum", TW_UINT16),
        ("MinorNum", TW_UINT16),
        ("Language", TW_UINT16),
        ("Country",  TW_UINT16),
        ("Info",     ct.c_char * 34),
    ]

# --- TW_IDENTITY ---
class TW_IDENTITY(ct.Structure):
    _pack_ = 1
    _fields_ = [
        ("Id",              TW_UINT32),
        ("Version",         TW_VERSION),
        ("ProtocolMajor",   TW_UINT16),
        ("ProtocolMinor",   TW_UINT16),
        ("SupportedGroups", TW_UINT32),
        ("Manufacturer",    TW_STR32),
        ("ProductFamily",   TW_STR32),
        ("ProductName",     TW_STR32),
    ]

DTWAIN_FF_TIFF = 0
DTWAIN_FF_PICT = 1
DTWAIN_FF_BMP = 2
DTWAIN_FF_XBM = 3
DTWAIN_FF_JFIF = 4
DTWAIN_FF_FPX = 5
DTWAIN_FF_TIFFMULTI = 6
DTWAIN_FF_PNG = 7
DTWAIN_FF_SPIFF = 8
DTWAIN_FF_EXIF = 9
DTWAIN_FF_PDF = 10
DTWAIN_FF_JP2 = 11
DTWAIN_FF_JPX = 13
DTWAIN_FF_DEJAVU = 14
DTWAIN_FF_PDFA = 15
DTWAIN_FF_PDFA2 = 16
DTWAIN_FF_PDFRASTER = 17
DTWAIN_CP_NONE = 0
DTWAIN_CP_PACKBITS = 1
DTWAIN_CP_GROUP31D = 2
DTWAIN_CP_GROUP31DEOL = 3
DTWAIN_CP_GROUP32D = 4
DTWAIN_CP_GROUP4 = 5
DTWAIN_CP_JPEG = 6
DTWAIN_CP_LZW = 7
DTWAIN_CP_JBIG = 8
DTWAIN_CP_PNG = 9
DTWAIN_CP_RLE4 = 10
DTWAIN_CP_RLE8 = 11
DTWAIN_CP_BITFIELDS = 12
DTWAIN_CP_ZIP = 13
DTWAIN_CP_JPEG2000 = 14
DTWAIN_FS_NONE = 0
DTWAIN_FS_A4LETTER = 1
DTWAIN_FS_B5LETTER = 2
DTWAIN_FS_USLETTER = 3
DTWAIN_FS_USLEGAL = 4
DTWAIN_FS_A5 = 5
DTWAIN_FS_B4 = 6
DTWAIN_FS_B6 = 7
DTWAIN_FS_USLEDGER = 9
DTWAIN_FS_USEXECUTIVE = 10
DTWAIN_FS_A3 = 11
DTWAIN_FS_B3 = 12
DTWAIN_FS_A6 = 13
DTWAIN_FS_C4 = 14
DTWAIN_FS_C5 = 15
DTWAIN_FS_C6 = 16
DTWAIN_FS_4A0 = 17
DTWAIN_FS_2A0 = 18
DTWAIN_FS_A0 = 19
DTWAIN_FS_A1 = 20
DTWAIN_FS_A2 = 21
DTWAIN_FS_A4 = DTWAIN_FS_A4LETTER
DTWAIN_FS_A7 = 22
DTWAIN_FS_A8 = 23
DTWAIN_FS_A9 = 24
DTWAIN_FS_A10 = 25
DTWAIN_FS_ISOB0 = 26
DTWAIN_FS_ISOB1 = 27
DTWAIN_FS_ISOB2 = 28
DTWAIN_FS_ISOB3 = DTWAIN_FS_B3
DTWAIN_FS_ISOB4 = DTWAIN_FS_B4
DTWAIN_FS_ISOB5 = 29
DTWAIN_FS_ISOB6 = DTWAIN_FS_B6
DTWAIN_FS_ISOB7 = 30
DTWAIN_FS_ISOB8 = 31
DTWAIN_FS_ISOB9 = 32
DTWAIN_FS_ISOB10 = 33
DTWAIN_FS_JISB0 = 34
DTWAIN_FS_JISB1 = 35
DTWAIN_FS_JISB2 = 36
DTWAIN_FS_JISB3 = 37
DTWAIN_FS_JISB4 = 38
DTWAIN_FS_JISB5 = DTWAIN_FS_B5LETTER
DTWAIN_FS_JISB6 = 39
DTWAIN_FS_JISB7 = 40
DTWAIN_FS_JISB8 = 41
DTWAIN_FS_JISB9 = 42
DTWAIN_FS_JISB10 = 43
DTWAIN_FS_C0 = 44
DTWAIN_FS_C1 = 45
DTWAIN_FS_C2 = 46
DTWAIN_FS_C3 = 47
DTWAIN_FS_C7 = 48
DTWAIN_FS_C8 = 49
DTWAIN_FS_C9 = 50
DTWAIN_FS_C10 = 51
DTWAIN_FS_USSTATEMENT = 52
DTWAIN_FS_BUSINESSCARD = 53
DTWAIN_ANYSUPPORT = (-1)
DTWAIN_BMP = 100
DTWAIN_JPEG = 200
DTWAIN_PDF = 250
DTWAIN_PDFMULTI = 251
DTWAIN_PCX = 300
DTWAIN_DCX = 301
DTWAIN_TGA = 400
DTWAIN_TIFFLZW = 500
DTWAIN_TIFFNONE = 600
DTWAIN_TIFFG3 = 700
DTWAIN_TIFFG4 = 800
DTWAIN_TIFFPACKBITS = 801
DTWAIN_TIFFDEFLATE = 802
DTWAIN_TIFFJPEG = 803
DTWAIN_TIFFJBIG = 804
DTWAIN_TIFFPIXARLOG = 805
DTWAIN_TIFFNONEMULTI = 900
DTWAIN_TIFFG3MULTI = 901
DTWAIN_TIFFG4MULTI = 902
DTWAIN_TIFFPACKBITSMULTI = 903
DTWAIN_TIFFDEFLATEMULTI = 904
DTWAIN_TIFFJPEGMULTI = 905
DTWAIN_TIFFLZWMULTI = 906
DTWAIN_TIFFJBIGMULTI = 907
DTWAIN_TIFFPIXARLOGMULTI = 908
DTWAIN_WMF = 850
DTWAIN_EMF = 851
DTWAIN_GIF = 950
DTWAIN_PNG = 1000
DTWAIN_PSD = 2000
DTWAIN_JPEG2000 = 3000
DTWAIN_POSTSCRIPT1 = 4000
DTWAIN_POSTSCRIPT2 = 4001
DTWAIN_POSTSCRIPT3 = 4002
DTWAIN_POSTSCRIPT1MULTI = 4003
DTWAIN_POSTSCRIPT2MULTI = 4004
DTWAIN_POSTSCRIPT3MULTI = 4005
DTWAIN_TEXT = 6000
DTWAIN_TEXTMULTI = 6001
DTWAIN_TIFFMULTI = 7000
DTWAIN_ICO = 8000
DTWAIN_ICO_VISTA = 8001
DTWAIN_ICO_RESIZED = 8002
DTWAIN_WBMP = 8500
DTWAIN_WEBP = 8501
DTWAIN_PPM = 10000
DTWAIN_WBMP_RESIZED = 11000
DTWAIN_TGA_RLE = 11001
DTWAIN_BMP_RLE = 11002
DTWAIN_BIGTIFFLZW = 11003
DTWAIN_BIGTIFFLZWMULTI = 11004
DTWAIN_BIGTIFFNONE = 11005
DTWAIN_BIGTIFFNONEMULTI = 11006
DTWAIN_BIGTIFFPACKBITS = 11007
DTWAIN_BIGTIFFPACKBITSMULTI = 11008
DTWAIN_BIGTIFFDEFLATE = 11009
DTWAIN_BIGTIFFDEFLATEMULTI = 11010
DTWAIN_BIGTIFFG3 = 11011
DTWAIN_BIGTIFFG3MULTI = 11012
DTWAIN_BIGTIFFG4 = 11013
DTWAIN_BIGTIFFG4MULTI = 11014
DTWAIN_BIGTIFFJPEG = 11015
DTWAIN_BIGTIFFJPEGMULTI = 11016
DTWAIN_JPEGXR = 12000
DTWAIN_SVG = 13000
DTWAIN_SVGZ = 13001
DTWAIN_INCHES = 0
DTWAIN_CENTIMETERS = 1
DTWAIN_PICAS = 2
DTWAIN_POINTS = 3
DTWAIN_TWIPS = 4
DTWAIN_PIXELS = 5
DTWAIN_MILLIMETERS = 6
DTWAIN_USENAME = 16
DTWAIN_USEPROMPT = 32
DTWAIN_USELONGNAME = 64
DTWAIN_USESOURCEMODE = 128
DTWAIN_USELIST = 256
DTWAIN_CREATE_DIRECTORY = 512
DTWAIN_NODELETEDIBS = 1024
DTWAIN_CREATEDIRECTORY = DTWAIN_CREATE_DIRECTORY
DTWAIN_ARRAYANY = 1
DTWAIN_ArrayTypePTR = 1
DTWAIN_ARRAYLONG = 2
DTWAIN_ARRAYFLOAT = 3
DTWAIN_ARRAYHANDLE = 4
DTWAIN_ARRAYSOURCE = 5
DTWAIN_ARRAYSTRING = 6
DTWAIN_ARRAYFRAME = 7
DTWAIN_ARRAYBOOL = DTWAIN_ARRAYLONG
DTWAIN_ARRAYLONGSTRING = 8
DTWAIN_ARRAYUNICODESTRING = 9
DTWAIN_ARRAYLONG64 = 10
DTWAIN_ARRAYANSISTRING = 11
DTWAIN_ARRAYWIDESTRING = 12
DTWAIN_ARRAYULONG = 13
DTWAIN_ARRAYTWFIX32 = 200
DTWAIN_ArrayTypeINVALID = 0
DTWAIN_ARRAYINT16 = 100
DTWAIN_ARRAYUINT16 = 110
DTWAIN_ARRAYUINT32 = 120
DTWAIN_ARRAYINT32 = 130
DTWAIN_ARRAYINT64 = 140
DTWAIN_ARRAYUINT64 = 150
DTWAIN_ARRAYSHORTINT16 = 160
DTWAIN_ARRAYSHORTUINT16 = 170
DTWAIN_RANGELONG = DTWAIN_ARRAYLONG
DTWAIN_RANGEFLOAT = DTWAIN_ARRAYFLOAT
DTWAIN_RANGEMIN = 0
DTWAIN_RANGEMAX = 1
DTWAIN_RANGESTEP = 2
DTWAIN_RANGEDEFAULT = 3
DTWAIN_RANGECURRENT = 4
DTWAIN_FRAMELEFT = 0
DTWAIN_FRAMETOP = 1
DTWAIN_FRAMERIGHT = 2
DTWAIN_FRAMEBOTTOM = 3
DTWAIN_FIX32WHOLE = 0
DTWAIN_FIX32FRAC = 1
DTWAIN_JC_NONE = 0
DTWAIN_JC_JSIC = 1
DTWAIN_JC_JSIS = 2
DTWAIN_JC_JSXC = 3
DTWAIN_JC_JSXS = 4
DTWAIN_CAPDATATYPE_UNKNOWN = (-10)
DTWAIN_JCBP_JSIC = 5
DTWAIN_JCBP_JSIS = 6
DTWAIN_JCBP_JSXC = 7
DTWAIN_JCBP_JSXS = 8
DTWAIN_FEEDPAGEON = 1
DTWAIN_CLEARPAGEON = 2
DTWAIN_REWINDPAGEON = 4
DTWAIN_AppOwnsDib = 1
DTWAIN_SourceOwnsDib = 2
DTWAIN_CONTARRAY = 8
DTWAIN_CONTENUMERATION = 16
DTWAIN_CONTONEVALUE = 32
DTWAIN_CONTRANGE = 64
DTWAIN_CONTDEFAULT = 0
DTWAIN_CAPGET = 1
DTWAIN_CAPGETCURRENT = 2
DTWAIN_CAPGETDEFAULT = 3
DTWAIN_CAPSET = 6
DTWAIN_CAPRESET = 7
DTWAIN_CAPRESETALL = 8
DTWAIN_CAPSETAVAILABLE = 8
DTWAIN_CAPSETCURRENT = 16
DTWAIN_CAPGETHELP = 9
DTWAIN_CAPGETLABEL = 10
DTWAIN_CAPGETLABELENUM = 11
DTWAIN_CAPSETCONSTRAINT = 12
DTWAIN_AREASET = DTWAIN_CAPSET
DTWAIN_AREARESET = DTWAIN_CAPRESET
DTWAIN_AREACURRENT = DTWAIN_CAPGETCURRENT
DTWAIN_AREADEFAULT = DTWAIN_CAPGETDEFAULT
DTWAIN_VER15 = 0
DTWAIN_VER16 = 1
DTWAIN_VER17 = 2
DTWAIN_VER18 = 3
DTWAIN_VER20 = 4
DTWAIN_VER21 = 5
DTWAIN_VER22 = 6
DTWAIN_ACQUIREALL = (-1)
DTWAIN_MAXACQUIRE = (-1)
DTWAIN_DX_NONE = 0
DTWAIN_DX_1PASSDUPLEX = 1
DTWAIN_DX_2PASSDUPLEX = 2
DTWAIN_PT_BW = 0
DTWAIN_PT_GRAY = 1
DTWAIN_PT_RGB = 2
DTWAIN_PT_PALETTE = 3
DTWAIN_PT_CMY = 4
DTWAIN_PT_CMYK = 5
DTWAIN_PT_YUV = 6
DTWAIN_PT_YUVK = 7
DTWAIN_PT_CIEXYZ = 8
DTWAIN_PT_DEFAULT = 1000
DTWAIN_CURRENT = (-2)
DTWAIN_DEFAULT = (-1)
DTWAIN_FLOATDEFAULT = (-9999.0)
DTWAIN_CallbackERROR = 1
DTWAIN_CallbackMESSAGE = 2
DTWAIN_USENATIVE = 1
DTWAIN_USEBUFFERED = 2
DTWAIN_USECOMPRESSION = 4
DTWAIN_USEMEMFILE = 8
DTWAIN_FAILURE1 = (-1)
DTWAIN_FAILURE2 = (-2)
DTWAIN_DELETEALL = (-1)
DTWAIN_TN_ACQUIREDONE = 1000
DTWAIN_TN_ACQUIREFAILED = 1001
DTWAIN_TN_ACQUIRECANCELLED = 1002
DTWAIN_TN_ACQUIRESTARTED = 1003
DTWAIN_TN_PAGECONTINUE = 1004
DTWAIN_TN_PAGEFAILED = 1005
DTWAIN_TN_PAGECANCELLED = 1006
DTWAIN_TN_TRANSFERREADY = 1009
DTWAIN_TN_TRANSFERDONE = 1010
DTWAIN_TN_ACQUIREPAGEDONE = 1010
DTWAIN_TN_UICLOSING = 3000
DTWAIN_TN_UICLOSED = 3001
DTWAIN_TN_UIOPENED = 3002
DTWAIN_TN_UIOPENING = 3003
DTWAIN_TN_UIOPENFAILURE = 3004
DTWAIN_TN_CLIPTRANSFERDONE = 1014
DTWAIN_TN_INVALIDIMAGEFORMAT = 1015
DTWAIN_TN_ACQUIRETERMINATED = 1021
DTWAIN_TN_TRANSFERSTRIPREADY = 1022
DTWAIN_TN_TRANSFERSTRIPDONE = 1023
DTWAIN_TN_TRANSFERSTRIPFAILED = 1029
DTWAIN_TN_IMAGEINFOERROR = 1024
DTWAIN_TN_TRANSFERCANCELLED = 1030
DTWAIN_TN_FILESAVECANCELLED = 1031
DTWAIN_TN_FILESAVEOK = 1032
DTWAIN_TN_FILESAVEERROR = 1033
DTWAIN_TN_FILEPAGESAVEOK = 1034
DTWAIN_TN_FILEPAGESAVEERROR = 1035
DTWAIN_TN_PROCESSEDDIB = 1036
DTWAIN_TN_FEEDERLOADED = 1037
DTWAIN_TN_GENERALERROR = 1038
DTWAIN_TN_MANDUPFLIPPAGES = 1040
DTWAIN_TN_MANDUPSIDE1DONE = 1041
DTWAIN_TN_MANDUPSIDE2DONE = 1042
DTWAIN_TN_MANDUPPAGECOUNTERROR = 1043
DTWAIN_TN_MANDUPACQUIREDONE = 1044
DTWAIN_TN_MANDUPSIDE1START = 1045
DTWAIN_TN_MANDUPSIDE2START = 1046
DTWAIN_TN_MANDUPMERGEERROR = 1047
DTWAIN_TN_MANDUPMEMORYERROR = 1048
DTWAIN_TN_MANDUPFILEERROR = 1049
DTWAIN_TN_MANDUPFILESAVEERROR = 1050
DTWAIN_TN_ENDOFJOBDETECTED = 1051
DTWAIN_TN_EOJDETECTED = 1051
DTWAIN_TN_EOJDETECTED_XFERDONE = 1052
DTWAIN_TN_QUERYPAGEDISCARD = 1053
DTWAIN_TN_PAGEDISCARDED = 1054
DTWAIN_TN_PROCESSDIBACCEPTED = 1055
DTWAIN_TN_PROCESSDIBFINALACCEPTED = 1056
DTWAIN_TN_CLOSEDIBFAILED = 1057
DTWAIN_TN_INVALID_TWAINDSM2_BITMAP = 1058
DTWAIN_TN_IMAGE_RESAMPLE_FAILURE = 1059
DTWAIN_TN_DEVICEEVENT = 1100
DTWAIN_TN_TWAINPAGECANCELLED = 1105
DTWAIN_TN_TWAINPAGEFAILED = 1106
DTWAIN_TN_APPUPDATEDDIB = 1107
DTWAIN_TN_FILEPAGESAVING = 1110
DTWAIN_TN_EOJBEGINFILESAVE = 1112
DTWAIN_TN_EOJENDFILESAVE = 1113
DTWAIN_TN_CROPFAILED = 1120
DTWAIN_TN_PROCESSEDDIBFINAL = 1121
DTWAIN_TN_BLANKPAGEDETECTED1 = 1130
DTWAIN_TN_BLANKPAGEDETECTED2 = 1131
DTWAIN_TN_BLANKPAGEDETECTED3 = 1132
DTWAIN_TN_BLANKPAGEDISCARDED1 = 1133
DTWAIN_TN_BLANKPAGEDISCARDED2 = 1134
DTWAIN_TN_OCRTEXTRETRIEVED = 1140
DTWAIN_TN_QUERYOCRTEXT = 1141
DTWAIN_TN_PDFOCRREADY = 1142
DTWAIN_TN_PDFOCRDONE = 1143
DTWAIN_TN_PDFOCRERROR = 1144
DTWAIN_TN_SETCALLBACKINIT = 1150
DTWAIN_TN_SETCALLBACK64INIT = 1151
DTWAIN_TN_FILENAMECHANGING = 1160
DTWAIN_TN_FILENAMECHANGED = 1161
DTWAIN_TN_PROCESSEDAUDIOFINAL = 1180
DTWAIN_TN_PROCESSAUDIOFINALACCEPTED = 1181
DTWAIN_TN_PROCESSEDAUDIOFILE = 1182
DTWAIN_TN_TWAINTRIPLETBEGIN = 1183
DTWAIN_TN_TWAINTRIPLETEND = 1184
DTWAIN_TN_FEEDERNOTLOADED = 1201
DTWAIN_TN_FEEDERTIMEOUT = 1202
DTWAIN_TN_FEEDERNOTENABLED = 1203
DTWAIN_TN_FEEDERNOTSUPPORTED = 1204
DTWAIN_TN_FEEDERTOFLATBED = 1205
DTWAIN_TN_PREACQUIRESTART = 1206
DTWAIN_TN_TRANSFERTILEREADY = 1300
DTWAIN_TN_TRANSFERTILEDONE = 1301
DTWAIN_TN_FILECOMPRESSTYPEMISMATCH = 1302
DTWAIN_TN_SOURCEDETAILS = 1304
DTWAIN_TN_QUERYACQUIREPAGES = 1305
DTWAIN_TN_ACQUIREPAGESSTOPPING = 1306
DTWAIN_TN_ACQUIREPAGESSTOPPED = 1307
DTWAIN_TN_QUERYUPDATEDIBORIG = 1308
DTWAIN_TN_QUERYUPDATEDIBRESAMPLED = 1309
DTWAIN_PDFOCR_CLEANTEXT1 = 1
DTWAIN_PDFOCR_CLEANTEXT2 = 2
DTWAIN_MODAL = 0
DTWAIN_MODELESS = 1
DTWAIN_UIModeCLOSE = 0
DTWAIN_UIModeOPEN = 1
DTWAIN_REOPEN_SOURCE = 2
DTWAIN_ROUNDNEAREST = 0
DTWAIN_ROUNDUP = 1
DTWAIN_ROUNDDOWN = 2
DTWAIN_FLOATDELTA = (+1.0e-8)
DTWAIN_OR_ROT0 = 0
DTWAIN_OR_ROT90 = 1
DTWAIN_OR_ROT180 = 2
DTWAIN_OR_ROT270 = 3
DTWAIN_OR_PORTRAIT = DTWAIN_OR_ROT0
DTWAIN_OR_LANDSCAPE = DTWAIN_OR_ROT270
DTWAIN_OR_ANYROTATION = (-1)
DTWAIN_CO_GET = 0x0001
DTWAIN_CO_SET = 0x0002
DTWAIN_CO_GETDEFAULT = 0x0004
DTWAIN_CO_GETCURRENT = 0x0008
DTWAIN_CO_RESET = 0x0010
DTWAIN_CO_SETCONSTRAINT = 0x0020
DTWAIN_CO_CONSTRAINABLE = 0x0040
DTWAIN_CO_GETHELP = 0x0100
DTWAIN_CO_GETLABEL = 0x0200
DTWAIN_CO_GETLABELENUM = 0x0400
DTWAIN_CNTYAFGHANISTAN = 1001
DTWAIN_CNTYALGERIA = 213
DTWAIN_CNTYAMERICANSAMOA = 684
DTWAIN_CNTYANDORRA = 33
DTWAIN_CNTYANGOLA = 1002
DTWAIN_CNTYANGUILLA = 8090
DTWAIN_CNTYANTIGUA = 8091
DTWAIN_CNTYARGENTINA = 54
DTWAIN_CNTYARUBA = 297
DTWAIN_CNTYASCENSIONI = 247
DTWAIN_CNTYAUSTRALIA = 61
DTWAIN_CNTYAUSTRIA = 43
DTWAIN_CNTYBAHAMAS = 8092
DTWAIN_CNTYBAHRAIN = 973
DTWAIN_CNTYBANGLADESH = 880
DTWAIN_CNTYBARBADOS = 8093
DTWAIN_CNTYBELGIUM = 32
DTWAIN_CNTYBELIZE = 501
DTWAIN_CNTYBENIN = 229
DTWAIN_CNTYBERMUDA = 8094
DTWAIN_CNTYBHUTAN = 1003
DTWAIN_CNTYBOLIVIA = 591
DTWAIN_CNTYBOTSWANA = 267
DTWAIN_CNTYBRITAIN = 6
DTWAIN_CNTYBRITVIRGINIS = 8095
DTWAIN_CNTYBRAZIL = 55
DTWAIN_CNTYBRUNEI = 673
DTWAIN_CNTYBULGARIA = 359
DTWAIN_CNTYBURKINAFASO = 1004
DTWAIN_CNTYBURMA = 1005
DTWAIN_CNTYBURUNDI = 1006
DTWAIN_CNTYCAMAROON = 237
DTWAIN_CNTYCANADA = 2
DTWAIN_CNTYCAPEVERDEIS = 238
DTWAIN_CNTYCAYMANIS = 8096
DTWAIN_CNTYCENTRALAFREP = 1007
DTWAIN_CNTYCHAD = 1008
DTWAIN_CNTYCHILE = 56
DTWAIN_CNTYCHINA = 86
DTWAIN_CNTYCHRISTMASIS = 1009
DTWAIN_CNTYCOCOSIS = 1009
DTWAIN_CNTYCOLOMBIA = 57
DTWAIN_CNTYCOMOROS = 1010
DTWAIN_CNTYCONGO = 1011
DTWAIN_CNTYCOOKIS = 1012
DTWAIN_CNTYCOSTARICA = 506
DTWAIN_CNTYCUBA = 5
DTWAIN_CNTYCYPRUS = 357
DTWAIN_CNTYCZECHOSLOVAKIA = 42
DTWAIN_CNTYDENMARK = 45
DTWAIN_CNTYDJIBOUTI = 1013
DTWAIN_CNTYDOMINICA = 8097
DTWAIN_CNTYDOMINCANREP = 8098
DTWAIN_CNTYEASTERIS = 1014
DTWAIN_CNTYECUADOR = 593
DTWAIN_CNTYEGYPT = 20
DTWAIN_CNTYELSALVADOR = 503
DTWAIN_CNTYEQGUINEA = 1015
DTWAIN_CNTYETHIOPIA = 251
DTWAIN_CNTYFALKLANDIS = 1016
DTWAIN_CNTYFAEROEIS = 298
DTWAIN_CNTYFIJIISLANDS = 679
DTWAIN_CNTYFINLAND = 358
DTWAIN_CNTYFRANCE = 33
DTWAIN_CNTYFRANTILLES = 596
DTWAIN_CNTYFRGUIANA = 594
DTWAIN_CNTYFRPOLYNEISA = 689
DTWAIN_CNTYFUTANAIS = 1043
DTWAIN_CNTYGABON = 241
DTWAIN_CNTYGAMBIA = 220
DTWAIN_CNTYGERMANY = 49
DTWAIN_CNTYGHANA = 233
DTWAIN_CNTYGIBRALTER = 350
DTWAIN_CNTYGREECE = 30
DTWAIN_CNTYGREENLAND = 299
DTWAIN_CNTYGRENADA = 8099
DTWAIN_CNTYGRENEDINES = 8015
DTWAIN_CNTYGUADELOUPE = 590
DTWAIN_CNTYGUAM = 671
DTWAIN_CNTYGUANTANAMOBAY = 5399
DTWAIN_CNTYGUATEMALA = 502
DTWAIN_CNTYGUINEA = 224
DTWAIN_CNTYGUINEABISSAU = 1017
DTWAIN_CNTYGUYANA = 592
DTWAIN_CNTYHAITI = 509
DTWAIN_CNTYHONDURAS = 504
DTWAIN_CNTYHONGKONG = 852
DTWAIN_CNTYHUNGARY = 36
DTWAIN_CNTYICELAND = 354
DTWAIN_CNTYINDIA = 91
DTWAIN_CNTYINDONESIA = 62
DTWAIN_CNTYIRAN = 98
DTWAIN_CNTYIRAQ = 964
DTWAIN_CNTYIRELAND = 353
DTWAIN_CNTYISRAEL = 972
DTWAIN_CNTYITALY = 39
DTWAIN_CNTYIVORYCOAST = 225
DTWAIN_CNTYJAMAICA = 8010
DTWAIN_CNTYJAPAN = 81
DTWAIN_CNTYJORDAN = 962
DTWAIN_CNTYKENYA = 254
DTWAIN_CNTYKIRIBATI = 1018
DTWAIN_CNTYKOREA = 82
DTWAIN_CNTYKUWAIT = 965
DTWAIN_CNTYLAOS = 1019
DTWAIN_CNTYLEBANON = 1020
DTWAIN_CNTYLIBERIA = 231
DTWAIN_CNTYLIBYA = 218
DTWAIN_CNTYLIECHTENSTEIN = 41
DTWAIN_CNTYLUXENBOURG = 352
DTWAIN_CNTYMACAO = 853
DTWAIN_CNTYMADAGASCAR = 1021
DTWAIN_CNTYMALAWI = 265
DTWAIN_CNTYMALAYSIA = 60
DTWAIN_CNTYMALDIVES = 960
DTWAIN_CNTYMALI = 1022
DTWAIN_CNTYMALTA = 356
DTWAIN_CNTYMARSHALLIS = 692
DTWAIN_CNTYMAURITANIA = 1023
DTWAIN_CNTYMAURITIUS = 230
DTWAIN_CNTYMEXICO = 3
DTWAIN_CNTYMICRONESIA = 691
DTWAIN_CNTYMIQUELON = 508
DTWAIN_CNTYMONACO = 33
DTWAIN_CNTYMONGOLIA = 1024
DTWAIN_CNTYMONTSERRAT = 8011
DTWAIN_CNTYMOROCCO = 212
DTWAIN_CNTYMOZAMBIQUE = 1025
DTWAIN_CNTYNAMIBIA = 264
DTWAIN_CNTYNAURU = 1026
DTWAIN_CNTYNEPAL = 977
DTWAIN_CNTYNETHERLANDS = 31
DTWAIN_CNTYNETHANTILLES = 599
DTWAIN_CNTYNEVIS = 8012
DTWAIN_CNTYNEWCALEDONIA = 687
DTWAIN_CNTYNEWZEALAND = 64
DTWAIN_CNTYNICARAGUA = 505
DTWAIN_CNTYNIGER = 227
DTWAIN_CNTYNIGERIA = 234
DTWAIN_CNTYNIUE = 1027
DTWAIN_CNTYNORFOLKI = 1028
DTWAIN_CNTYNORWAY = 47
DTWAIN_CNTYOMAN = 968
DTWAIN_CNTYPAKISTAN = 92
DTWAIN_CNTYPALAU = 1029
DTWAIN_CNTYPANAMA = 507
DTWAIN_CNTYPARAGUAY = 595
DTWAIN_CNTYPERU = 51
DTWAIN_CNTYPHILLIPPINES = 63
DTWAIN_CNTYPITCAIRNIS = 1030
DTWAIN_CNTYPNEWGUINEA = 675
DTWAIN_CNTYPOLAND = 48
DTWAIN_CNTYPORTUGAL = 351
DTWAIN_CNTYQATAR = 974
DTWAIN_CNTYREUNIONI = 1031
DTWAIN_CNTYROMANIA = 40
DTWAIN_CNTYRWANDA = 250
DTWAIN_CNTYSAIPAN = 670
DTWAIN_CNTYSANMARINO = 39
DTWAIN_CNTYSAOTOME = 1033
DTWAIN_CNTYSAUDIARABIA = 966
DTWAIN_CNTYSENEGAL = 221
DTWAIN_CNTYSEYCHELLESIS = 1034
DTWAIN_CNTYSIERRALEONE = 1035
DTWAIN_CNTYSINGAPORE = 65
DTWAIN_CNTYSOLOMONIS = 1036
DTWAIN_CNTYSOMALI = 1037
DTWAIN_CNTYSOUTHAFRICA = 27
DTWAIN_CNTYSPAIN = 34
DTWAIN_CNTYSRILANKA = 94
DTWAIN_CNTYSTHELENA = 1032
DTWAIN_CNTYSTKITTS = 8013
DTWAIN_CNTYSTLUCIA = 8014
DTWAIN_CNTYSTPIERRE = 508
DTWAIN_CNTYSTVINCENT = 8015
DTWAIN_CNTYSUDAN = 1038
DTWAIN_CNTYSURINAME = 597
DTWAIN_CNTYSWAZILAND = 268
DTWAIN_CNTYSWEDEN = 46
DTWAIN_CNTYSWITZERLAND = 41
DTWAIN_CNTYSYRIA = 1039
DTWAIN_CNTYTAIWAN = 886
DTWAIN_CNTYTANZANIA = 255
DTWAIN_CNTYTHAILAND = 66
DTWAIN_CNTYTOBAGO = 8016
DTWAIN_CNTYTOGO = 228
DTWAIN_CNTYTONGAIS = 676
DTWAIN_CNTYTRINIDAD = 8016
DTWAIN_CNTYTUNISIA = 216
DTWAIN_CNTYTURKEY = 90
DTWAIN_CNTYTURKSCAICOS = 8017
DTWAIN_CNTYTUVALU = 1040
DTWAIN_CNTYUGANDA = 256
DTWAIN_CNTYUSSR = 7
DTWAIN_CNTYUAEMIRATES = 971
DTWAIN_CNTYUNITEDKINGDOM = 44
DTWAIN_CNTYUSA = 1
DTWAIN_CNTYURUGUAY = 598
DTWAIN_CNTYVANUATU = 1041
DTWAIN_CNTYVATICANCITY = 39
DTWAIN_CNTYVENEZUELA = 58
DTWAIN_CNTYWAKE = 1042
DTWAIN_CNTYWALLISIS = 1043
DTWAIN_CNTYWESTERNSAHARA = 1044
DTWAIN_CNTYWESTERNSAMOA = 1045
DTWAIN_CNTYYEMEN = 1046
DTWAIN_CNTYYUGOSLAVIA = 38
DTWAIN_CNTYZAIRE = 243
DTWAIN_CNTYZAMBIA = 260
DTWAIN_CNTYZIMBABWE = 263
DTWAIN_LANGDANISH = 0
DTWAIN_LANGDUTCH = 1
DTWAIN_LANGINTERNATIONALENGLISH = 2
DTWAIN_LANGFRENCHCANADIAN = 3
DTWAIN_LANGFINNISH = 4
DTWAIN_LANGFRENCH = 5
DTWAIN_LANGGERMAN = 6
DTWAIN_LANGICELANDIC = 7
DTWAIN_LANGITALIAN = 8
DTWAIN_LANGNORWEGIAN = 9
DTWAIN_LANGPORTUGUESE = 10
DTWAIN_LANGSPANISH = 11
DTWAIN_LANGSWEDISH = 12
DTWAIN_LANGUSAENGLISH = 13
DTWAIN_NO_ERROR = (0)
DTWAIN_ERR_FIRST = (-1000)
DTWAIN_ERR_BAD_HANDLE = (-1001)
DTWAIN_ERR_BAD_SOURCE = (-1002)
DTWAIN_ERR_BAD_ARRAY = (-1003)
DTWAIN_ERR_WRONG_ARRAY_TYPE = (-1004)
DTWAIN_ERR_INDEX_BOUNDS = (-1005)
DTWAIN_ERR_OUT_OF_MEMORY = (-1006)
DTWAIN_ERR_NULL_WINDOW = (-1007)
DTWAIN_ERR_BAD_PIXTYPE = (-1008)
DTWAIN_ERR_BAD_CONTAINER = (-1009)
DTWAIN_ERR_NO_SESSION = (-1010)
DTWAIN_ERR_BAD_ACQUIRE_NUM = (-1011)
DTWAIN_ERR_BAD_CAP = (-1012)
DTWAIN_ERR_CAP_NO_SUPPORT = (-1013)
DTWAIN_ERR_TWAIN = (-1014)
DTWAIN_ERR_HOOK_FAILED = (-1015)
DTWAIN_ERR_BAD_FILENAME = (-1016)
DTWAIN_ERR_EMPTY_ARRAY = (-1017)
DTWAIN_ERR_FILE_FORMAT = (-1018)
DTWAIN_ERR_BAD_DIB_PAGE = (-1019)
DTWAIN_ERR_SOURCE_ACQUIRING = (-1020)
DTWAIN_ERR_INVALID_PARAM = (-1021)
DTWAIN_ERR_INVALID_RANGE = (-1022)
DTWAIN_ERR_UI_ERROR = (-1023)
DTWAIN_ERR_BAD_UNIT = (-1024)
DTWAIN_ERR_LANGDLL_NOT_FOUND = (-1025)
DTWAIN_ERR_SOURCE_NOT_OPEN = (-1026)
DTWAIN_ERR_DEVICEEVENT_NOT_SUPPORTED = (-1027)
DTWAIN_ERR_UIONLY_NOT_SUPPORTED = (-1028)
DTWAIN_ERR_UI_ALREADY_OPENED = (-1029)
DTWAIN_ERR_CAPSET_NOSUPPORT = (-1030)
DTWAIN_ERR_NO_FILE_XFER = (-1031)
DTWAIN_ERR_INVALID_BITDEPTH = (-1032)
DTWAIN_ERR_NO_CAPS_DEFINED = (-1033)
DTWAIN_ERR_TILES_NOT_SUPPORTED = (-1034)
DTWAIN_ERR_INVALID_DTWAIN_FRAME = (-1035)
DTWAIN_ERR_LIMITED_VERSION = (-1036)
DTWAIN_ERR_NO_FEEDER = (-1037)
DTWAIN_ERR_NO_FEEDER_QUERY = (-1038)
DTWAIN_ERR_EXCEPTION_ERROR = (-1039)
DTWAIN_ERR_INVALID_STATE = (-1040)
DTWAIN_ERR_UNSUPPORTED_EXTINFO = (-1041)
DTWAIN_ERR_DLLRESOURCE_NOTFOUND = (-1042)
DTWAIN_ERR_NOT_INITIALIZED = (-1043)
DTWAIN_ERR_NO_SOURCES = (-1044)
DTWAIN_ERR_TWAIN_NOT_INSTALLED = (-1045)
DTWAIN_ERR_WRONG_THREAD = (-1046)
DTWAIN_ERR_BAD_CAPTYPE = (-1047)
DTWAIN_ERR_UNKNOWN_CAPDATATYPE = (-1048)
DTWAIN_ERR_DEMO_NOFILETYPE = (-1049)
DTWAIN_ERR_SOURCESELECTION_CANCELED = (-1050)
DTWAIN_ERR_RESOURCES_NOT_FOUND = (-1051)
DTWAIN_ERR_STRINGTYPE_MISMATCH = (-1052)
DTWAIN_ERR_ARRAYTYPE_MISMATCH = (-1053)
DTWAIN_ERR_SOURCENAME_NOTINSTALLED = (-1054)
DTWAIN_ERR_NO_MEMFILE_XFER = (-1055)
DTWAIN_ERR_AREA_ARRAY_TOO_SMALL = (-1056)
DTWAIN_ERR_LOG_CREATE_ERROR = (-1057)
DTWAIN_ERR_FILESYSTEM_NOT_SUPPORTED = (-1058)
DTWAIN_ERR_TILEMODE_NOTSET = (-1059)
DTWAIN_ERR_INI32_NOT_FOUND = (-1060)
DTWAIN_ERR_INI64_NOT_FOUND = (-1061)
DTWAIN_ERR_CRC_CHECK = (-1062)
DTWAIN_ERR_RESOURCES_BAD_VERSION = (-1063)
DTWAIN_ERR_WIN32_ERROR = (-1064)
DTWAIN_ERR_STRINGID_NOTFOUND = (-1065)
DTWAIN_ERR_RESOURCES_DUPLICATEID_FOUND = (-1066)
DTWAIN_ERR_UNAVAILABLE_EXTINFO = (-1067)
DTWAIN_ERR_TWAINDSM2_BADBITMAP = (-1068)
DTWAIN_ERR_ACQUISITION_CANCELED = (-1069)
DTWAIN_ERR_IMAGE_RESAMPLED = (-1070)
DTWAIN_ERR_UNKNOWN_TWAIN_RC = (-1071)
DTWAIN_ERR_UNKNOWN_TWAIN_CC = (-1072)
DTWAIN_ERR_RESOURCES_DATA_EXCEPTION = (-1073)
DTWAIN_ERR_AUDIO_TRANSFER_NOTSUPPORTED = (-1074)
DTWAIN_ERR_FEEDER_COMPLIANCY = (-1075)
DTWAIN_ERR_SUPPORTEDCAPS_COMPLIANCY1 = (-1076)
DTWAIN_ERR_SUPPORTEDCAPS_COMPLIANCY2 = (-1077)
DTWAIN_ERR_ICAPPIXELTYPE_COMPLIANCY1 = (-1078)
DTWAIN_ERR_ICAPPIXELTYPE_COMPLIANCY2 = (-1079)
DTWAIN_ERR_ICAPBITDEPTH_COMPLIANCY1 = (-1080)
DTWAIN_ERR_XFERMECH_COMPLIANCY = (-1081)
DTWAIN_ERR_STANDARDCAPS_COMPLIANCY = (-1082)
DTWAIN_ERR_EXTIMAGEINFO_DATATYPE_MISMATCH = (-1083)
DTWAIN_ERR_EXTIMAGEINFO_RETRIEVAL = (-1084)
DTWAIN_ERR_RANGE_OUTOFBOUNDS = (-1085)
DTWAIN_ERR_RANGE_STEPISZERO = (-1086)
DTWAIN_ERR_BLANKNAMEDETECTED = (-1087)
DTWAIN_ERR_FEEDER_NOPAPERSENSOR = (-1088)
TWAIN_ERR_LOW_MEMORY = (-1100)
TWAIN_ERR_FALSE_ALARM = (-1101)
TWAIN_ERR_BUMMER = (-1102)
TWAIN_ERR_NODATASOURCE = (-1103)
TWAIN_ERR_MAXCONNECTIONS = (-1104)
TWAIN_ERR_OPERATIONERROR = (-1105)
TWAIN_ERR_BADCAPABILITY = (-1106)
TWAIN_ERR_BADVALUE = (-1107)
TWAIN_ERR_BADPROTOCOL = (-1108)
TWAIN_ERR_SEQUENCEERROR = (-1109)
TWAIN_ERR_BADDESTINATION = (-1110)
TWAIN_ERR_CAPNOTSUPPORTED = (-1111)
TWAIN_ERR_CAPBADOPERATION = (-1112)
TWAIN_ERR_CAPSEQUENCEERROR = (-1113)
TWAIN_ERR_FILEPROTECTEDERROR = (-1114)
TWAIN_ERR_FILEEXISTERROR = (-1115)
TWAIN_ERR_FILENOTFOUND = (-1116)
TWAIN_ERR_DIRNOTEMPTY = (-1117)
TWAIN_ERR_FEEDERJAMMED = (-1118)
TWAIN_ERR_FEEDERMULTPAGES = (-1119)
TWAIN_ERR_FEEDERWRITEERROR = (-1120)
TWAIN_ERR_DEVICEOFFLINE = (-1121)
TWAIN_ERR_NULL_CONTAINER = (-1122)
TWAIN_ERR_INTERLOCK = (-1123)
TWAIN_ERR_DAMAGEDCORNER = (-1124)
TWAIN_ERR_FOCUSERROR = (-1125)
TWAIN_ERR_DOCTOOLIGHT = (-1126)
TWAIN_ERR_DOCTOODARK = (-1127)
TWAIN_ERR_NOMEDIA = (-1128)
DTWAIN_ERR_FILEXFERSTART = (-2000)
DTWAIN_ERR_MEM = (-2001)
DTWAIN_ERR_FILEOPEN = (-2002)
DTWAIN_ERR_FILEREAD = (-2003)
DTWAIN_ERR_FILEWRITE = (-2004)
DTWAIN_ERR_BADPARAM = (-2005)
DTWAIN_ERR_INVALIDBMP = (-2006)
DTWAIN_ERR_BMPRLE = (-2007)
DTWAIN_ERR_RESERVED1 = (-2008)
DTWAIN_ERR_INVALIDJPG = (-2009)
DTWAIN_ERR_DC = (-2010)
DTWAIN_ERR_DIB = (-2011)
DTWAIN_ERR_RESERVED2 = (-2012)
DTWAIN_ERR_NORESOURCE = (-2013)
DTWAIN_ERR_CALLBACKCANCEL = (-2014)
DTWAIN_ERR_INVALIDPNG = (-2015)
DTWAIN_ERR_PNGCREATE = (-2016)
DTWAIN_ERR_INTERNAL = (-2017)
DTWAIN_ERR_FONT = (-2018)
DTWAIN_ERR_INTTIFF = (-2019)
DTWAIN_ERR_INVALIDTIFF = (-2020)
DTWAIN_ERR_NOTIFFLZW = (-2021)
DTWAIN_ERR_INVALIDPCX = (-2022)
DTWAIN_ERR_CREATEBMP = (-2023)
DTWAIN_ERR_NOLINES = (-2024)
DTWAIN_ERR_GETDIB = (-2025)
DTWAIN_ERR_NODEVOP = (-2026)
DTWAIN_ERR_INVALIDWMF = (-2027)
DTWAIN_ERR_DEPTHMISMATCH = (-2028)
DTWAIN_ERR_BITBLT = (-2029)
DTWAIN_ERR_BUFTOOSMALL = (-2030)
DTWAIN_ERR_TOOMANYCOLORS = (-2031)
DTWAIN_ERR_INVALIDTGA = (-2032)
DTWAIN_ERR_NOTGATHUMBNAIL = (-2033)
DTWAIN_ERR_RESERVED3 = (-2034)
DTWAIN_ERR_CREATEDIB = (-2035)
DTWAIN_ERR_NOLZW = (-2036)
DTWAIN_ERR_SELECTOBJ = (-2037)
DTWAIN_ERR_BADMANAGER = (-2038)
DTWAIN_ERR_OBSOLETE = (-2039)
DTWAIN_ERR_CREATEDIBSECTION = (-2040)
DTWAIN_ERR_SETWINMETAFILEBITS = (-2041)
DTWAIN_ERR_GETWINMETAFILEBITS = (-2042)
DTWAIN_ERR_PAXPWD = (-2043)
DTWAIN_ERR_INVALIDPAX = (-2044)
DTWAIN_ERR_NOSUPPORT = (-2045)
DTWAIN_ERR_INVALIDPSD = (-2046)
DTWAIN_ERR_PSDNOTSUPPORTED = (-2047)
DTWAIN_ERR_DECRYPT = (-2048)
DTWAIN_ERR_ENCRYPT = (-2049)
DTWAIN_ERR_COMPRESSION = (-2050)
DTWAIN_ERR_DECOMPRESSION = (-2051)
DTWAIN_ERR_INVALIDTLA = (-2052)
DTWAIN_ERR_INVALIDWBMP = (-2053)
DTWAIN_ERR_NOTIFFTAG = (-2054)
DTWAIN_ERR_NOLOCALSTORAGE = (-2055)
DTWAIN_ERR_INVALIDEXIF = (-2056)
DTWAIN_ERR_NOEXIFSTRING = (-2057)
DTWAIN_ERR_TIFFDLL32NOTFOUND = (-2058)
DTWAIN_ERR_TIFFDLL16NOTFOUND = (-2059)
DTWAIN_ERR_PNGDLL16NOTFOUND = (-2060)
DTWAIN_ERR_JPEGDLL16NOTFOUND = (-2061)
DTWAIN_ERR_BADBITSPERPIXEL = (-2062)
DTWAIN_ERR_TIFFDLL32INVALIDVER = (-2063)
DTWAIN_ERR_PDFDLL32NOTFOUND = (-2064)
DTWAIN_ERR_PDFDLL32INVALIDVER = (-2065)
DTWAIN_ERR_JPEGDLL32NOTFOUND = (-2066)
DTWAIN_ERR_JPEGDLL32INVALIDVER = (-2067)
DTWAIN_ERR_PNGDLL32NOTFOUND = (-2068)
DTWAIN_ERR_PNGDLL32INVALIDVER = (-2069)
DTWAIN_ERR_J2KDLL32NOTFOUND = (-2070)
DTWAIN_ERR_J2KDLL32INVALIDVER = (-2071)
DTWAIN_ERR_MANDUPLEX_UNAVAILABLE = (-2072)
DTWAIN_ERR_TIMEOUT = (-2073)
DTWAIN_ERR_INVALIDICONFORMAT = (-2074)
DTWAIN_ERR_TWAIN32DSMNOTFOUND = (-2075)
DTWAIN_ERR_TWAINOPENSOURCEDSMNOTFOUND = (-2076)
DTWAIN_ERR_INVALID_DIRECTORY = (-2077)
DTWAIN_ERR_CREATE_DIRECTORY = (-2078)
DTWAIN_ERR_OCRLIBRARY_NOTFOUND = (-2079)
DTWAIN_TWAINSAVE_OK = (0)
DTWAIN_ERR_TS_FIRST = (-2080)
DTWAIN_ERR_TS_NOFILENAME = (-2081)
DTWAIN_ERR_TS_NOTWAINSYS = (-2082)
DTWAIN_ERR_TS_DEVICEFAILURE = (-2083)
DTWAIN_ERR_TS_FILESAVEERROR = (-2084)
DTWAIN_ERR_TS_COMMANDILLEGAL = (-2085)
DTWAIN_ERR_TS_CANCELLED = (-2086)
DTWAIN_ERR_TS_ACQUISITIONERROR = (-2087)
DTWAIN_ERR_TS_INVALIDCOLORSPACE = (-2088)
DTWAIN_ERR_TS_PDFNOTSUPPORTED = (-2089)
DTWAIN_ERR_TS_NOTAVAILABLE = (-2090)
DTWAIN_ERR_OCR_FIRST = (-2100)
DTWAIN_ERR_OCR_INVALIDPAGENUM = (-2101)
DTWAIN_ERR_OCR_INVALIDENGINE = (-2102)
DTWAIN_ERR_OCR_NOTACTIVE = (-2103)
DTWAIN_ERR_OCR_INVALIDFILETYPE = (-2104)
DTWAIN_ERR_OCR_INVALIDPIXELTYPE = (-2105)
DTWAIN_ERR_OCR_INVALIDBITDEPTH = (-2106)
DTWAIN_ERR_OCR_RECOGNITIONERROR = (-2107)
DTWAIN_ERR_OCR_LAST = (-2108)
DTWAIN_ERR_LAST = DTWAIN_ERR_OCR_LAST
DTWAIN_ERR_SOURCE_COULD_NOT_OPEN = (-2500)
DTWAIN_ERR_SOURCE_COULD_NOT_CLOSE = (-2501)
DTWAIN_ERR_IMAGEINFO_INVALID = (-2502)
DTWAIN_ERR_WRITEDATA_TOFILE = (-2503)
DTWAIN_ERR_OPERATION_NOTSUPPORTED = (-2504)
DTWAIN_ERR_INVALID_PDFTEXTELEMENT = (-2505)
DTWAIN_ERR_SETCAP_FAILED = (-2506)
DTWAIN_ERR_CAP_INVALIDSTATE = (-2507)
DTWAIN_ERR_GETCAP_FAILED = (-2508)
DTWAIN_DE_CHKAUTOCAPTURE = 1
DTWAIN_DE_CHKBATTERY = 2
DTWAIN_DE_CHKDEVICEONLINE = 4
DTWAIN_DE_CHKFLASH = 8
DTWAIN_DE_CHKPOWERSUPPLY = 16
DTWAIN_DE_CHKRESOLUTION = 32
DTWAIN_DE_DEVICEADDED = 64
DTWAIN_DE_DEVICEOFFLINE = 128
DTWAIN_DE_DEVICEREADY = 256
DTWAIN_DE_DEVICEREMOVED = 512
DTWAIN_DE_IMAGECAPTURED = 1024
DTWAIN_DE_IMAGEDELETED = 2048
DTWAIN_DE_PAPERDOUBLEFEED = 4096
DTWAIN_DE_PAPERJAM = 8192
DTWAIN_DE_LAMPFAILURE = 16384
DTWAIN_DE_POWERSAVE = 32768
DTWAIN_DE_POWERSAVENOTIFY = 65536
DTWAIN_DE_CUSTOMEVENTS = 0x8000
DTWAIN_GETDE_EVENT = 0
DTWAIN_GETDE_DEVNAME = 1
DTWAIN_GETDE_BATTERYMINUTES = 2
DTWAIN_GETDE_BATTERYPCT = 3
DTWAIN_GETDE_XRESOLUTION = 4
DTWAIN_GETDE_YRESOLUTION = 5
DTWAIN_GETDE_FLASHUSED = 6
DTWAIN_GETDE_AUTOCAPTURE = 7
DTWAIN_GETDE_TIMEBEFORECAPTURE = 8
DTWAIN_GETDE_TIMEBETWEENCAPTURES = 9
DTWAIN_GETDE_POWERSUPPLY = 10
DTWAIN_IMPRINTERTOPBEFORE = 1
DTWAIN_IMPRINTERTOPAFTER = 2
DTWAIN_IMPRINTERBOTTOMBEFORE = 4
DTWAIN_IMPRINTERBOTTOMAFTER = 8
DTWAIN_ENDORSERTOPBEFORE = 16
DTWAIN_ENDORSERTOPAFTER = 32
DTWAIN_ENDORSERBOTTOMBEFORE = 64
DTWAIN_ENDORSERBOTTOMAFTER = 128
DTWAIN_PM_SINGLESTRING = 0
DTWAIN_PM_MULTISTRING = 1
DTWAIN_PM_COMPOUNDSTRING = 2
DTWAIN_TWTY_INT8 = 0x0000
DTWAIN_TWTY_INT16 = 0x0001
DTWAIN_TWTY_INT32 = 0x0002
DTWAIN_TWTY_UINT8 = 0x0003
DTWAIN_TWTY_UINT16 = 0x0004
DTWAIN_TWTY_UINT32 = 0x0005
DTWAIN_TWTY_BOOL = 0x0006
DTWAIN_TWTY_FIX32 = 0x0007
DTWAIN_TWTY_FRAME = 0x0008
DTWAIN_TWTY_STR32 = 0x0009
DTWAIN_TWTY_STR64 = 0x000A
DTWAIN_TWTY_STR128 = 0x000B
DTWAIN_TWTY_STR255 = 0x000C
DTWAIN_TWTY_STR1024 = 0x000D
DTWAIN_TWTY_UNI512 = 0x000E
DTWAIN_EI_BARCODEX = 0x1200
DTWAIN_EI_BARCODEY = 0x1201
DTWAIN_EI_BARCODETEXT = 0x1202
DTWAIN_EI_BARCODETYPE = 0x1203
DTWAIN_EI_DESHADETOP = 0x1204
DTWAIN_EI_DESHADELEFT = 0x1205
DTWAIN_EI_DESHADEHEIGHT = 0x1206
DTWAIN_EI_DESHADEWIDTH = 0x1207
DTWAIN_EI_DESHADESIZE = 0x1208
DTWAIN_EI_SPECKLESREMOVED = 0x1209
DTWAIN_EI_HORZLINEXCOORD = 0x120A
DTWAIN_EI_HORZLINEYCOORD = 0x120B
DTWAIN_EI_HORZLINELENGTH = 0x120C
DTWAIN_EI_HORZLINETHICKNESS = 0x120D
DTWAIN_EI_VERTLINEXCOORD = 0x120E
DTWAIN_EI_VERTLINEYCOORD = 0x120F
DTWAIN_EI_VERTLINELENGTH = 0x1210
DTWAIN_EI_VERTLINETHICKNESS = 0x1211
DTWAIN_EI_PATCHCODE = 0x1212
DTWAIN_EI_ENDORSEDTEXT = 0x1213
DTWAIN_EI_FORMCONFIDENCE = 0x1214
DTWAIN_EI_FORMTEMPLATEMATCH = 0x1215
DTWAIN_EI_FORMTEMPLATEPAGEMATCH = 0x1216
DTWAIN_EI_FORMHORZDOCOFFSET = 0x1217
DTWAIN_EI_FORMVERTDOCOFFSET = 0x1218
DTWAIN_EI_BARCODECOUNT = 0x1219
DTWAIN_EI_BARCODECONFIDENCE = 0x121A
DTWAIN_EI_BARCODEROTATION = 0x121B
DTWAIN_EI_BARCODETEXTLENGTH = 0x121C
DTWAIN_EI_DESHADECOUNT = 0x121D
DTWAIN_EI_DESHADEBLACKCOUNTOLD = 0x121E
DTWAIN_EI_DESHADEBLACKCOUNTNEW = 0x121F
DTWAIN_EI_DESHADEBLACKRLMIN = 0x1220
DTWAIN_EI_DESHADEBLACKRLMAX = 0x1221
DTWAIN_EI_DESHADEWHITECOUNTOLD = 0x1222
DTWAIN_EI_DESHADEWHITECOUNTNEW = 0x1223
DTWAIN_EI_DESHADEWHITERLMIN = 0x1224
DTWAIN_EI_DESHADEWHITERLAVE = 0x1225
DTWAIN_EI_DESHADEWHITERLMAX = 0x1226
DTWAIN_EI_BLACKSPECKLESREMOVED = 0x1227
DTWAIN_EI_WHITESPECKLESREMOVED = 0x1228
DTWAIN_EI_HORZLINECOUNT = 0x1229
DTWAIN_EI_VERTLINECOUNT = 0x122A
DTWAIN_EI_DESKEWSTATUS = 0x122B
DTWAIN_EI_SKEWORIGINALANGLE = 0x122C
DTWAIN_EI_SKEWFINALANGLE = 0x122D
DTWAIN_EI_SKEWCONFIDENCE = 0x122E
DTWAIN_EI_SKEWWINDOWX1 = 0x122F
DTWAIN_EI_SKEWWINDOWY1 = 0x1230
DTWAIN_EI_SKEWWINDOWX2 = 0x1231
DTWAIN_EI_SKEWWINDOWY2 = 0x1232
DTWAIN_EI_SKEWWINDOWX3 = 0x1233
DTWAIN_EI_SKEWWINDOWY3 = 0x1234
DTWAIN_EI_SKEWWINDOWX4 = 0x1235
DTWAIN_EI_SKEWWINDOWY4 = 0x1236
DTWAIN_EI_BOOKNAME = 0x1238
DTWAIN_EI_CHAPTERNUMBER = 0x1239
DTWAIN_EI_DOCUMENTNUMBER = 0x123A
DTWAIN_EI_PAGENUMBER = 0x123B
DTWAIN_EI_CAMERA = 0x123C
DTWAIN_EI_FRAMENUMBER = 0x123D
DTWAIN_EI_FRAME = 0x123E
DTWAIN_EI_PIXELFLAVOR = 0x123F
DTWAIN_EI_ICCPROFILE = 0x1240
DTWAIN_EI_LASTSEGMENT = 0x1241
DTWAIN_EI_SEGMENTNUMBER = 0x1242
DTWAIN_EI_MAGDATA = 0x1243
DTWAIN_EI_MAGTYPE = 0x1244
DTWAIN_EI_PAGESIDE = 0x1245
DTWAIN_EI_FILESYSTEMSOURCE = 0x1246
DTWAIN_EI_IMAGEMERGED = 0x1247
DTWAIN_EI_MAGDATALENGTH = 0x1248
DTWAIN_EI_PAPERCOUNT = 0x1249
DTWAIN_EI_PRINTERTEXT = 0x124A
DTWAIN_EI_TWAINDIRECTMETADATA = 0x124B
DTWAIN_EI_IAFIELDA_VALUE = 0x124C
DTWAIN_EI_IAFIELDB_VALUE = 0x124D
DTWAIN_EI_IAFIELDC_VALUE = 0x124E
DTWAIN_EI_IAFIELDD_VALUE = 0x124F
DTWAIN_EI_IAFIELDE_VALUE = 0x1250
DTWAIN_EI_IALEVEL = 0x1251
DTWAIN_EI_PRINTER = 0x1252
DTWAIN_EI_BARCODETEXT2 = 0x1253
DTWAIN_LOG_DECODE_SOURCE = 0x1      
DTWAIN_LOG_DECODE_DEST = 0x2        
DTWAIN_LOG_DECODE_TWMEMREF = 0x4    
DTWAIN_LOG_DECODE_TWEVENT = 0x8     
DTWAIN_LOG_CALLSTACK = 0x10         
DTWAIN_LOG_ISTWAINMSG = 0x20        
DTWAIN_LOG_INITFAILURE = 0x40       
DTWAIN_LOG_LOWLEVELTWAIN = 0x80     
DTWAIN_LOG_DECODE_BITMAP = 0x100    
DTWAIN_LOG_NOTIFICATIONS = 0x200    
DTWAIN_LOG_MISCELLANEOUS = 0x400    
DTWAIN_LOG_DTWAINERRORS = 0x800     
DTWAIN_LOG_USEFILE = 0x10000        
DTWAIN_LOG_SHOWEXCEPTIONS = 0x20000 
DTWAIN_LOG_ERRORMSGBOX = 0x40000    
DTWAIN_LOG_USEBUFFER = 0x80000      
DTWAIN_LOG_FILEAPPEND = 0x100000    
DTWAIN_LOG_USECALLBACK = 0x200000   
DTWAIN_LOG_USECRLF = 0x400000       
DTWAIN_LOG_CONSOLE = 0x800000       
DTWAIN_LOG_DEBUGMONITOR = 0x1000000 
DTWAIN_LOG_USEWINDOW = 0x2000000    
DTWAIN_LOG_CREATEDIRECTORY = 0x04000000
DTWAIN_LOG_CONSOLEWITHHANDLER = (0x08000000 | DTWAIN_LOG_CONSOLE)
DTWAIN_LOG_ALL = (DTWAIN_LOG_DECODE_SOURCE | DTWAIN_LOG_DECODE_DEST | DTWAIN_LOG_DECODE_TWEVENT | DTWAIN_LOG_DECODE_TWMEMREF | DTWAIN_LOG_CALLSTACK | DTWAIN_LOG_ISTWAINMSG | DTWAIN_LOG_INITFAILURE | DTWAIN_LOG_LOWLEVELTWAIN | DTWAIN_LOG_NOTIFICATIONS | DTWAIN_LOG_MISCELLANEOUS | DTWAIN_LOG_DTWAINERRORS | DTWAIN_LOG_DECODE_BITMAP)
DTWAIN_LOG_ALL_APPEND = 0xFFFFFFFF
DTWAIN_TEMPDIR_CREATEDIRECTORY = DTWAIN_LOG_CREATEDIRECTORY
DTWAINGCD_RETURNHANDLE = 1
DTWAINGCD_COPYDATA = 2
DTWAIN_BYPOSITION = 0
DTWAIN_BYID = 1
DTWAINSCD_USEHANDLE = 1
DTWAINSCD_USEDATA = 2
DTWAIN_PAGEFAIL_RETRY = 1
DTWAIN_PAGEFAIL_TERMINATE = 2
DTWAIN_MAXRETRY_ATTEMPTS = 3
DTWAIN_RETRY_FOREVER = (-1)
DTWAIN_PDF_NOSCALING = 128
DTWAIN_PDF_FITPAGE = 256
DTWAIN_PDF_VARIABLEPAGESIZE = 512
DTWAIN_PDF_CUSTOMSIZE = 1024
DTWAIN_PDF_USECOMPRESSION = 2048
DTWAIN_PDF_CUSTOMSCALE = 4096
DTWAIN_PDF_PIXELSPERMETERSIZE = 8192
DTWAIN_PDF_ALLOWPRINTING = 2052
DTWAIN_PDF_ALLOWMOD = 8
DTWAIN_PDF_ALLOWCOPY = 16
DTWAIN_PDF_ALLOWMODANNOTATIONS = 32
DTWAIN_PDF_ALLOWFILLIN = 256
DTWAIN_PDF_ALLOWEXTRACTION = 512
DTWAIN_PDF_ALLOWASSEMBLY = 1024
DTWAIN_PDF_ALLOWDEGRADEDPRINTING = 4
DTWAIN_PDF_ALLOWALL = 0xFFFFFFFC
DTWAIN_PDF_ALLOWANYMOD = (DTWAIN_PDF_ALLOWMOD | DTWAIN_PDF_ALLOWFILLIN | DTWAIN_PDF_ALLOWMODANNOTATIONS | DTWAIN_PDF_ALLOWASSEMBLY)
DTWAIN_PDF_ALLOWANYPRINTING = (DTWAIN_PDF_ALLOWPRINTING | DTWAIN_PDF_ALLOWDEGRADEDPRINTING)
DTWAIN_PDF_PORTRAIT = 0
DTWAIN_PDF_LANDSCAPE = 1
DTWAIN_PS_REGULAR = 0
DTWAIN_PS_ENCAPSULATED = 1
DTWAIN_BP_AUTODISCARD_NONE = 0
DTWAIN_BP_AUTODISCARD_IMMEDIATE = 1
DTWAIN_BP_AUTODISCARD_AFTERPROCESS = 2
DTWAIN_BP_DETECTORIGINAL = 1
DTWAIN_BP_DETECTADJUSTED = 2
DTWAIN_BP_DETECTALL = (DTWAIN_BP_DETECTORIGINAL | DTWAIN_BP_DETECTADJUSTED)
DTWAIN_BP_DISABLE = (-2)
DTWAIN_BP_AUTO = (-1)
DTWAIN_BP_AUTODISCARD_ANY = 0xFFFF
DTWAIN_LP_REFLECTIVE = 0
DTWAIN_LP_TRANSMISSIVE = 1
DTWAIN_LS_RED = 0
DTWAIN_LS_GREEN = 1
DTWAIN_LS_BLUE = 2
DTWAIN_LS_NONE = 3
DTWAIN_LS_WHITE = 4
DTWAIN_LS_UV = 5
DTWAIN_LS_IR = 6
DTWAIN_DLG_SORTNAMES = 1
DTWAIN_DLG_CENTER = 2
DTWAIN_DLG_CENTER_SCREEN = 4
DTWAIN_DLG_USETEMPLATE = 8
DTWAIN_DLG_CLEAR_PARAMS = 16
DTWAIN_DLG_HORIZONTALSCROLL = 32
DTWAIN_DLG_USEINCLUDENAMES = 64
DTWAIN_DLG_USEEXCLUDENAMES = 128
DTWAIN_DLG_USENAMEMAPPING = 256
DTWAIN_DLG_TOPMOSTWINDOW = 1024
DTWAIN_DLG_OPENONSELECT = 2048
DTWAIN_DLG_NOOPENONSELECT = 4096
DTWAIN_DLG_HIGHLIGHTFIRST = 8192
DTWAIN_DLG_SAVELASTSCREENPOS = 16384
DTWAIN_DLG_CENTER_CURRENT_MONITOR = 32768
DTWAIN_DLG_CONSOLEASPARENT = 65536
DTWAIN_RES_ENGLISH = 0
DTWAIN_RES_FRENCH = 1
DTWAIN_RES_SPANISH = 2
DTWAIN_RES_DUTCH = 3
DTWAIN_RES_GERMAN = 4
DTWAIN_RES_ITALIAN = 5
DTWAIN_AL_ALARM = 0
DTWAIN_AL_FEEDERERROR = 1
DTWAIN_AL_FEEDERWARNING = 2
DTWAIN_AL_BARCODE = 3
DTWAIN_AL_DOUBLEFEED = 4
DTWAIN_AL_JAM = 5
DTWAIN_AL_PATCHCODE = 6
DTWAIN_AL_POWER = 7
DTWAIN_AL_SKEW = 8
DTWAIN_FT_CAMERA = 0
DTWAIN_FT_CAMERATOP = 1
DTWAIN_FT_CAMERABOTTOM = 2
DTWAIN_FT_CAMERAPREVIEW = 3
DTWAIN_FT_DOMAIN = 4
DTWAIN_FT_HOST = 5
DTWAIN_FT_DIRECTORY = 6
DTWAIN_FT_IMAGE = 7
DTWAIN_FT_UNKNOWN = 8
DTWAIN_NF_NONE = 0
DTWAIN_NF_AUTO = 1
DTWAIN_NF_LONEPIXEL = 2
DTWAIN_NF_MAJORITYRULE = 3
DTWAIN_CB_AUTO = 0
DTWAIN_CB_CLEAR = 1
DTWAIN_CB_NOCLEAR = 2
DTWAIN_FA_NONE = 0
DTWAIN_FA_LEFT = 1
DTWAIN_FA_CENTER = 2
DTWAIN_FA_RIGHT = 3
DTWAIN_PF_CHOCOLATE = 0
DTWAIN_PF_VANILLA = 1
DTWAIN_FO_FIRSTPAGEFIRST = 0
DTWAIN_FO_LASTPAGEFIRST = 1
DTWAIN_INCREMENT_STATIC = 0
DTWAIN_INCREMENT_DYNAMIC = 1
DTWAIN_INCREMENT_DEFAULT = -1
DTWAIN_MANDUP_FACEUPTOPPAGE = 0
DTWAIN_MANDUP_FACEUPBOTTOMPAGE = 1
DTWAIN_MANDUP_FACEDOWNTOPPAGE = 2
DTWAIN_MANDUP_FACEDOWNBOTTOMPAGE = 3
DTWAIN_FILESAVE_DEFAULT = 0
DTWAIN_FILESAVE_UICLOSE = 1
DTWAIN_FILESAVE_SOURCECLOSE = 2
DTWAIN_FILESAVE_ENDACQUIRE = 3
DTWAIN_FILESAVE_MANUALSAVE = 4
DTWAIN_FILESAVE_SAVEINCOMPLETE = 128
DTWAIN_MANDUP_SCANOK = 1
DTWAIN_MANDUP_SIDE1RESCAN = 2
DTWAIN_MANDUP_SIDE2RESCAN = 3
DTWAIN_MANDUP_RESCANALL = 4
DTWAIN_MANDUP_PAGEMISSING = 5
DTWAIN_DEMODLL_VERSION = 0x00000001
DTWAIN_UNLICENSED_VERSION = 0x00000002
DTWAIN_COMPANY_VERSION = 0x00000004
DTWAIN_GENERAL_VERSION = 0x00000008
DTWAIN_DEVELOP_VERSION = 0x00000010
DTWAIN_JAVA_VERSION = 0x00000020
DTWAIN_TOOLKIT_VERSION = 0x00000040
DTWAIN_LIMITEDDLL_VERSION = 0x00000080
DTWAIN_STATICLIB_VERSION = 0x00000100
DTWAIN_STATICLIB_STDCALL_VERSION = 0x00000200
DTWAIN_PDF_VERSION = 0x00010000
DTWAIN_TWAINSAVE_VERSION = 0x00020000
DTWAIN_OCR_VERSION = 0x00040000
DTWAIN_BARCODE_VERSION = 0x00080000
DTWAIN_ACTIVEX_VERSION = 0x00100000
DTWAIN_32BIT_VERSION = 0x00200000
DTWAIN_64BIT_VERSION = 0x00400000
DTWAIN_UNICODE_VERSION = 0x00800000
DTWAIN_OPENSOURCE_VERSION = 0x01000000
DTWAIN_CALLSTACK_LOGGING = 0x02000000
DTWAIN_CALLSTACK_LOGGING_PLUS = 0x04000000
DTWAINOCR_RETURNHANDLE = 1
DTWAINOCR_COPYDATA = 2
DTWAIN_OCRINFO_CHAR = 0
DTWAIN_OCRINFO_CHARXPOS = 1
DTWAIN_OCRINFO_CHARYPOS = 2
DTWAIN_OCRINFO_CHARXWIDTH = 3
DTWAIN_OCRINFO_CHARYWIDTH = 4
DTWAIN_OCRINFO_CHARCONFIDENCE = 5
DTWAIN_OCRINFO_PAGENUM = 6
DTWAIN_OCRINFO_OCRENGINE = 7
DTWAIN_OCRINFO_TEXTLENGTH = 8
DTWAIN_PDFPAGETYPE_COLOR = 0
DTWAIN_PDFPAGETYPE_BW = 1
DTWAIN_TWAINDSM_LEGACY = 1
DTWAIN_TWAINDSM_VERSION2 = 2
DTWAIN_TWAINDSM_LATESTVERSION = 4
DTWAIN_TWAINDSMSEARCH_NOTFOUND = (-1)
DTWAIN_TWAINDSMSEARCH_WSO = 0
DTWAIN_TWAINDSMSEARCH_WOS = 1
DTWAIN_TWAINDSMSEARCH_SWO = 2
DTWAIN_TWAINDSMSEARCH_SOW = 3
DTWAIN_TWAINDSMSEARCH_OWS = 4
DTWAIN_TWAINDSMSEARCH_OSW = 5
DTWAIN_TWAINDSMSEARCH_W = 6
DTWAIN_TWAINDSMSEARCH_S = 7
DTWAIN_TWAINDSMSEARCH_O = 8
DTWAIN_TWAINDSMSEARCH_WS = 9
DTWAIN_TWAINDSMSEARCH_WO = 10
DTWAIN_TWAINDSMSEARCH_SW = 11
DTWAIN_TWAINDSMSEARCH_SO = 12
DTWAIN_TWAINDSMSEARCH_OW = 13
DTWAIN_TWAINDSMSEARCH_OS = 14
DTWAIN_TWAINDSMSEARCH_C = 15
DTWAIN_TWAINDSMSEARCH_U = 16
DTWAIN_PDFPOLARITY_POSITIVE = 1
DTWAIN_PDFPOLARITY_NEGATIVE = 2
DTWAIN_TWPF_NORMAL = 0
DTWAIN_TWPF_BOLD = 1
DTWAIN_TWPF_ITALIC = 2
DTWAIN_TWPF_LARGESIZE = 3
DTWAIN_TWPF_SMALLSIZE = 4
DTWAIN_TWCT_PAGE = 0
DTWAIN_TWCT_PATCH1 = 1
DTWAIN_TWCT_PATCH2 = 2
DTWAIN_TWCT_PATCH3 = 3
DTWAIN_TWCT_PATCH4 = 4
DTWAIN_TWCT_PATCH5 = 5
DTWAIN_TWCT_PATCH6 = 6
DTWAIN_AUTOSIZE_NONE = 0
DTWAIN_CV_CAPCUSTOMBASE = 0x8000
DTWAIN_CV_CAPXFERCOUNT = 0x0001
DTWAIN_CV_ICAPCOMPRESSION = 0x0100
DTWAIN_CV_ICAPPIXELTYPE = 0x0101
DTWAIN_CV_ICAPUNITS = 0x0102
DTWAIN_CV_ICAPXFERMECH = 0x0103
DTWAIN_CV_CAPAUTHOR = 0x1000
DTWAIN_CV_CAPCAPTION = 0x1001
DTWAIN_CV_CAPFEEDERENABLED = 0x1002
DTWAIN_CV_CAPFEEDERLOADED = 0x1003
DTWAIN_CV_CAPTIMEDATE = 0x1004
DTWAIN_CV_CAPSUPPORTEDCAPS = 0x1005
DTWAIN_CV_CAPEXTENDEDCAPS = 0x1006
DTWAIN_CV_CAPAUTOFEED = 0x1007
DTWAIN_CV_CAPCLEARPAGE = 0x1008
DTWAIN_CV_CAPFEEDPAGE = 0x1009
DTWAIN_CV_CAPREWINDPAGE = 0x100a
DTWAIN_CV_CAPINDICATORS = 0x100b
DTWAIN_CV_CAPSUPPORTEDCAPSEXT = 0x100c
DTWAIN_CV_CAPPAPERDETECTABLE = 0x100d
DTWAIN_CV_CAPUICONTROLLABLE = 0x100e
DTWAIN_CV_CAPDEVICEONLINE = 0x100f
DTWAIN_CV_CAPAUTOSCAN = 0x1010
DTWAIN_CV_CAPTHUMBNAILSENABLED = 0x1011
DTWAIN_CV_CAPDUPLEX = 0x1012
DTWAIN_CV_CAPDUPLEXENABLED = 0x1013
DTWAIN_CV_CAPENABLEDSUIONLY = 0x1014
DTWAIN_CV_CAPCUSTOMDSDATA = 0x1015
DTWAIN_CV_CAPENDORSER = 0x1016
DTWAIN_CV_CAPJOBCONTROL = 0x1017
DTWAIN_CV_CAPALARMS = 0x1018
DTWAIN_CV_CAPALARMVOLUME = 0x1019
DTWAIN_CV_CAPAUTOMATICCAPTURE = 0x101a
DTWAIN_CV_CAPTIMEBEFOREFIRSTCAPTURE = 0x101b
DTWAIN_CV_CAPTIMEBETWEENCAPTURES = 0x101c
DTWAIN_CV_CAPCLEARBUFFERS = 0x101d
DTWAIN_CV_CAPMAXBATCHBUFFERS = 0x101e
DTWAIN_CV_CAPDEVICETIMEDATE = 0x101f
DTWAIN_CV_CAPPOWERSUPPLY = 0x1020
DTWAIN_CV_CAPCAMERAPREVIEWUI = 0x1021
DTWAIN_CV_CAPDEVICEEVENT = 0x1022
DTWAIN_CV_CAPPAGEMULTIPLEACQUIRE = 0x1023
DTWAIN_CV_CAPSERIALNUMBER = 0x1024
DTWAIN_CV_CAPFILESYSTEM = 0x1025
DTWAIN_CV_CAPPRINTER = 0x1026
DTWAIN_CV_CAPPRINTERENABLED = 0x1027
DTWAIN_CV_CAPPRINTERINDEX = 0x1028
DTWAIN_CV_CAPPRINTERMODE = 0x1029
DTWAIN_CV_CAPPRINTERSTRING = 0x102a
DTWAIN_CV_CAPPRINTERSUFFIX = 0x102b
DTWAIN_CV_CAPLANGUAGE = 0x102c
DTWAIN_CV_CAPFEEDERALIGNMENT = 0x102d
DTWAIN_CV_CAPFEEDERORDER = 0x102e
DTWAIN_CV_CAPPAPERBINDING = 0x102f
DTWAIN_CV_CAPREACQUIREALLOWED = 0x1030
DTWAIN_CV_CAPPASSTHRU = 0x1031
DTWAIN_CV_CAPBATTERYMINUTES = 0x1032
DTWAIN_CV_CAPBATTERYPERCENTAGE = 0x1033
DTWAIN_CV_CAPPOWERDOWNTIME = 0x1034
DTWAIN_CV_CAPSEGMENTED = 0x1035
DTWAIN_CV_CAPCAMERAENABLED = 0x1036
DTWAIN_CV_CAPCAMERAORDER = 0x1037
DTWAIN_CV_CAPMICRENABLED = 0x1038
DTWAIN_CV_CAPFEEDERPREP = 0x1039
DTWAIN_CV_CAPFEEDERPOCKET = 0x103a
DTWAIN_CV_CAPAUTOMATICSENSEMEDIUM = 0x103b
DTWAIN_CV_CAPCUSTOMINTERFACEGUID = 0x103c
DTWAIN_CV_CAPSUPPORTEDCAPSSEGMENTUNIQUE = 0x103d
DTWAIN_CV_CAPSUPPORTEDDATS = 0x103e
DTWAIN_CV_CAPDOUBLEFEEDDETECTION = 0x103f
DTWAIN_CV_CAPDOUBLEFEEDDETECTIONLENGTH = 0x1040
DTWAIN_CV_CAPDOUBLEFEEDDETECTIONSENSITIVITY = 0x1041
DTWAIN_CV_CAPDOUBLEFEEDDETECTIONRESPONSE = 0x1042
DTWAIN_CV_CAPPAPERHANDLING = 0x1043
DTWAIN_CV_CAPINDICATORSMODE = 0x1044
DTWAIN_CV_CAPPRINTERVERTICALOFFSET = 0x1045
DTWAIN_CV_CAPPOWERSAVETIME = 0x1046
DTWAIN_CV_CAPPRINTERCHARROTATION = 0x1047
DTWAIN_CV_CAPPRINTERFONTSTYLE = 0x1048
DTWAIN_CV_CAPPRINTERINDEXLEADCHAR = 0x1049
DTWAIN_CV_CAPIMAGEADDRESSENABLED = 0x1050
DTWAIN_CV_CAPIAFIELDA_LEVEL = 0x1051
DTWAIN_CV_CAPIAFIELDB_LEVEL = 0x1052
DTWAIN_CV_CAPIAFIELDC_LEVEL = 0x1053
DTWAIN_CV_CAPIAFIELDD_LEVEL = 0x1054
DTWAIN_CV_CAPIAFIELDE_LEVEL = 0x1055
DTWAIN_CV_CAPIAFIELDA_PRINTFORMAT = 0x1056
DTWAIN_CV_CAPIAFIELDB_PRINTFORMAT = 0x1057
DTWAIN_CV_CAPIAFIELDC_PRINTFORMAT = 0x1058
DTWAIN_CV_CAPIAFIELDD_PRINTFORMAT = 0x1059
DTWAIN_CV_CAPIAFIELDE_PRINTFORMAT = 0x105A
DTWAIN_CV_CAPIAFIELDA_VALUE = 0x105B
DTWAIN_CV_CAPIAFIELDB_VALUE = 0x105C
DTWAIN_CV_CAPIAFIELDC_VALUE = 0x105D
DTWAIN_CV_CAPIAFIELDD_VALUE = 0x105E
DTWAIN_CV_CAPIAFIELDE_VALUE = 0x105F
DTWAIN_CV_CAPIAFIELDA_LASTPAGE = 0x1060
DTWAIN_CV_CAPIAFIELDB_LASTPAGE = 0x1061
DTWAIN_CV_CAPIAFIELDC_LASTPAGE = 0x1062
DTWAIN_CV_CAPIAFIELDD_LASTPAGE = 0x1063
DTWAIN_CV_CAPIAFIELDE_LASTPAGE = 0x1064
DTWAIN_CV_CAPPRINTERINDEXMAXVALUE = 0x104A
DTWAIN_CV_CAPPRINTERINDEXNUMDIGITS = 0x104B
DTWAIN_CV_CAPPRINTERINDEXSTEP = 0x104C
DTWAIN_CV_CAPPRINTERINDEXTRIGGER = 0x104D
DTWAIN_CV_CAPPRINTERSTRINGPREVIEW = 0x104E
DTWAIN_CV_ICAPAUTOBRIGHT = 0x1100
DTWAIN_CV_ICAPBRIGHTNESS = 0x1101
DTWAIN_CV_ICAPCONTRAST = 0x1103
DTWAIN_CV_ICAPCUSTHALFTONE = 0x1104
DTWAIN_CV_ICAPEXPOSURETIME = 0x1105
DTWAIN_CV_ICAPFILTER = 0x1106
DTWAIN_CV_ICAPFLASHUSED = 0x1107
DTWAIN_CV_ICAPGAMMA = 0x1108
DTWAIN_CV_ICAPHALFTONES = 0x1109
DTWAIN_CV_ICAPHIGHLIGHT = 0x110a
DTWAIN_CV_ICAPIMAGEFILEFORMAT = 0x110c
DTWAIN_CV_ICAPLAMPSTATE = 0x110d
DTWAIN_CV_ICAPLIGHTSOURCE = 0x110e
DTWAIN_CV_ICAPORIENTATION = 0x1110
DTWAIN_CV_ICAPPHYSICALWIDTH = 0x1111
DTWAIN_CV_ICAPPHYSICALHEIGHT = 0x1112
DTWAIN_CV_ICAPSHADOW = 0x1113
DTWAIN_CV_ICAPFRAMES = 0x1114
DTWAIN_CV_ICAPXNATIVERESOLUTION = 0x1116
DTWAIN_CV_ICAPYNATIVERESOLUTION = 0x1117
DTWAIN_CV_ICAPXRESOLUTION = 0x1118
DTWAIN_CV_ICAPYRESOLUTION = 0x1119
DTWAIN_CV_ICAPMAXFRAMES = 0x111a
DTWAIN_CV_ICAPTILES = 0x111b
DTWAIN_CV_ICAPBITORDER = 0x111c
DTWAIN_CV_ICAPCCITTKFACTOR = 0x111d
DTWAIN_CV_ICAPLIGHTPATH = 0x111e
DTWAIN_CV_ICAPPIXELFLAVOR = 0x111f
DTWAIN_CV_ICAPPLANARCHUNKY = 0x1120
DTWAIN_CV_ICAPROTATION = 0x1121
DTWAIN_CV_ICAPSUPPORTEDSIZES = 0x1122
DTWAIN_CV_ICAPTHRESHOLD = 0x1123
DTWAIN_CV_ICAPXSCALING = 0x1124
DTWAIN_CV_ICAPYSCALING = 0x1125
DTWAIN_CV_ICAPBITORDERCODES = 0x1126
DTWAIN_CV_ICAPPIXELFLAVORCODES = 0x1127
DTWAIN_CV_ICAPJPEGPIXELTYPE = 0x1128
DTWAIN_CV_ICAPTIMEFILL = 0x112a
DTWAIN_CV_ICAPBITDEPTH = 0x112b
DTWAIN_CV_ICAPBITDEPTHREDUCTION = 0x112c
DTWAIN_CV_ICAPUNDEFINEDIMAGESIZE = 0x112d
DTWAIN_CV_ICAPIMAGEDATASET = 0x112e
DTWAIN_CV_ICAPEXTIMAGEINFO = 0x112f
DTWAIN_CV_ICAPMINIMUMHEIGHT = 0x1130
DTWAIN_CV_ICAPMINIMUMWIDTH = 0x1131
DTWAIN_CV_ICAPAUTOBORDERDETECTION = 0x1132
DTWAIN_CV_ICAPAUTODESKEW = 0x1133
DTWAIN_CV_ICAPAUTODISCARDBLANKPAGES = 0x1134
DTWAIN_CV_ICAPAUTOROTATE = 0x1135
DTWAIN_CV_ICAPFLIPROTATION = 0x1136
DTWAIN_CV_ICAPBARCODEDETECTIONENABLED = 0x1137
DTWAIN_CV_ICAPSUPPORTEDBARCODETYPES = 0x1138
DTWAIN_CV_ICAPBARCODEMAXSEARCHPRIORITIES = 0x1139
DTWAIN_CV_ICAPBARCODESEARCHPRIORITIES = 0x113a
DTWAIN_CV_ICAPBARCODESEARCHMODE = 0x113b
DTWAIN_CV_ICAPBARCODEMAXRETRIES = 0x113c
DTWAIN_CV_ICAPBARCODETIMEOUT = 0x113d
DTWAIN_CV_ICAPZOOMFACTOR = 0x113e
DTWAIN_CV_ICAPPATCHCODEDETECTIONENABLED = 0x113f
DTWAIN_CV_ICAPSUPPORTEDPATCHCODETYPES = 0x1140
DTWAIN_CV_ICAPPATCHCODEMAXSEARCHPRIORITIES = 0x1141
DTWAIN_CV_ICAPPATCHCODESEARCHPRIORITIES = 0x1142
DTWAIN_CV_ICAPPATCHCODESEARCHMODE = 0x1143
DTWAIN_CV_ICAPPATCHCODEMAXRETRIES = 0x1144
DTWAIN_CV_ICAPPATCHCODETIMEOUT = 0x1145
DTWAIN_CV_ICAPFLASHUSED2 = 0x1146
DTWAIN_CV_ICAPIMAGEFILTER = 0x1147
DTWAIN_CV_ICAPNOISEFILTER = 0x1148
DTWAIN_CV_ICAPOVERSCAN = 0x1149
DTWAIN_CV_ICAPAUTOMATICBORDERDETECTION = 0x1150
DTWAIN_CV_ICAPAUTOMATICDESKEW = 0x1151
DTWAIN_CV_ICAPAUTOMATICROTATE = 0x1152
DTWAIN_CV_ICAPJPEGQUALITY = 0x1153
DTWAIN_CV_ICAPFEEDERTYPE = 0x1154
DTWAIN_CV_ICAPICCPROFILE = 0x1155
DTWAIN_CV_ICAPAUTOSIZE = 0x1156
DTWAIN_CV_ICAPAUTOMATICCROPUSESFRAME = 0x1157
DTWAIN_CV_ICAPAUTOMATICLENGTHDETECTION = 0x1158
DTWAIN_CV_ICAPAUTOMATICCOLORENABLED = 0x1159
DTWAIN_CV_ICAPAUTOMATICCOLORNONCOLORPIXELTYPE = 0x115a
DTWAIN_CV_ICAPCOLORMANAGEMENTENABLED = 0x115b
DTWAIN_CV_ICAPIMAGEMERGE = 0x115c
DTWAIN_CV_ICAPIMAGEMERGEHEIGHTTHRESHOLD = 0x115d
DTWAIN_CV_ICAPSUPPORTEDEXTIMAGEINFO = 0x115e
DTWAIN_CV_ICAPFILMTYPE = 0x115f
DTWAIN_CV_ICAPMIRROR = 0x1160
DTWAIN_CV_ICAPJPEGSUBSAMPLING = 0x1161
DTWAIN_CV_ACAPAUDIOFILEFORMAT = 0x1201
DTWAIN_CV_ACAPXFERMECH = 0x1202
DTWAIN_CFMCV_CAPCFMSTART = 2048
DTWAIN_CFMCV_CAPDUPLEXSCANNER = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+10)
DTWAIN_CFMCV_CAPDUPLEXENABLE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+11)
DTWAIN_CFMCV_CAPSCANNERNAME = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+12)
DTWAIN_CFMCV_CAPSINGLEPASS = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+13)
DTWAIN_CFMCV_CAPERRHANDLING = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+20)
DTWAIN_CFMCV_CAPFEEDERSTATUS = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+21)
DTWAIN_CFMCV_CAPFEEDMEDIUMWAIT = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+22)
DTWAIN_CFMCV_CAPFEEDWAITTIME = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+23)
DTWAIN_CFMCV_ICAPWHITEBALANCE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+24)
DTWAIN_CFMCV_ICAPAUTOBINARY = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+25)
DTWAIN_CFMCV_ICAPIMAGESEPARATION = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+26)
DTWAIN_CFMCV_ICAPHARDWARECOMPRESSION = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+27)
DTWAIN_CFMCV_ICAPIMAGEEMPHASIS = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+28)
DTWAIN_CFMCV_ICAPOUTLINING = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+29)
DTWAIN_CFMCV_ICAPDYNTHRESHOLD = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+30)
DTWAIN_CFMCV_ICAPVARIANCE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+31)
DTWAIN_CFMCV_CAPENDORSERAVAILABLE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+32)
DTWAIN_CFMCV_CAPENDORSERENABLE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+33)
DTWAIN_CFMCV_CAPENDORSERCHARSET = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+34)
DTWAIN_CFMCV_CAPENDORSERSTRINGLENGTH = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+35)
DTWAIN_CFMCV_CAPENDORSERSTRING = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+36)
DTWAIN_CFMCV_ICAPDYNTHRESHOLDCURVE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+48)
DTWAIN_CFMCV_ICAPSMOOTHINGMODE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+49)
DTWAIN_CFMCV_ICAPFILTERMODE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+50)
DTWAIN_CFMCV_ICAPGRADATION = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+51)
DTWAIN_CFMCV_ICAPMIRROR = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+52)
DTWAIN_CFMCV_ICAPEASYSCANMODE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+53)
DTWAIN_CFMCV_ICAPSOFTWAREINTERPOLATION = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+54)
DTWAIN_CFMCV_ICAPIMAGESEPARATIONEX = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+55)
DTWAIN_CFMCV_CAPDUPLEXPAGE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+56)
DTWAIN_CFMCV_ICAPINVERTIMAGE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+57)
DTWAIN_CFMCV_ICAPSPECKLEREMOVE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+58)
DTWAIN_CFMCV_ICAPUSMFILTER = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+59)
DTWAIN_CFMCV_ICAPNOISEFILTERCFM = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+60)
DTWAIN_CFMCV_ICAPDESCREENING = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+61)
DTWAIN_CFMCV_ICAPQUALITYFILTER = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+62)
DTWAIN_CFMCV_ICAPBINARYFILTER = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+63)
DTWAIN_OCRCV_IMAGEFILEFORMAT = 0x1000
DTWAIN_OCRCV_DESKEW = 0x1001
DTWAIN_OCRCV_DESHADE = 0x1002
DTWAIN_OCRCV_ORIENTATION = 0x1003
DTWAIN_OCRCV_NOISEREMOVE = 0x1004
DTWAIN_OCRCV_LINEREMOVE = 0x1005
DTWAIN_OCRCV_INVERTPAGE = 0x1006
DTWAIN_OCRCV_INVERTZONES = 0x1007
DTWAIN_OCRCV_LINEREJECT = 0x1008
DTWAIN_OCRCV_CHARACTERREJECT = 0x1009
DTWAIN_OCRCV_ERRORREPORTMODE = 0x1010
DTWAIN_OCRCV_ERRORREPORTFILE = 0x1011
DTWAIN_OCRCV_PIXELTYPE = 0x1012
DTWAIN_OCRCV_BITDEPTH = 0x1013
DTWAIN_OCRCV_RETURNCHARINFO = 0x1014
DTWAIN_OCRCV_NATIVEFILEFORMAT = 0x1015
DTWAIN_OCRCV_MPNATIVEFILEFORMAT = 0x1016
DTWAIN_OCRCV_SUPPORTEDCAPS = 0x1017
DTWAIN_OCRCV_DISABLECHARACTERS = 0x1018
DTWAIN_OCRCV_REMOVECONTROLCHARS = 0x1019
DTWAIN_OCRORIENT_OFF = 0
DTWAIN_OCRORIENT_AUTO = 1
DTWAIN_OCRORIENT_90 = 2
DTWAIN_OCRORIENT_180 = 3
DTWAIN_OCRORIENT_270 = 4
DTWAIN_OCRIMAGEFORMAT_AUTO = 10000
DTWAIN_OCRERROR_MODENONE = 0
DTWAIN_OCRERROR_SHOWMSGBOX = 1
DTWAIN_OCRERROR_WRITEFILE = 2
DTWAIN_PDFTEXT_ALLPAGES = 0x00000001
DTWAIN_PDFTEXT_EVENPAGES = 0x00000002
DTWAIN_PDFTEXT_ODDPAGES = 0x00000004
DTWAIN_PDFTEXT_FIRSTPAGE = 0x00000008
DTWAIN_PDFTEXT_LASTPAGE = 0x00000010
DTWAIN_PDFTEXT_CURRENTPAGE = 0x00000020
DTWAIN_PDFTEXT_DISABLED = 0x00000040
DTWAIN_PDFTEXT_TOPLEFT = 0x00000100
DTWAIN_PDFTEXT_TOPRIGHT = 0x00000200
DTWAIN_PDFTEXT_HORIZCENTER = 0x00000400
DTWAIN_PDFTEXT_VERTCENTER = 0x00000800
DTWAIN_PDFTEXT_BOTTOMLEFT = 0x00001000
DTWAIN_PDFTEXT_BOTTOMRIGHT = 0x00002000
DTWAIN_PDFTEXT_BOTTOMCENTER = 0x00004000
DTWAIN_PDFTEXT_TOPCENTER = 0x00008000
DTWAIN_PDFTEXT_XCENTER = 0x00010000
DTWAIN_PDFTEXT_YCENTER = 0x00020000
DTWAIN_PDFTEXT_NOSCALING = 0x00100000
DTWAIN_PDFTEXT_NOCHARSPACING = 0x00200000
DTWAIN_PDFTEXT_NOWORDSPACING = 0x00400000
DTWAIN_PDFTEXT_NOSTROKEWIDTH = 0x00800000
DTWAIN_PDFTEXT_NORENDERMODE = 0x01000000
DTWAIN_PDFTEXT_NORGBCOLOR = 0x02000000
DTWAIN_PDFTEXT_NOFONTSIZE = 0x04000000
DTWAIN_PDFTEXT_NOABSPOSITION = 0x08000000
DTWAIN_PDFTEXT_NOROTATION = 0x10000000
DTWAIN_PDFTEXT_NOSKEWING = 0x20000000
DTWAIN_PDFTEXT_NOSCALINGXY = 0x40000000
DTWAIN_PDFTEXT_IGNOREALL = 0xFFF00000
DTWAIN_FONT_COURIER = 0
DTWAIN_FONT_COURIERBOLD = 1
DTWAIN_FONT_COURIERBOLDOBLIQUE = 2
DTWAIN_FONT_COURIEROBLIQUE = 3
DTWAIN_FONT_HELVETICA = 4
DTWAIN_FONT_HELVETICABOLD = 5
DTWAIN_FONT_HELVETICABOLDOBLIQUE = 6
DTWAIN_FONT_HELVETICAOBLIQUE = 7
DTWAIN_FONT_TIMESBOLD = 8
DTWAIN_FONT_TIMESBOLDITALIC = 9
DTWAIN_FONT_TIMESROMAN = 10
DTWAIN_FONT_TIMESITALIC = 11
DTWAIN_FONT_SYMBOL = 12
DTWAIN_FONT_ZAPFDINGBATS = 13
DTWAIN_PDFRENDER_FILL = 0
DTWAIN_PDFRENDER_STROKE = 1
DTWAIN_PDFRENDER_FILLSTROKE = 2
DTWAIN_PDFRENDER_INVISIBLE = 3
DTWAIN_PDFTEXTELEMENT_SCALINGXY = 0
DTWAIN_PDFTEXTELEMENT_FONTHEIGHT = 1
DTWAIN_PDFTEXTELEMENT_WORDSPACING = 2
DTWAIN_PDFTEXTELEMENT_POSITION = 3
DTWAIN_PDFTEXTELEMENT_COLOR = 4
DTWAIN_PDFTEXTELEMENT_STROKEWIDTH = 5
DTWAIN_PDFTEXTELEMENT_DISPLAYFLAGS = 6
DTWAIN_PDFTEXTELEMENT_FONTNAME = 7
DTWAIN_PDFTEXTELEMENT_TEXT = 8
DTWAIN_PDFTEXTELEMENT_RENDERMODE = 9
DTWAIN_PDFTEXTELEMENT_CHARSPACING = 10
DTWAIN_PDFTEXTELEMENT_ROTATIONANGLE = 11
DTWAIN_PDFTEXTELEMENT_LEADING = 12
DTWAIN_PDFTEXTELEMENT_SCALING = 13
DTWAIN_PDFTEXTELEMENT_TEXTLENGTH = 14
DTWAIN_PDFTEXTELEMENT_SKEWANGLES = 15
DTWAIN_PDFTEXTELEMENT_TRANSFORMORDER = 16
DTWAIN_PDFTEXTTRANSFORM_SRK = 0
DTWAIN_PDFTEXTTRANSFORM_SKR = 1
DTWAIN_PDFTEXTTRANSFORM_KSR = 2
DTWAIN_PDFTEXTTRANSFORM_KRS = 3
DTWAIN_PDFTEXTTRANSFORM_RSK = 4
DTWAIN_PDFTEXTTRANSFORM_RKS = 5
DTWAIN_PDFTEXTTRANFORM_LAST = DTWAIN_PDFTEXTTRANSFORM_RKS
DTWAIN_TWDF_ULTRASONIC = 0
DTWAIN_TWDF_BYLENGTH = 1
DTWAIN_TWDF_INFRARED = 2
DTWAIN_TWAS_NONE = 0
DTWAIN_TWAS_AUTO = 1
DTWAIN_TWAS_CURRENT = 2
DTWAIN_TWFR_BOOK = 0
DTWAIN_TWFR_FANFOLD = 1
DTWAIN_CONSTANT_TWPT = 0 
DTWAIN_CONSTANT_TWUN = 1 
DTWAIN_CONSTANT_TWCY = 2 
DTWAIN_CONSTANT_TWAL = 3 
DTWAIN_CONSTANT_TWAS = 4 
DTWAIN_CONSTANT_TWBCOR = 5 
DTWAIN_CONSTANT_TWBD = 6 
DTWAIN_CONSTANT_TWBO = 7 
DTWAIN_CONSTANT_TWBP = 8 
DTWAIN_CONSTANT_TWBR = 9 
DTWAIN_CONSTANT_TWBT = 10
DTWAIN_CONSTANT_TWCP = 11
DTWAIN_CONSTANT_TWCS = 12
DTWAIN_CONSTANT_TWDE = 13
DTWAIN_CONSTANT_TWDR = 14
DTWAIN_CONSTANT_TWDSK = 15
DTWAIN_CONSTANT_TWDX = 16
DTWAIN_CONSTANT_TWFA = 17
DTWAIN_CONSTANT_TWFE = 18
DTWAIN_CONSTANT_TWFF = 19
DTWAIN_CONSTANT_TWFL = 20
DTWAIN_CONSTANT_TWFO = 21
DTWAIN_CONSTANT_TWFP = 22
DTWAIN_CONSTANT_TWFR = 23
DTWAIN_CONSTANT_TWFT = 24
DTWAIN_CONSTANT_TWFY = 25
DTWAIN_CONSTANT_TWIA = 26
DTWAIN_CONSTANT_TWIC = 27
DTWAIN_CONSTANT_TWIF = 28
DTWAIN_CONSTANT_TWIM = 29
DTWAIN_CONSTANT_TWJC = 30
DTWAIN_CONSTANT_TWJQ = 31
DTWAIN_CONSTANT_TWLP = 32
DTWAIN_CONSTANT_TWLS = 33
DTWAIN_CONSTANT_TWMD = 34
DTWAIN_CONSTANT_TWNF = 35
DTWAIN_CONSTANT_TWOR = 36
DTWAIN_CONSTANT_TWOV = 37
DTWAIN_CONSTANT_TWPA = 38
DTWAIN_CONSTANT_TWPC = 39
DTWAIN_CONSTANT_TWPCH = 40
DTWAIN_CONSTANT_TWPF = 41
DTWAIN_CONSTANT_TWPM = 42
DTWAIN_CONSTANT_TWPR = 43
DTWAIN_CONSTANT_TWPF2 = 44
DTWAIN_CONSTANT_TWCT = 45
DTWAIN_CONSTANT_TWPS = 46
DTWAIN_CONSTANT_TWSS = 47
DTWAIN_CONSTANT_TWPH = 48
DTWAIN_CONSTANT_TWCI = 49
DTWAIN_CONSTANT_FONTNAME = 50
DTWAIN_CONSTANT_TWEI = 51
DTWAIN_CONSTANT_TWEJ = 52
DTWAIN_CONSTANT_TWCC = 53
DTWAIN_CONSTANT_TWQC = 54
DTWAIN_CONSTANT_TWRC = 55
DTWAIN_CONSTANT_MSG = 56
DTWAIN_CONSTANT_TWLG = 57
DTWAIN_CONSTANT_DLLINFO = 58
DTWAIN_CONSTANT_DG = 59
DTWAIN_CONSTANT_DAT = 60
DTWAIN_CONSTANT_DF = 61
DTWAIN_CONSTANT_TWTY = 62
DTWAIN_CONSTANT_TWCB = 63
DTWAIN_CONSTANT_TWAF = 64
DTWAIN_CONSTANT_TWFS = 65
DTWAIN_CONSTANT_TWJS = 66
DTWAIN_CONSTANT_TWMR = 67
DTWAIN_CONSTANT_TWDP = 68
DTWAIN_CONSTANT_TWUS = 69
DTWAIN_CONSTANT_TWDF = 70
DTWAIN_CONSTANT_TWFM = 71
DTWAIN_CONSTANT_TWSG = 72
DTWAIN_CONSTANT_DTWAIN_TN = 73
DTWAIN_CONSTANT_TWON = 74
DTWAIN_CONSTANT_TWMF = 75
DTWAIN_CONSTANT_TWSX = 76
DTWAIN_CONSTANT_CAP = 77
DTWAIN_CONSTANT_ICAP = 78
DTWAIN_CONSTANT_DTWAIN_CONT = 79
DTWAIN_CONSTANT_CAPCODE_MAP = 80
DTWAIN_CONSTANT_ACAP = 81
DTWAIN_CONSTANT_CAPCODE_NOMNEMONIC = 82
DTWAIN_CONSTANT_DTWAINCONT_TWAINCONT = 83
DTWAIN_CONSTANT_ERROR_NAMES = 84
DTWAIN_USERRES_START = 20000
DTWAIN_USERRES_MAXSIZE = 8192
DTWAIN_APIHANDLEOK = 1
DTWAIN_TWAINSESSIONOK = 2
DTWAIN_PDF_AES128 = 1
DTWAIN_PDF_AES256 = 2
DTWAIN_FEEDER_TERMINATE = 1
DTWAIN_FEEDER_USEFLATBED = 2

# Example:
# load the 64-bit unicode version of the dtwain dll
#
# import dtwain
# import ctypes
# ...
# dtwain_funcs = dtwain.load_dtwaindll("dtwain64u.dll") 
# 
# raise exceptions if the DLL name is not valid for the python runtime environment,
# misspelled DLL name, or if the DLL is not found or cannot be loaded.
def load_dtwaindll(dllName):
    all64 = ["dtwain64.dll", "dtwain64u.dll", "dtwain64d.dll", "dtwain64ud.dll"]
    all32 = ["dtwain32.dll", "dtwain32u.dll", "dtwain32d.dll", "dtwain32ud.dll"]
    all64a = ["dtwain64.dll", "dtwain64d.dll"]
    all32a = ["dtwain32.dll", "dtwain32d.dll"]

    file_name = os.path.basename(dllName)
    file_name = file_name.lower().rstrip()

    # check python runtime environment
    if struct.calcsize("P") * 8 == 64:
          if not file_name in all64:
               raise FileNotFoundError("The DTWAIN DLL base name " + file_name + " is not valid.  Valid names are: " + ", ".join(all64))  
    else:
          if not file_name in all32:
               raise FileNotFoundError("The DTWAIN DLL base name " + file_name + " is not valid.  Valid names are: " + ", ".join(all32))  
    isAnsi = False
    if file_name in all64a or file_name in all32a:
        isAnsi = True
    try:
        # load the dll  
        dtwain_dll = ct.windll.LoadLibrary(dllName)
        setup_windll(dtwain_dll, isAnsi)
        return dtwain_dll
    except FileNotFoundError as e:
        print(f"Error: {e}")
        raise e

def setup_windll(theDLL, isAnsi):
    if not isAnsi:
        setup_unicode(theDLL)
    else:
        setup_ansi(theDLL)

def setup_unicode(theDLL):
     # set up the callback types
     from ctypes.wintypes import WPARAM, LPARAM
     theDLL.SETCALLBACK_TYPE = ct.CFUNCTYPE(ct.c_long, WPARAM, LPARAM, ct.c_long)
     theDLL.SETCALLBACK64_TYPE = ct.CFUNCTYPE(ct.c_long, WPARAM, LPARAM, ct.c_int64)
     theDLL.SETERRORPROC_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_long, ct.c_long)
     theDLL.SETERRORPROC64_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_long, ct.c_int64)
     theDLL.SETLOGGERPROC_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_wchar_p, ct.c_int64)
     theDLL.SETLOGGERPROCA_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_char_p, ct.c_int64)
     theDLL.SETLOGGERPROCW_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_wchar_p, ct.c_int64)
     theDLL.ERRORPROC_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_long, ct.c_long)
     theDLL.ERRORPROC64_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_long, ct.c_int64)
     theDLL.DIBUPDATEPROC_TYPE = ct.CFUNCTYPE(ct.c_void_p, ct.c_void_p, ct.c_long, ct.c_void_p)

     #set up the return types
     theDLL.DTWAIN_AcquireAudioFile.restype = ct.c_long
     theDLL.DTWAIN_AcquireAudioFileA.restype = ct.c_long
     theDLL.DTWAIN_AcquireAudioFileW.restype = ct.c_long
     theDLL.DTWAIN_AcquireAudioNative.restype = ct.c_void_p
     theDLL.DTWAIN_AcquireAudioNativeEx.restype = ct.c_long
     theDLL.DTWAIN_AcquireBuffered.restype = ct.c_void_p
     theDLL.DTWAIN_AcquireBufferedEx.restype = ct.c_long
     theDLL.DTWAIN_AcquireFile.restype = ct.c_long
     theDLL.DTWAIN_AcquireFileA.restype = ct.c_long
     theDLL.DTWAIN_AcquireFileEx.restype = ct.c_long
     theDLL.DTWAIN_AcquireFileW.restype = ct.c_long
     theDLL.DTWAIN_AcquireNative.restype = ct.c_void_p
     theDLL.DTWAIN_AcquireNativeEx.restype = ct.c_long
     theDLL.DTWAIN_AcquireToClipboard.restype = ct.c_void_p
     theDLL.DTWAIN_AddExtImageInfoQuery.restype = ct.c_long
     theDLL.DTWAIN_AddPDFText.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextA.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextElement.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextEx.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextExA.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextExW.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextString.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextStringA.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextStringW.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextW.restype = ct.c_long
     theDLL.DTWAIN_AllocateMemory.restype = ct.c_void_p
     theDLL.DTWAIN_AllocateMemory64.restype = ct.c_void_p
     theDLL.DTWAIN_AllocateMemoryEx.restype = ct.c_void_p
     theDLL.DTWAIN_AppHandlesExceptions.restype = ct.c_long
     theDLL.DTWAIN_ArrayANSIStringToFloat.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayAdd.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddANSIString.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddANSIStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloat.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatString.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatStringNA.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatStringNW.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFrame.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFrameN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddLong.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddLong64.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddLong64N.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddLongN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddString.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddStringNA.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddStringNW.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddWideString.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddWideStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayConvertFix32ToFloat.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayConvertFloatToFix32.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCopy.restype = ct.c_long
     theDLL.DTWAIN_ArrayCreate.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCreateCopy.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCreateFromCap.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCreateFromLong64s.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCreateFromLongs.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCreateFromReals.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayDestroy.restype = ct.c_long
     theDLL.DTWAIN_ArrayDestroyFrames.restype = ct.c_long
     theDLL.DTWAIN_ArrayDumpToLog.restype = ct.c_long
     theDLL.DTWAIN_ArrayFind.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindANSIString.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindFloat.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindFloatString.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindLong.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindLong64.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindString.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindWideString.restype = ct.c_long
     theDLL.DTWAIN_ArrayFix32GetAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayFix32SetAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayFloatToANSIString.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayFloatToString.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayFloatToWideString.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtANSIString.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtANSIStringPtr.restype = ct.c_char_p
     theDLL.DTWAIN_ArrayGetAtFloat.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFloatEx.restype = ct.c_double
     theDLL.DTWAIN_ArrayGetAtFloatString.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFrame.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFrameEx.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFrameString.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFrameStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFrameStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtLong.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtLong64.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtLong64Ex.restype = ct.c_int64
     theDLL.DTWAIN_ArrayGetAtLongEx.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtSource.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtSourceEx.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetAtString.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtStringPtr.restype = ct.c_wchar_p
     theDLL.DTWAIN_ArrayGetAtStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtWideString.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtWideStringPtr.restype = ct.c_wchar_p
     theDLL.DTWAIN_ArrayGetBuffer.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetCapValues.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetCapValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetCapValuesEx2.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetCount.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetMaxStringLength.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetSourceAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetStringLength.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetType.restype = ct.c_long
     theDLL.DTWAIN_ArrayInit.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayInsertAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtANSIString.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtANSIStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloat.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatString.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatStringNA.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatStringNW.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFrame.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFrameN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtLong.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtLong64.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtLong64N.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtLongN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtString.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtStringNA.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtStringNW.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtWideString.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtWideStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayRemoveAll.restype = ct.c_long
     theDLL.DTWAIN_ArrayRemoveAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayRemoveAtN.restype = ct.c_long
     theDLL.DTWAIN_ArrayResize.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAt.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtANSIString.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFloat.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFloatString.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFrame.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFrameEx.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFrameString.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFrameStringA.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFrameStringW.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtLong.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtLong64.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtString.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtStringA.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtStringW.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtWideString.restype = ct.c_long
     theDLL.DTWAIN_ArrayStringToFloat.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayWideStringToFloat.restype = ct.c_void_p
     theDLL.DTWAIN_CallCallback.restype = ct.c_long
     theDLL.DTWAIN_CallCallback64.restype = ct.c_long
     theDLL.DTWAIN_CallDSMProc.restype = ct.c_long
     theDLL.DTWAIN_CheckHandles.restype = ct.c_long
     theDLL.DTWAIN_ClearBuffers.restype = ct.c_long
     theDLL.DTWAIN_ClearErrorBuffer.restype = ct.c_long
     theDLL.DTWAIN_ClearPDFTextElements.restype = ct.c_long
     theDLL.DTWAIN_ClearPage.restype = ct.c_long
     theDLL.DTWAIN_CloseSource.restype = ct.c_long
     theDLL.DTWAIN_CloseSourceUI.restype = ct.c_long
     theDLL.DTWAIN_ConvertDIBToBitmap.restype = ct.c_void_p
     theDLL.DTWAIN_ConvertDIBToFullBitmap.restype = ct.c_void_p
     theDLL.DTWAIN_ConvertToAPIString.restype = ct.c_void_p
     theDLL.DTWAIN_ConvertToAPIStringA.restype = ct.c_void_p
     theDLL.DTWAIN_ConvertToAPIStringEx.restype = ct.c_long
     theDLL.DTWAIN_ConvertToAPIStringExA.restype = ct.c_long
     theDLL.DTWAIN_ConvertToAPIStringExW.restype = ct.c_long
     theDLL.DTWAIN_ConvertToAPIStringW.restype = ct.c_void_p
     theDLL.DTWAIN_CreateAcquisitionArray.restype = ct.c_void_p
     theDLL.DTWAIN_CreatePDFTextElement.restype = ct.c_void_p
     theDLL.DTWAIN_CreatePDFTextElementCopy.restype = ct.c_void_p
     theDLL.DTWAIN_DeleteDIB.restype = ct.c_long
     theDLL.DTWAIN_DestroyAcquisitionArray.restype = ct.c_long
     theDLL.DTWAIN_DestroyPDFTextElement.restype = ct.c_long
     theDLL.DTWAIN_DisableAppWindow.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoBorderDetect.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoBright.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoDeskew.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoFeed.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoRotate.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoScan.restype = ct.c_long
     theDLL.DTWAIN_EnableAutomaticSenseMedium.restype = ct.c_long
     theDLL.DTWAIN_EnableBarcodeDetection.restype = ct.c_long
     theDLL.DTWAIN_EnableDuplex.restype = ct.c_long
     theDLL.DTWAIN_EnableFeeder.restype = ct.c_long
     theDLL.DTWAIN_EnableGetMessageLoop.restype = ct.c_long
     theDLL.DTWAIN_EnableGetMessageLoopDetection.restype = ct.c_long
     theDLL.DTWAIN_EnableIndicator.restype = ct.c_long
     theDLL.DTWAIN_EnableJobFileHandling.restype = ct.c_long
     theDLL.DTWAIN_EnableLamp.restype = ct.c_long
     theDLL.DTWAIN_EnableMsgNotify.restype = ct.c_long
     theDLL.DTWAIN_EnablePatchcodeDetection.restype = ct.c_long
     theDLL.DTWAIN_EnablePeekMessageLoop.restype = ct.c_long
     theDLL.DTWAIN_EnablePrinter.restype = ct.c_long
     theDLL.DTWAIN_EnableThumbnail.restype = ct.c_long
     theDLL.DTWAIN_EnableTripletsNotify.restype = ct.c_long
     theDLL.DTWAIN_EndThread.restype = ct.c_long
     theDLL.DTWAIN_EndTwainSession.restype = ct.c_long
     theDLL.DTWAIN_EnumAlarmVolumes.restype = ct.c_long
     theDLL.DTWAIN_EnumAlarmVolumesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumAlarms.restype = ct.c_long
     theDLL.DTWAIN_EnumAlarmsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumAudioXferMechs.restype = ct.c_long
     theDLL.DTWAIN_EnumAudioXferMechsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumAutoFeedValues.restype = ct.c_long
     theDLL.DTWAIN_EnumAutoFeedValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumAutomaticCaptures.restype = ct.c_long
     theDLL.DTWAIN_EnumAutomaticCapturesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumAutomaticSenseMedium.restype = ct.c_long
     theDLL.DTWAIN_EnumAutomaticSenseMediumEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodeCodes.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodeCodesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodeMaxPrioritiesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodeMaxRetriesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodePrioritiesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodeSearchModes.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodeSearchModesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodeTimeOutValues.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodeTimeOutValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBitDepths.restype = ct.c_long
     theDLL.DTWAIN_EnumBitDepthsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBitDepthsEx2.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBottomCameras.restype = ct.c_long
     theDLL.DTWAIN_EnumBottomCamerasEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBrightnessValues.restype = ct.c_long
     theDLL.DTWAIN_EnumBrightnessValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCameras.restype = ct.c_long
     theDLL.DTWAIN_EnumCamerasEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCamerasEx2.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCapLabels.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCompressionTypes.restype = ct.c_long
     theDLL.DTWAIN_EnumCompressionTypesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCompressionTypesEx2.restype = ct.c_void_p
     theDLL.DTWAIN_EnumContrastValues.restype = ct.c_long
     theDLL.DTWAIN_EnumContrastValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCustomCaps.restype = ct.c_long
     theDLL.DTWAIN_EnumCustomCapsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumDoubleFeedDetectLengths.restype = ct.c_long
     theDLL.DTWAIN_EnumDoubleFeedDetectLengthsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumDoubleFeedDetectValues.restype = ct.c_long
     theDLL.DTWAIN_EnumDoubleFeedDetectValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumExtImageInfoTypes.restype = ct.c_long
     theDLL.DTWAIN_EnumExtImageInfoTypesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumExtendedCaps.restype = ct.c_long
     theDLL.DTWAIN_EnumExtendedCapsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumExtendedCapsEx2.restype = ct.c_void_p
     theDLL.DTWAIN_EnumFileTypeBitsPerPixel.restype = ct.c_long
     theDLL.DTWAIN_EnumFileXferFormats.restype = ct.c_long
     theDLL.DTWAIN_EnumFileXferFormatsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumHalftones.restype = ct.c_long
     theDLL.DTWAIN_EnumHalftonesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumHighlightValues.restype = ct.c_long
     theDLL.DTWAIN_EnumHighlightValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumJobControls.restype = ct.c_long
     theDLL.DTWAIN_EnumJobControlsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumLightPaths.restype = ct.c_long
     theDLL.DTWAIN_EnumLightPathsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumLightSources.restype = ct.c_long
     theDLL.DTWAIN_EnumLightSourcesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumMaxBuffers.restype = ct.c_long
     theDLL.DTWAIN_EnumMaxBuffersEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumNoiseFilters.restype = ct.c_long
     theDLL.DTWAIN_EnumNoiseFiltersEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumOCRInterfaces.restype = ct.c_long
     theDLL.DTWAIN_EnumOCRInterfacesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumOCRSupportedCaps.restype = ct.c_long
     theDLL.DTWAIN_EnumOrientations.restype = ct.c_long
     theDLL.DTWAIN_EnumOrientationsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumOverscanValues.restype = ct.c_long
     theDLL.DTWAIN_EnumOverscanValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPaperSizes.restype = ct.c_long
     theDLL.DTWAIN_EnumPaperSizesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodeCodes.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodeCodesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodeMaxPrioritiesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodeMaxRetriesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodePrioritiesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodeSearchModes.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodeSearchModesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodeTimeOutValues.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodeTimeOutValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPixelTypes.restype = ct.c_long
     theDLL.DTWAIN_EnumPixelTypesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPrinterStringModes.restype = ct.c_long
     theDLL.DTWAIN_EnumPrinterStringModesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumResolutionValues.restype = ct.c_long
     theDLL.DTWAIN_EnumResolutionValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumShadowValues.restype = ct.c_long
     theDLL.DTWAIN_EnumShadowValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSourceUnits.restype = ct.c_long
     theDLL.DTWAIN_EnumSourceUnitsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSourceValues.restype = ct.c_long
     theDLL.DTWAIN_EnumSourceValuesA.restype = ct.c_long
     theDLL.DTWAIN_EnumSourceValuesW.restype = ct.c_long
     theDLL.DTWAIN_EnumSources.restype = ct.c_long
     theDLL.DTWAIN_EnumSourcesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedCaps.restype = ct.c_long
     theDLL.DTWAIN_EnumSupportedCapsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedCapsEx2.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedExtImageInfo.restype = ct.c_long
     theDLL.DTWAIN_EnumSupportedExtImageInfoEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedFileTypes.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedMultiPageFileTypes.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedSinglePageFileTypes.restype = ct.c_void_p
     theDLL.DTWAIN_EnumThresholdValues.restype = ct.c_long
     theDLL.DTWAIN_EnumThresholdValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumTopCameras.restype = ct.c_long
     theDLL.DTWAIN_EnumTopCamerasEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumTwainPrinters.restype = ct.c_long
     theDLL.DTWAIN_EnumTwainPrintersEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumXResolutionValues.restype = ct.c_long
     theDLL.DTWAIN_EnumXResolutionValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumYResolutionValues.restype = ct.c_long
     theDLL.DTWAIN_EnumYResolutionValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_ExecuteOCR.restype = ct.c_long
     theDLL.DTWAIN_ExecuteOCRA.restype = ct.c_long
     theDLL.DTWAIN_ExecuteOCRW.restype = ct.c_long
     theDLL.DTWAIN_FeedPage.restype = ct.c_long
     theDLL.DTWAIN_FlipBitmap.restype = ct.c_long
     theDLL.DTWAIN_FlushAcquiredPages.restype = ct.c_long
     theDLL.DTWAIN_FrameCreate.restype = ct.c_void_p
     theDLL.DTWAIN_FrameCreateString.restype = ct.c_void_p
     theDLL.DTWAIN_FrameCreateStringA.restype = ct.c_void_p
     theDLL.DTWAIN_FrameCreateStringW.restype = ct.c_void_p
     theDLL.DTWAIN_FrameDestroy.restype = ct.c_long
     theDLL.DTWAIN_FrameGetAll.restype = ct.c_long
     theDLL.DTWAIN_FrameGetAllString.restype = ct.c_long
     theDLL.DTWAIN_FrameGetAllStringA.restype = ct.c_long
     theDLL.DTWAIN_FrameGetAllStringW.restype = ct.c_long
     theDLL.DTWAIN_FrameGetValue.restype = ct.c_long
     theDLL.DTWAIN_FrameGetValueString.restype = ct.c_long
     theDLL.DTWAIN_FrameGetValueStringA.restype = ct.c_long
     theDLL.DTWAIN_FrameGetValueStringW.restype = ct.c_long
     theDLL.DTWAIN_FrameIsValid.restype = ct.c_long
     theDLL.DTWAIN_FrameSetAll.restype = ct.c_long
     theDLL.DTWAIN_FrameSetAllString.restype = ct.c_long
     theDLL.DTWAIN_FrameSetAllStringA.restype = ct.c_long
     theDLL.DTWAIN_FrameSetAllStringW.restype = ct.c_long
     theDLL.DTWAIN_FrameSetValue.restype = ct.c_long
     theDLL.DTWAIN_FrameSetValueString.restype = ct.c_long
     theDLL.DTWAIN_FrameSetValueStringA.restype = ct.c_long
     theDLL.DTWAIN_FrameSetValueStringW.restype = ct.c_long
     theDLL.DTWAIN_FreeExtImageInfo.restype = ct.c_long
     theDLL.DTWAIN_FreeMemory.restype = ct.c_long
     theDLL.DTWAIN_FreeMemoryEx.restype = ct.c_long
     theDLL.DTWAIN_GetAPIHandleStatus.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireArea.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireArea2.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireArea2String.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireArea2StringA.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireArea2StringW.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireAreaEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetAcquireMetrics.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireStripBuffer.restype = ct.c_void_p
     theDLL.DTWAIN_GetAcquireStripData.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireStripSizes.restype = ct.c_long
     theDLL.DTWAIN_GetAcquiredImage.restype = ct.c_void_p
     theDLL.DTWAIN_GetAcquiredImageArray.restype = ct.c_void_p
     theDLL.DTWAIN_GetAcquisitionArray.restype = ct.c_void_p
     theDLL.DTWAIN_GetActiveDSMPath.restype = ct.c_long
     theDLL.DTWAIN_GetActiveDSMPathA.restype = ct.c_long
     theDLL.DTWAIN_GetActiveDSMPathW.restype = ct.c_long
     theDLL.DTWAIN_GetActiveDSMVersionInfo.restype = ct.c_long
     theDLL.DTWAIN_GetActiveDSMVersionInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetActiveDSMVersionInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetAlarmVolume.restype = ct.c_long
     theDLL.DTWAIN_GetAllSourceDibs.restype = ct.c_void_p
     theDLL.DTWAIN_GetAppInfo.restype = ct.c_long
     theDLL.DTWAIN_GetAppInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetAppInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetAuthor.restype = ct.c_long
     theDLL.DTWAIN_GetAuthorA.restype = ct.c_long
     theDLL.DTWAIN_GetAuthorW.restype = ct.c_long
     theDLL.DTWAIN_GetBarcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_GetBarcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_GetBarcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_GetBarcodeSearchMode.restype = ct.c_long
     theDLL.DTWAIN_GetBarcodeTimeOut.restype = ct.c_long
     theDLL.DTWAIN_GetBatteryMinutes.restype = ct.c_long
     theDLL.DTWAIN_GetBatteryPercent.restype = ct.c_long
     theDLL.DTWAIN_GetBitDepth.restype = ct.c_long
     theDLL.DTWAIN_GetBitDepthEx.restype = ct.c_long
     theDLL.DTWAIN_GetBlankPageAutoDetection.restype = ct.c_long
     theDLL.DTWAIN_GetBrightness.restype = ct.c_long
     theDLL.DTWAIN_GetBrightnessEx.restype = ct.c_double
     theDLL.DTWAIN_GetBrightnessString.restype = ct.c_long
     theDLL.DTWAIN_GetBrightnessStringA.restype = ct.c_long
     theDLL.DTWAIN_GetBrightnessStringW.restype = ct.c_long
     theDLL.DTWAIN_GetBufferedTransferInfo.restype = ct.c_void_p
     theDLL.DTWAIN_GetCallback.restype = theDLL.SETCALLBACK_TYPE
     theDLL.DTWAIN_GetCallback64.restype = theDLL.SETCALLBACK64_TYPE
     theDLL.DTWAIN_GetCapArrayType.restype = ct.c_long
     theDLL.DTWAIN_GetCapContainer.restype = ct.c_long
     theDLL.DTWAIN_GetCapContainerEx.restype = ct.c_long
     theDLL.DTWAIN_GetCapContainerEx2.restype = ct.c_void_p
     theDLL.DTWAIN_GetCapDataType.restype = ct.c_long
     theDLL.DTWAIN_GetCapFromName.restype = ct.c_long
     theDLL.DTWAIN_GetCapFromNameA.restype = ct.c_long
     theDLL.DTWAIN_GetCapFromNameW.restype = ct.c_long
     theDLL.DTWAIN_GetCapHelp.restype = ct.c_long
     theDLL.DTWAIN_GetCapHelpA.restype = ct.c_long
     theDLL.DTWAIN_GetCapHelpW.restype = ct.c_long
     theDLL.DTWAIN_GetCapLabel.restype = ct.c_long
     theDLL.DTWAIN_GetCapLabelA.restype = ct.c_long
     theDLL.DTWAIN_GetCapLabelW.restype = ct.c_long
     theDLL.DTWAIN_GetCapOperations.restype = ct.c_long
     theDLL.DTWAIN_GetCapOperationsEx.restype = ct.c_long
     theDLL.DTWAIN_GetCapValues.restype = ct.c_long
     theDLL.DTWAIN_GetCapValuesEx.restype = ct.c_long
     theDLL.DTWAIN_GetCapValuesEx2.restype = ct.c_long
     theDLL.DTWAIN_GetCaption.restype = ct.c_long
     theDLL.DTWAIN_GetCaptionA.restype = ct.c_long
     theDLL.DTWAIN_GetCaptionW.restype = ct.c_long
     theDLL.DTWAIN_GetCompressionSize.restype = ct.c_long
     theDLL.DTWAIN_GetCompressionType.restype = ct.c_long
     theDLL.DTWAIN_GetCompressionTypeEx.restype = ct.c_long
     theDLL.DTWAIN_GetConditionCodeString.restype = ct.c_long
     theDLL.DTWAIN_GetConditionCodeStringA.restype = ct.c_long
     theDLL.DTWAIN_GetConditionCodeStringW.restype = ct.c_long
     theDLL.DTWAIN_GetConstantFromTwainName.restype = ct.c_long
     theDLL.DTWAIN_GetConstantFromTwainNameA.restype = ct.c_long
     theDLL.DTWAIN_GetConstantFromTwainNameW.restype = ct.c_long
     theDLL.DTWAIN_GetContrast.restype = ct.c_long
     theDLL.DTWAIN_GetContrastEx.restype = ct.c_double
     theDLL.DTWAIN_GetContrastString.restype = ct.c_long
     theDLL.DTWAIN_GetContrastStringA.restype = ct.c_long
     theDLL.DTWAIN_GetContrastStringW.restype = ct.c_long
     theDLL.DTWAIN_GetCountry.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentAcquiredImage.restype = ct.c_void_p
     theDLL.DTWAIN_GetCurrentFileName.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentFileNameA.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentFileNameW.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentPageNum.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentRetryCount.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentTwainTriplet.restype = ct.c_long
     theDLL.DTWAIN_GetCustomDSData.restype = ct.c_void_p
     theDLL.DTWAIN_GetDSMFullName.restype = ct.c_long
     theDLL.DTWAIN_GetDSMFullNameA.restype = ct.c_long
     theDLL.DTWAIN_GetDSMFullNameW.restype = ct.c_long
     theDLL.DTWAIN_GetDSMSearchOrder.restype = ct.c_long
     theDLL.DTWAIN_GetDSMSearchOrderEx.restype = ct.c_long
     theDLL.DTWAIN_GetDSMSearchOrderExA.restype = ct.c_long
     theDLL.DTWAIN_GetDSMSearchOrderExW.restype = ct.c_long
     theDLL.DTWAIN_GetDTWAINHandle.restype = ct.c_void_p
     theDLL.DTWAIN_GetDeviceEvent.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceEventEx.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceEventInfo.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceNotifications.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceTimeDate.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceTimeDateA.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceTimeDateW.restype = ct.c_long
     theDLL.DTWAIN_GetDoubleFeedDetectLength.restype = ct.c_long
     theDLL.DTWAIN_GetDoubleFeedDetectValues.restype = ct.c_long
     theDLL.DTWAIN_GetDuplexType.restype = ct.c_long
     theDLL.DTWAIN_GetDuplexTypeEx.restype = ct.c_long
     theDLL.DTWAIN_GetErrorBuffer.restype = ct.c_long
     theDLL.DTWAIN_GetErrorBufferThreshold.restype = ct.c_long
     theDLL.DTWAIN_GetErrorCallback.restype = theDLL.SETERRORPROC_TYPE
     theDLL.DTWAIN_GetErrorCallback64.restype = theDLL.SETERRORPROC64_TYPE
     theDLL.DTWAIN_GetErrorString.restype = ct.c_long
     theDLL.DTWAIN_GetErrorStringA.restype = ct.c_long
     theDLL.DTWAIN_GetErrorStringW.restype = ct.c_long
     theDLL.DTWAIN_GetExtCapFromName.restype = ct.c_long
     theDLL.DTWAIN_GetExtCapFromNameA.restype = ct.c_long
     theDLL.DTWAIN_GetExtCapFromNameW.restype = ct.c_long
     theDLL.DTWAIN_GetExtImageInfo.restype = ct.c_long
     theDLL.DTWAIN_GetExtImageInfoData.restype = ct.c_long
     theDLL.DTWAIN_GetExtImageInfoDataEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetExtImageInfoItem.restype = ct.c_long
     theDLL.DTWAIN_GetExtImageInfoItemEx.restype = ct.c_long
     theDLL.DTWAIN_GetExtNameFromCap.restype = ct.c_long
     theDLL.DTWAIN_GetExtNameFromCapA.restype = ct.c_long
     theDLL.DTWAIN_GetExtNameFromCapW.restype = ct.c_long
     theDLL.DTWAIN_GetFeederAlignment.restype = ct.c_long
     theDLL.DTWAIN_GetFeederFuncs.restype = ct.c_long
     theDLL.DTWAIN_GetFeederOrder.restype = ct.c_long
     theDLL.DTWAIN_GetFeederWaitTime.restype = ct.c_long
     theDLL.DTWAIN_GetFileCompressionType.restype = ct.c_long
     theDLL.DTWAIN_GetFileSavePageCount.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeExtensions.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeExtensionsA.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeExtensionsW.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeName.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeNameA.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeNameW.restype = ct.c_long
     theDLL.DTWAIN_GetHalftone.restype = ct.c_long
     theDLL.DTWAIN_GetHalftoneA.restype = ct.c_long
     theDLL.DTWAIN_GetHalftoneW.restype = ct.c_long
     theDLL.DTWAIN_GetHighlight.restype = ct.c_long
     theDLL.DTWAIN_GetHighlightString.restype = ct.c_long
     theDLL.DTWAIN_GetHighlightStringA.restype = ct.c_long
     theDLL.DTWAIN_GetHighlightStringW.restype = ct.c_long
     theDLL.DTWAIN_GetImageInfo.restype = ct.c_long
     theDLL.DTWAIN_GetImageInfoString.restype = ct.c_long
     theDLL.DTWAIN_GetImageInfoStringA.restype = ct.c_long
     theDLL.DTWAIN_GetImageInfoStringW.restype = ct.c_long
     theDLL.DTWAIN_GetJobControl.restype = ct.c_long
     theDLL.DTWAIN_GetJobControlEx.restype = ct.c_long
     theDLL.DTWAIN_GetJpegValues.restype = ct.c_long
     theDLL.DTWAIN_GetJpegXRValues.restype = ct.c_long
     theDLL.DTWAIN_GetLanguage.restype = ct.c_long
     theDLL.DTWAIN_GetLastError.restype = ct.c_long
     theDLL.DTWAIN_GetLibraryPath.restype = ct.c_long
     theDLL.DTWAIN_GetLibraryPathA.restype = ct.c_long
     theDLL.DTWAIN_GetLibraryPathW.restype = ct.c_long
     theDLL.DTWAIN_GetLightPath.restype = ct.c_long
     theDLL.DTWAIN_GetLightPathEx.restype = ct.c_long
     theDLL.DTWAIN_GetLightSource.restype = ct.c_long
     theDLL.DTWAIN_GetLightSources.restype = ct.c_long
     theDLL.DTWAIN_GetLightSourcesEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetLoggerCallback.restype = theDLL.SETLOGGERPROC_TYPE
     theDLL.DTWAIN_GetLoggerCallbackA.restype = theDLL.SETLOGGERPROCA_TYPE
     theDLL.DTWAIN_GetLoggerCallbackW.restype = theDLL.SETLOGGERPROCW_TYPE
     theDLL.DTWAIN_GetManualDuplexCount.restype = ct.c_long
     theDLL.DTWAIN_GetMaxAcquisitions.restype = ct.c_long
     theDLL.DTWAIN_GetMaxBuffers.restype = ct.c_long
     theDLL.DTWAIN_GetMaxPagesToAcquire.restype = ct.c_long
     theDLL.DTWAIN_GetMaxRetryAttempts.restype = ct.c_long
     theDLL.DTWAIN_GetNameFromCap.restype = ct.c_long
     theDLL.DTWAIN_GetNameFromCapA.restype = ct.c_long
     theDLL.DTWAIN_GetNameFromCapW.restype = ct.c_long
     theDLL.DTWAIN_GetNoiseFilter.restype = ct.c_long
     theDLL.DTWAIN_GetNumAcquiredImages.restype = ct.c_long
     theDLL.DTWAIN_GetNumAcquisitions.restype = ct.c_long
     theDLL.DTWAIN_GetOCRCapValues.restype = ct.c_long
     theDLL.DTWAIN_GetOCRErrorString.restype = ct.c_long
     theDLL.DTWAIN_GetOCRErrorStringA.restype = ct.c_long
     theDLL.DTWAIN_GetOCRErrorStringW.restype = ct.c_long
     theDLL.DTWAIN_GetOCRLastError.restype = ct.c_long
     theDLL.DTWAIN_GetOCRMajorMinorVersion.restype = ct.c_long
     theDLL.DTWAIN_GetOCRManufacturer.restype = ct.c_long
     theDLL.DTWAIN_GetOCRManufacturerA.restype = ct.c_long
     theDLL.DTWAIN_GetOCRManufacturerW.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductFamily.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductFamilyA.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductFamilyW.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductName.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductNameA.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductNameW.restype = ct.c_long
     theDLL.DTWAIN_GetOCRText.restype = ct.c_void_p
     theDLL.DTWAIN_GetOCRTextA.restype = ct.c_void_p
     theDLL.DTWAIN_GetOCRTextInfoFloat.restype = ct.c_long
     theDLL.DTWAIN_GetOCRTextInfoFloatEx.restype = ct.c_long
     theDLL.DTWAIN_GetOCRTextInfoHandle.restype = ct.c_void_p
     theDLL.DTWAIN_GetOCRTextInfoLong.restype = ct.c_long
     theDLL.DTWAIN_GetOCRTextInfoLongEx.restype = ct.c_long
     theDLL.DTWAIN_GetOCRTextW.restype = ct.c_void_p
     theDLL.DTWAIN_GetOCRVersionInfo.restype = ct.c_long
     theDLL.DTWAIN_GetOCRVersionInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetOCRVersionInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetOrientation.restype = ct.c_long
     theDLL.DTWAIN_GetOrientationEx.restype = ct.c_long
     theDLL.DTWAIN_GetOverscan.restype = ct.c_long
     theDLL.DTWAIN_GetPDFTextElementFloat.restype = ct.c_long
     theDLL.DTWAIN_GetPDFTextElementLong.restype = ct.c_long
     theDLL.DTWAIN_GetPDFTextElementString.restype = ct.c_long
     theDLL.DTWAIN_GetPDFTextElementStringA.restype = ct.c_long
     theDLL.DTWAIN_GetPDFTextElementStringW.restype = ct.c_long
     theDLL.DTWAIN_GetPDFType1FontName.restype = ct.c_long
     theDLL.DTWAIN_GetPDFType1FontNameA.restype = ct.c_long
     theDLL.DTWAIN_GetPDFType1FontNameW.restype = ct.c_long
     theDLL.DTWAIN_GetPaperSize.restype = ct.c_long
     theDLL.DTWAIN_GetPaperSizeName.restype = ct.c_long
     theDLL.DTWAIN_GetPaperSizeNameA.restype = ct.c_long
     theDLL.DTWAIN_GetPaperSizeNameW.restype = ct.c_long
     theDLL.DTWAIN_GetPatchcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_GetPatchcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_GetPatchcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_GetPatchcodeSearchMode.restype = ct.c_long
     theDLL.DTWAIN_GetPatchcodeTimeOut.restype = ct.c_long
     theDLL.DTWAIN_GetPixelFlavor.restype = ct.c_long
     theDLL.DTWAIN_GetPixelType.restype = ct.c_long
     theDLL.DTWAIN_GetPrinter.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterEx.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStartNumber.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStartNumberEx.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStringMode.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStringModeEx.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStrings.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStringsEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetPrinterSuffixString.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterSuffixStringA.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterSuffixStringW.restype = ct.c_long
     theDLL.DTWAIN_GetRegisteredMsg.restype = ct.c_long
     theDLL.DTWAIN_GetResolution.restype = ct.c_long
     theDLL.DTWAIN_GetResolutionEx.restype = ct.c_double
     theDLL.DTWAIN_GetResolutionString.restype = ct.c_long
     theDLL.DTWAIN_GetResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_GetResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_GetResourceString.restype = ct.c_long
     theDLL.DTWAIN_GetResourceStringA.restype = ct.c_long
     theDLL.DTWAIN_GetResourceStringW.restype = ct.c_long
     theDLL.DTWAIN_GetRotation.restype = ct.c_long
     theDLL.DTWAIN_GetRotationEx.restype = ct.c_double
     theDLL.DTWAIN_GetRotationString.restype = ct.c_long
     theDLL.DTWAIN_GetRotationStringA.restype = ct.c_long
     theDLL.DTWAIN_GetRotationStringW.restype = ct.c_long
     theDLL.DTWAIN_GetSaveFileName.restype = ct.c_long
     theDLL.DTWAIN_GetSaveFileNameA.restype = ct.c_long
     theDLL.DTWAIN_GetSaveFileNameW.restype = ct.c_long
     theDLL.DTWAIN_GetSessionDetails.restype = ct.c_long
     theDLL.DTWAIN_GetSessionDetailsA.restype = ct.c_long
     theDLL.DTWAIN_GetSessionDetailsW.restype = ct.c_long
     theDLL.DTWAIN_GetShadow.restype = ct.c_long
     theDLL.DTWAIN_GetShadowString.restype = ct.c_long
     theDLL.DTWAIN_GetShadowStringA.restype = ct.c_long
     theDLL.DTWAIN_GetShadowStringW.restype = ct.c_long
     theDLL.DTWAIN_GetShortVersionString.restype = ct.c_long
     theDLL.DTWAIN_GetShortVersionStringA.restype = ct.c_long
     theDLL.DTWAIN_GetShortVersionStringW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceAcquisitions.restype = ct.c_void_p
     theDLL.DTWAIN_GetSourceDetails.restype = ct.c_long
     theDLL.DTWAIN_GetSourceDetailsA.restype = ct.c_long
     theDLL.DTWAIN_GetSourceDetailsW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceID.restype = ct.c_void_p
     theDLL.DTWAIN_GetSourceIDEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetSourceManufacturer.restype = ct.c_long
     theDLL.DTWAIN_GetSourceManufacturerA.restype = ct.c_long
     theDLL.DTWAIN_GetSourceManufacturerW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductFamily.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductFamilyA.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductFamilyW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductName.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductNameA.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductNameW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceUnit.restype = ct.c_long
     theDLL.DTWAIN_GetSourceUnitEx.restype = ct.c_long
     theDLL.DTWAIN_GetSourceVersionInfo.restype = ct.c_long
     theDLL.DTWAIN_GetSourceVersionInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetSourceVersionInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceVersionNumber.restype = ct.c_long
     theDLL.DTWAIN_GetStaticLibVersion.restype = ct.c_long
     theDLL.DTWAIN_GetTempFileDirectory.restype = ct.c_long
     theDLL.DTWAIN_GetTempFileDirectoryA.restype = ct.c_long
     theDLL.DTWAIN_GetTempFileDirectoryW.restype = ct.c_long
     theDLL.DTWAIN_GetThreshold.restype = ct.c_long
     theDLL.DTWAIN_GetThresholdString.restype = ct.c_long
     theDLL.DTWAIN_GetThresholdStringA.restype = ct.c_long
     theDLL.DTWAIN_GetThresholdStringW.restype = ct.c_long
     theDLL.DTWAIN_GetTimeDate.restype = ct.c_long
     theDLL.DTWAIN_GetTimeDateA.restype = ct.c_long
     theDLL.DTWAIN_GetTimeDateW.restype = ct.c_long
     theDLL.DTWAIN_GetTwainAppID.restype = ct.c_void_p
     theDLL.DTWAIN_GetTwainAppIDEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetTwainAvailability.restype = ct.c_long
     theDLL.DTWAIN_GetTwainAvailabilityEx.restype = ct.c_long
     theDLL.DTWAIN_GetTwainAvailabilityExA.restype = ct.c_long
     theDLL.DTWAIN_GetTwainAvailabilityExW.restype = ct.c_long
     theDLL.DTWAIN_GetTwainHwnd.restype = ct.c_void_p
     theDLL.DTWAIN_GetTwainMode.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstant.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstantA.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstantEx.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstantExA.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstantExW.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstantW.restype = ct.c_long
     theDLL.DTWAIN_GetTwainTimeout.restype = ct.c_long
     theDLL.DTWAIN_GetVersion.restype = ct.c_long
     theDLL.DTWAIN_GetVersionCopyright.restype = ct.c_long
     theDLL.DTWAIN_GetVersionCopyrightA.restype = ct.c_long
     theDLL.DTWAIN_GetVersionCopyrightW.restype = ct.c_long
     theDLL.DTWAIN_GetVersionEx.restype = ct.c_long
     theDLL.DTWAIN_GetVersionInfo.restype = ct.c_long
     theDLL.DTWAIN_GetVersionInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetVersionInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetVersionString.restype = ct.c_long
     theDLL.DTWAIN_GetVersionStringA.restype = ct.c_long
     theDLL.DTWAIN_GetVersionStringW.restype = ct.c_long
     theDLL.DTWAIN_GetWindowsVersionInfo.restype = ct.c_long
     theDLL.DTWAIN_GetWindowsVersionInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetWindowsVersionInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetXResolution.restype = ct.c_long
     theDLL.DTWAIN_GetXResolutionString.restype = ct.c_long
     theDLL.DTWAIN_GetXResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_GetXResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_GetYResolution.restype = ct.c_long
     theDLL.DTWAIN_GetYResolutionString.restype = ct.c_long
     theDLL.DTWAIN_GetYResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_GetYResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_InitExtImageInfo.restype = ct.c_long
     theDLL.DTWAIN_InitImageFileAppend.restype = ct.c_long
     theDLL.DTWAIN_InitImageFileAppendA.restype = ct.c_long
     theDLL.DTWAIN_InitImageFileAppendW.restype = ct.c_long
     theDLL.DTWAIN_InitOCRInterface.restype = ct.c_long
     theDLL.DTWAIN_IsAcquiring.restype = ct.c_long
     theDLL.DTWAIN_IsAudioXferSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoBorderDetectEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutoBorderDetectSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoBrightEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutoBrightSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoDeskewEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutoDeskewSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoFeedEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutoFeedSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoRotateEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutoRotateSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoScanEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutomaticSenseMediumEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutomaticSenseMediumSupported.restype = ct.c_long
     theDLL.DTWAIN_IsBarcodeCapsSupported.restype = ct.c_long
     theDLL.DTWAIN_IsBarcodeDetectionEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsBarcodeSupported.restype = ct.c_long
     theDLL.DTWAIN_IsBlankPageDetectionOn.restype = ct.c_long
     theDLL.DTWAIN_IsBufferedTileModeOn.restype = ct.c_long
     theDLL.DTWAIN_IsBufferedTileModeSupported.restype = ct.c_long
     theDLL.DTWAIN_IsCapSupported.restype = ct.c_long
     theDLL.DTWAIN_IsCompressionSupported.restype = ct.c_long
     theDLL.DTWAIN_IsCustomDSDataSupported.restype = ct.c_long
     theDLL.DTWAIN_IsDIBBlank.restype = ct.c_long
     theDLL.DTWAIN_IsDIBBlankString.restype = ct.c_long
     theDLL.DTWAIN_IsDIBBlankStringA.restype = ct.c_long
     theDLL.DTWAIN_IsDIBBlankStringW.restype = ct.c_long
     theDLL.DTWAIN_IsDeviceEventSupported.restype = ct.c_long
     theDLL.DTWAIN_IsDeviceOnLine.restype = ct.c_long
     theDLL.DTWAIN_IsDoubleFeedDetectLengthSupported.restype = ct.c_long
     theDLL.DTWAIN_IsDoubleFeedDetectSupported.restype = ct.c_long
     theDLL.DTWAIN_IsDuplexEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsDuplexSupported.restype = ct.c_long
     theDLL.DTWAIN_IsExtImageInfoSupported.restype = ct.c_long
     theDLL.DTWAIN_IsFeederEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsFeederLoaded.restype = ct.c_long
     theDLL.DTWAIN_IsFeederSensitive.restype = ct.c_long
     theDLL.DTWAIN_IsFeederSupported.restype = ct.c_long
     theDLL.DTWAIN_IsFileSystemSupported.restype = ct.c_long
     theDLL.DTWAIN_IsFileXferSupported.restype = ct.c_long
     theDLL.DTWAIN_IsGetMessageLoopDetectionOn.restype = ct.c_long
     theDLL.DTWAIN_IsGetMessageLoopEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldALastPageSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldALevelSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldAPrintFormatSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldAValueSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldBLastPageSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldBLevelSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldBPrintFormatSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldBValueSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldCLastPageSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldCLevelSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldCPrintFormatSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldCValueSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldDLastPageSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldDLevelSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldDPrintFormatSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldDValueSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldELastPageSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldELevelSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldEPrintFormatSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldEValueSupported.restype = ct.c_long
     theDLL.DTWAIN_IsImageAddressingSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIndicatorEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsIndicatorSupported.restype = ct.c_long
     theDLL.DTWAIN_IsInitialized.restype = ct.c_long
     theDLL.DTWAIN_IsJobControlSupported.restype = ct.c_long
     theDLL.DTWAIN_IsLampEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsLampSupported.restype = ct.c_long
     theDLL.DTWAIN_IsLightPathSupported.restype = ct.c_long
     theDLL.DTWAIN_IsLightSourceSupported.restype = ct.c_long
     theDLL.DTWAIN_IsMaxBuffersSupported.restype = ct.c_long
     theDLL.DTWAIN_IsMemFileXferSupported.restype = ct.c_long
     theDLL.DTWAIN_IsMsgNotifyEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsNotifyTripletsEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsOCREngineActivated.restype = ct.c_long
     theDLL.DTWAIN_IsOpenSourcesOnSelect.restype = ct.c_long
     theDLL.DTWAIN_IsOrientationSupported.restype = ct.c_long
     theDLL.DTWAIN_IsOverscanSupported.restype = ct.c_long
     theDLL.DTWAIN_IsPaperDetectable.restype = ct.c_long
     theDLL.DTWAIN_IsPaperSizeSupported.restype = ct.c_long
     theDLL.DTWAIN_IsPatchcodeCapsSupported.restype = ct.c_long
     theDLL.DTWAIN_IsPatchcodeDetectionEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsPatchcodeSupported.restype = ct.c_long
     theDLL.DTWAIN_IsPeekMessageLoopEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsPixelTypeSupported.restype = ct.c_long
     theDLL.DTWAIN_IsPrinterEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsPrinterSupported.restype = ct.c_long
     theDLL.DTWAIN_IsRotationSupported.restype = ct.c_long
     theDLL.DTWAIN_IsSessionEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsSkipImageInfoError.restype = ct.c_long
     theDLL.DTWAIN_IsSourceAcquiring.restype = ct.c_long
     theDLL.DTWAIN_IsSourceAcquiringEx.restype = ct.c_long
     theDLL.DTWAIN_IsSourceInUIOnlyMode.restype = ct.c_long
     theDLL.DTWAIN_IsSourceOpen.restype = ct.c_long
     theDLL.DTWAIN_IsSourceSelected.restype = ct.c_long
     theDLL.DTWAIN_IsSourceValid.restype = ct.c_long
     theDLL.DTWAIN_IsThumbnailEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsThumbnailSupported.restype = ct.c_long
     theDLL.DTWAIN_IsTwainAvailable.restype = ct.c_long
     theDLL.DTWAIN_IsTwainAvailableEx.restype = ct.c_long
     theDLL.DTWAIN_IsTwainAvailableExA.restype = ct.c_long
     theDLL.DTWAIN_IsTwainAvailableExW.restype = ct.c_long
     theDLL.DTWAIN_IsUIControllable.restype = ct.c_long
     theDLL.DTWAIN_IsUIEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsUIOnlySupported.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResources.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResourcesA.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResourcesEx.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResourcesExA.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResourcesExW.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResourcesW.restype = ct.c_long
     theDLL.DTWAIN_LoadLanguageResource.restype = ct.c_long
     theDLL.DTWAIN_LockMemory.restype = ct.c_void_p
     theDLL.DTWAIN_LockMemoryEx.restype = ct.c_void_p
     theDLL.DTWAIN_LogMessage.restype = ct.c_long
     theDLL.DTWAIN_LogMessageA.restype = ct.c_long
     theDLL.DTWAIN_LogMessageW.restype = ct.c_long
     theDLL.DTWAIN_MakeRGB.restype = ct.c_long
     theDLL.DTWAIN_OpenSource.restype = ct.c_long
     theDLL.DTWAIN_OpenSourcesOnSelect.restype = ct.c_long
     theDLL.DTWAIN_RangeCreate.restype = ct.c_void_p
     theDLL.DTWAIN_RangeCreateFromCap.restype = ct.c_void_p
     theDLL.DTWAIN_RangeDestroy.restype = ct.c_long
     theDLL.DTWAIN_RangeExpand.restype = ct.c_long
     theDLL.DTWAIN_RangeExpandEx.restype = ct.c_void_p
     theDLL.DTWAIN_RangeGetAll.restype = ct.c_long
     theDLL.DTWAIN_RangeGetAllFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeGetAllFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeGetAllFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeGetAllFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeGetAllLong.restype = ct.c_long
     theDLL.DTWAIN_RangeGetCount.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValue.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValueFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValueFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValueFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValueFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValueLong.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValue.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValueFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValueFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValueFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValueFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValueLong.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPos.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPosFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPosFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPosFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPosFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPosLong.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValue.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValueFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValueFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValueFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValueFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValueLong.restype = ct.c_long
     theDLL.DTWAIN_RangeIsValid.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAll.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAllFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAllFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAllFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAllFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAllLong.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValue.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValueFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValueFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValueFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValueFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValueLong.restype = ct.c_long
     theDLL.DTWAIN_RemovePDFTextElement.restype = ct.c_long
     theDLL.DTWAIN_ResetPDFTextElement.restype = ct.c_long
     theDLL.DTWAIN_RewindPage.restype = ct.c_long
     theDLL.DTWAIN_RotateImage.restype = ct.c_void_p
     theDLL.DTWAIN_RotateImageString.restype = ct.c_void_p
     theDLL.DTWAIN_RotateImageStringA.restype = ct.c_void_p
     theDLL.DTWAIN_RotateImageStringW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectDefaultOCREngine.restype = ct.c_void_p
     theDLL.DTWAIN_SelectDefaultSource.restype = ct.c_void_p
     theDLL.DTWAIN_SelectDefaultSourceWithOpen.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2A.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2Ex.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2ExA.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2ExW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2W.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngineByName.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngineByNameA.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngineByNameW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2A.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2Ex.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2ExA.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2ExW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2W.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByName.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByNameA.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByNameW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByNameWithOpen.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByNameWithOpenA.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByNameWithOpenW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceWithOpen.restype = ct.c_void_p
     theDLL.DTWAIN_SetAcquireArea.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireArea2.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireArea2String.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireArea2StringA.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireArea2StringW.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireImageNegative.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireImageScale.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireImageScaleString.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireImageScaleStringA.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireImageScaleStringW.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireStripBuffer.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireStripSize.restype = ct.c_long
     theDLL.DTWAIN_SetAlarmVolume.restype = ct.c_long
     theDLL.DTWAIN_SetAlarms.restype = ct.c_long
     theDLL.DTWAIN_SetAllCapsToDefault.restype = ct.c_long
     theDLL.DTWAIN_SetAppInfo.restype = ct.c_long
     theDLL.DTWAIN_SetAppInfoA.restype = ct.c_long
     theDLL.DTWAIN_SetAppInfoW.restype = ct.c_long
     theDLL.DTWAIN_SetAuthor.restype = ct.c_long
     theDLL.DTWAIN_SetAuthorA.restype = ct.c_long
     theDLL.DTWAIN_SetAuthorW.restype = ct.c_long
     theDLL.DTWAIN_SetAvailablePrinters.restype = ct.c_long
     theDLL.DTWAIN_SetAvailablePrintersArray.restype = ct.c_long
     theDLL.DTWAIN_SetBarcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_SetBarcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_SetBarcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_SetBarcodeSearchMode.restype = ct.c_long
     theDLL.DTWAIN_SetBarcodeTimeOut.restype = ct.c_long
     theDLL.DTWAIN_SetBitDepth.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetection.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionEx.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionExString.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionExStringA.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionExStringW.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionString.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionStringA.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionStringW.restype = ct.c_long
     theDLL.DTWAIN_SetBrightness.restype = ct.c_long
     theDLL.DTWAIN_SetBrightnessString.restype = ct.c_long
     theDLL.DTWAIN_SetBrightnessStringA.restype = ct.c_long
     theDLL.DTWAIN_SetBrightnessStringW.restype = ct.c_long
     theDLL.DTWAIN_SetBufferedTileMode.restype = ct.c_long
     theDLL.DTWAIN_SetCallback.restype = theDLL.SETCALLBACK_TYPE
     theDLL.DTWAIN_SetCallback64.restype = theDLL.SETCALLBACK64_TYPE
     theDLL.DTWAIN_SetCamera.restype = ct.c_long
     theDLL.DTWAIN_SetCameraA.restype = ct.c_long
     theDLL.DTWAIN_SetCameraW.restype = ct.c_long
     theDLL.DTWAIN_SetCapValues.restype = ct.c_long
     theDLL.DTWAIN_SetCapValuesEx.restype = ct.c_long
     theDLL.DTWAIN_SetCapValuesEx2.restype = ct.c_long
     theDLL.DTWAIN_SetCaption.restype = ct.c_long
     theDLL.DTWAIN_SetCaptionA.restype = ct.c_long
     theDLL.DTWAIN_SetCaptionW.restype = ct.c_long
     theDLL.DTWAIN_SetCompressionType.restype = ct.c_long
     theDLL.DTWAIN_SetContrast.restype = ct.c_long
     theDLL.DTWAIN_SetContrastString.restype = ct.c_long
     theDLL.DTWAIN_SetContrastStringA.restype = ct.c_long
     theDLL.DTWAIN_SetContrastStringW.restype = ct.c_long
     theDLL.DTWAIN_SetCountry.restype = ct.c_long
     theDLL.DTWAIN_SetCurrentRetryCount.restype = ct.c_long
     theDLL.DTWAIN_SetCustomDSData.restype = ct.c_long
     theDLL.DTWAIN_SetDSMSearchOrder.restype = ct.c_long
     theDLL.DTWAIN_SetDSMSearchOrderEx.restype = ct.c_long
     theDLL.DTWAIN_SetDSMSearchOrderExA.restype = ct.c_long
     theDLL.DTWAIN_SetDSMSearchOrderExW.restype = ct.c_long
     theDLL.DTWAIN_SetDefaultSource.restype = ct.c_long
     theDLL.DTWAIN_SetDeviceNotifications.restype = ct.c_long
     theDLL.DTWAIN_SetDeviceTimeDate.restype = ct.c_long
     theDLL.DTWAIN_SetDeviceTimeDateA.restype = ct.c_long
     theDLL.DTWAIN_SetDeviceTimeDateW.restype = ct.c_long
     theDLL.DTWAIN_SetDoubleFeedDetectLength.restype = ct.c_long
     theDLL.DTWAIN_SetDoubleFeedDetectLengthString.restype = ct.c_long
     theDLL.DTWAIN_SetDoubleFeedDetectLengthStringA.restype = ct.c_long
     theDLL.DTWAIN_SetDoubleFeedDetectLengthStringW.restype = ct.c_long
     theDLL.DTWAIN_SetDoubleFeedDetectValues.restype = ct.c_long
     theDLL.DTWAIN_SetDoublePageCountOnDuplex.restype = ct.c_long
     theDLL.DTWAIN_SetEOJDetectValue.restype = ct.c_long
     theDLL.DTWAIN_SetErrorBufferThreshold.restype = ct.c_long
     theDLL.DTWAIN_SetErrorCallback.restype = ct.c_long
     theDLL.DTWAIN_SetErrorCallback64.restype = ct.c_long
     theDLL.DTWAIN_SetFeederAlignment.restype = ct.c_long
     theDLL.DTWAIN_SetFeederOrder.restype = ct.c_long
     theDLL.DTWAIN_SetFeederWaitTime.restype = ct.c_long
     theDLL.DTWAIN_SetFileAutoIncrement.restype = ct.c_long
     theDLL.DTWAIN_SetFileCompressionType.restype = ct.c_long
     theDLL.DTWAIN_SetFileSavePos.restype = ct.c_long
     theDLL.DTWAIN_SetFileSavePosA.restype = ct.c_long
     theDLL.DTWAIN_SetFileSavePosW.restype = ct.c_long
     theDLL.DTWAIN_SetFileXferFormat.restype = ct.c_long
     theDLL.DTWAIN_SetHalftone.restype = ct.c_long
     theDLL.DTWAIN_SetHalftoneA.restype = ct.c_long
     theDLL.DTWAIN_SetHalftoneW.restype = ct.c_long
     theDLL.DTWAIN_SetHighlight.restype = ct.c_long
     theDLL.DTWAIN_SetHighlightString.restype = ct.c_long
     theDLL.DTWAIN_SetHighlightStringA.restype = ct.c_long
     theDLL.DTWAIN_SetHighlightStringW.restype = ct.c_long
     theDLL.DTWAIN_SetJobControl.restype = ct.c_long
     theDLL.DTWAIN_SetJpegValues.restype = ct.c_long
     theDLL.DTWAIN_SetJpegXRValues.restype = ct.c_long
     theDLL.DTWAIN_SetLanguage.restype = ct.c_long
     theDLL.DTWAIN_SetLastError.restype = ct.c_long
     theDLL.DTWAIN_SetLightPath.restype = ct.c_long
     theDLL.DTWAIN_SetLightPathEx.restype = ct.c_long
     theDLL.DTWAIN_SetLightSource.restype = ct.c_long
     theDLL.DTWAIN_SetLightSources.restype = ct.c_long
     theDLL.DTWAIN_SetLogSaveThreshold.restype = ct.c_long
     theDLL.DTWAIN_SetLoggerCallback.restype = ct.c_long
     theDLL.DTWAIN_SetLoggerCallbackA.restype = ct.c_long
     theDLL.DTWAIN_SetLoggerCallbackW.restype = ct.c_long
     theDLL.DTWAIN_SetManualDuplexMode.restype = ct.c_long
     theDLL.DTWAIN_SetMaxAcquisitions.restype = ct.c_long
     theDLL.DTWAIN_SetMaxBuffers.restype = ct.c_long
     theDLL.DTWAIN_SetMaxRetryAttempts.restype = ct.c_long
     theDLL.DTWAIN_SetMultipageScanMode.restype = ct.c_long
     theDLL.DTWAIN_SetNoiseFilter.restype = ct.c_long
     theDLL.DTWAIN_SetOCRCapValues.restype = ct.c_long
     theDLL.DTWAIN_SetOrientation.restype = ct.c_long
     theDLL.DTWAIN_SetOverscan.restype = ct.c_long
     theDLL.DTWAIN_SetPDFAESEncryption.restype = ct.c_long
     theDLL.DTWAIN_SetPDFASCIICompression.restype = ct.c_long
     theDLL.DTWAIN_SetPDFAuthor.restype = ct.c_long
     theDLL.DTWAIN_SetPDFAuthorA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFAuthorW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFCompression.restype = ct.c_long
     theDLL.DTWAIN_SetPDFCreator.restype = ct.c_long
     theDLL.DTWAIN_SetPDFCreatorA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFCreatorW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFEncryption.restype = ct.c_long
     theDLL.DTWAIN_SetPDFEncryptionA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFEncryptionW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFJpegQuality.restype = ct.c_long
     theDLL.DTWAIN_SetPDFKeywords.restype = ct.c_long
     theDLL.DTWAIN_SetPDFKeywordsA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFKeywordsW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFOCRConversion.restype = ct.c_long
     theDLL.DTWAIN_SetPDFOCRMode.restype = ct.c_long
     theDLL.DTWAIN_SetPDFOrientation.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageScale.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageScaleString.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageScaleStringA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageScaleStringW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageSize.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageSizeString.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageSizeStringA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageSizeStringW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPolarity.restype = ct.c_long
     theDLL.DTWAIN_SetPDFProducer.restype = ct.c_long
     theDLL.DTWAIN_SetPDFProducerA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFProducerW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFSubject.restype = ct.c_long
     theDLL.DTWAIN_SetPDFSubjectA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFSubjectW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementFloat.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementFloatString.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementLong.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementString.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementStringA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementStringW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTitle.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTitleA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTitleW.restype = ct.c_long
     theDLL.DTWAIN_SetPaperSize.restype = ct.c_long
     theDLL.DTWAIN_SetPatchcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_SetPatchcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_SetPatchcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_SetPatchcodeSearchMode.restype = ct.c_long
     theDLL.DTWAIN_SetPatchcodeTimeOut.restype = ct.c_long
     theDLL.DTWAIN_SetPixelFlavor.restype = ct.c_long
     theDLL.DTWAIN_SetPixelType.restype = ct.c_long
     theDLL.DTWAIN_SetPostScriptTitle.restype = ct.c_long
     theDLL.DTWAIN_SetPostScriptTitleA.restype = ct.c_long
     theDLL.DTWAIN_SetPostScriptTitleW.restype = ct.c_long
     theDLL.DTWAIN_SetPostScriptType.restype = ct.c_long
     theDLL.DTWAIN_SetPrinter.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterEx.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterStartNumber.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterStringMode.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterStrings.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterSuffixString.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterSuffixStringA.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterSuffixStringW.restype = ct.c_long
     theDLL.DTWAIN_SetQueryCapSupport.restype = ct.c_long
     theDLL.DTWAIN_SetResolution.restype = ct.c_long
     theDLL.DTWAIN_SetResolutionString.restype = ct.c_long
     theDLL.DTWAIN_SetResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_SetResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_SetResourcePath.restype = ct.c_long
     theDLL.DTWAIN_SetResourcePathA.restype = ct.c_long
     theDLL.DTWAIN_SetResourcePathW.restype = ct.c_long
     theDLL.DTWAIN_SetRotation.restype = ct.c_long
     theDLL.DTWAIN_SetRotationString.restype = ct.c_long
     theDLL.DTWAIN_SetRotationStringA.restype = ct.c_long
     theDLL.DTWAIN_SetRotationStringW.restype = ct.c_long
     theDLL.DTWAIN_SetSaveFileName.restype = ct.c_long
     theDLL.DTWAIN_SetSaveFileNameA.restype = ct.c_long
     theDLL.DTWAIN_SetSaveFileNameW.restype = ct.c_long
     theDLL.DTWAIN_SetShadow.restype = ct.c_long
     theDLL.DTWAIN_SetShadowString.restype = ct.c_long
     theDLL.DTWAIN_SetShadowStringA.restype = ct.c_long
     theDLL.DTWAIN_SetShadowStringW.restype = ct.c_long
     theDLL.DTWAIN_SetSourceUnit.restype = ct.c_long
     theDLL.DTWAIN_SetTIFFCompressType.restype = ct.c_long
     theDLL.DTWAIN_SetTIFFInvert.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectory.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectoryA.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectoryEx.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectoryExA.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectoryExW.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectoryW.restype = ct.c_long
     theDLL.DTWAIN_SetThreshold.restype = ct.c_long
     theDLL.DTWAIN_SetThresholdString.restype = ct.c_long
     theDLL.DTWAIN_SetThresholdStringA.restype = ct.c_long
     theDLL.DTWAIN_SetThresholdStringW.restype = ct.c_long
     theDLL.DTWAIN_SetTwainDSM.restype = ct.c_long
     theDLL.DTWAIN_SetTwainLog.restype = ct.c_long
     theDLL.DTWAIN_SetTwainLogA.restype = ct.c_long
     theDLL.DTWAIN_SetTwainLogW.restype = ct.c_long
     theDLL.DTWAIN_SetTwainMode.restype = ct.c_long
     theDLL.DTWAIN_SetTwainTimeout.restype = ct.c_long
     theDLL.DTWAIN_SetUpdateDibProc.restype = theDLL.DIBUPDATEPROC_TYPE
     theDLL.DTWAIN_SetXResolution.restype = ct.c_long
     theDLL.DTWAIN_SetXResolutionString.restype = ct.c_long
     theDLL.DTWAIN_SetXResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_SetXResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_SetYResolution.restype = ct.c_long
     theDLL.DTWAIN_SetYResolutionString.restype = ct.c_long
     theDLL.DTWAIN_SetYResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_SetYResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_ShowUIOnly.restype = ct.c_long
     theDLL.DTWAIN_ShutdownOCREngine.restype = ct.c_long
     theDLL.DTWAIN_SkipImageInfoError.restype = ct.c_long
     theDLL.DTWAIN_StartThread.restype = ct.c_long
     theDLL.DTWAIN_StartTwainSession.restype = ct.c_long
     theDLL.DTWAIN_StartTwainSessionA.restype = ct.c_long
     theDLL.DTWAIN_StartTwainSessionW.restype = ct.c_long
     theDLL.DTWAIN_SysDestroy.restype = ct.c_long
     theDLL.DTWAIN_SysInitialize.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeEx.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeEx2.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeEx2A.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeEx2W.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeExA.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeExW.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLib.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibEx.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibEx2.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibEx2A.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibEx2W.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibExA.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibExW.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeNoBlocking.restype = ct.c_void_p
     theDLL.DTWAIN_TestGetCap.restype = ct.c_void_p
     theDLL.DTWAIN_UnlockMemory.restype = ct.c_long
     theDLL.DTWAIN_UnlockMemoryEx.restype = ct.c_long
     theDLL.DTWAIN_UpdateCurrentAcquiredImage.restype = ct.c_long
     theDLL.DTWAIN_UseMultipleThreads.restype = ct.c_long

     #set up the argument types
     theDLL.DTWAIN_AcquireAudioFile.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireAudioFileA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireAudioFileW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireAudioNative.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireAudioNativeEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireBuffered.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireBufferedEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireFile.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireFileA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireFileEx.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireFileW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireNative.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireNativeEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireToClipboard.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AddExtImageInfoQuery.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_AddPDFText.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_ulong]
     theDLL.DTWAIN_AddPDFTextA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_ulong]
     theDLL.DTWAIN_AddPDFTextElement.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_AddPDFTextEx.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_long]
     theDLL.DTWAIN_AddPDFTextExA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_long]
     theDLL.DTWAIN_AddPDFTextExW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_long]
     theDLL.DTWAIN_AddPDFTextString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_ulong]
     theDLL.DTWAIN_AddPDFTextStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_ulong]
     theDLL.DTWAIN_AddPDFTextStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_ulong]
     theDLL.DTWAIN_AddPDFTextW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_ulong]
     theDLL.DTWAIN_AllocateMemory.argtypes = [ct.c_ulong]
     theDLL.DTWAIN_AllocateMemory64.argtypes = [ct.c_uint64]
     theDLL.DTWAIN_AllocateMemoryEx.argtypes = [ct.c_ulong]
     theDLL.DTWAIN_AppHandlesExceptions.argtypes = [ct.c_long]
     theDLL.DTWAIN_ArrayANSIStringToFloat.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayAdd.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ArrayAddANSIString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayAddANSIStringN.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddFloat.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_ArrayAddFloatN.argtypes = [ct.c_void_p, ct.c_double, ct.c_long]
     theDLL.DTWAIN_ArrayAddFloatString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayAddFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayAddFloatStringN.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddFloatStringNA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddFloatStringNW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayAddFrame.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ArrayAddFrameN.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddLong.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddLong64.argtypes = [ct.c_void_p, ct.c_int64]
     theDLL.DTWAIN_ArrayAddLong64N.argtypes = [ct.c_void_p, ct.c_int64, ct.c_long]
     theDLL.DTWAIN_ArrayAddLongN.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayAddN.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayAddStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayAddStringN.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddStringNA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddStringNW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayAddWideString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayAddWideStringN.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayConvertFix32ToFloat.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayConvertFloatToFix32.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayCopy.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ArrayCreate.argtypes = [ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayCreateCopy.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayCreateFromCap.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayCreateFromLong64s.argtypes = [ct.POINTER(ct.c_int64), ct.c_long]
     theDLL.DTWAIN_ArrayCreateFromLongs.argtypes = [ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_ArrayCreateFromReals.argtypes = [ct.POINTER(ct.c_double), ct.c_long]
     theDLL.DTWAIN_ArrayDestroy.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayDestroyFrames.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayDumpToLog.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayFind.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ArrayFindANSIString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayFindFloat.argtypes = [ct.c_void_p, ct.c_double, ct.c_double]
     theDLL.DTWAIN_ArrayFindFloatString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayFindFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayFindFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayFindLong.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayFindLong64.argtypes = [ct.c_void_p, ct.c_int64]
     theDLL.DTWAIN_ArrayFindString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayFindStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayFindStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayFindWideString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayFix32GetAt.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_ArrayFix32SetAt.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayFloatToANSIString.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayFloatToString.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayFloatToWideString.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayGetAt.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArrayGetAtANSIString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtANSIStringPtr.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtFloat.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_ArrayGetAtFloatEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtFrame.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_ArrayGetAtFrameEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArrayGetAtFrameString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtFrameStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtFrameStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtLong.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_ArrayGetAtLong64.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_int64)]
     theDLL.DTWAIN_ArrayGetAtLong64Ex.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtLongEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtSource.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_ArrayGetAtSourceEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtStringPtr.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtWideString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtWideStringPtr.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetBuffer.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetCapValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayGetCapValuesEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayGetCapValuesEx2.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayGetCount.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayGetMaxStringLength.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayGetSourceAt.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_ArrayGetStringLength.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetType.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayInsertAt.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArrayInsertAtANSIString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayInsertAtANSIStringN.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtFloat.argtypes = [ct.c_void_p, ct.c_long, ct.c_double]
     theDLL.DTWAIN_ArrayInsertAtFloatN.argtypes = [ct.c_void_p, ct.c_long, ct.c_double, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayInsertAtFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayInsertAtFloatStringN.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtFloatStringNA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtFloatStringNW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayInsertAtFrame.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArrayInsertAtFrameN.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtLong64.argtypes = [ct.c_void_p, ct.c_long, ct.c_int64]
     theDLL.DTWAIN_ArrayInsertAtLong64N.argtypes = [ct.c_void_p, ct.c_long, ct.c_int64, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtLongN.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtN.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayInsertAtStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayInsertAtStringN.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtStringNA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtStringNW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayInsertAtWideString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayInsertAtWideStringN.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayRemoveAll.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayRemoveAt.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayRemoveAtN.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayResize.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArraySetAt.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArraySetAtANSIString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtFloat.argtypes = [ct.c_void_p, ct.c_long, ct.c_double]
     theDLL.DTWAIN_ArraySetAtFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArraySetAtFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArraySetAtFrame.argtypes = [ct.c_void_p, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double]
     theDLL.DTWAIN_ArraySetAtFrameEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArraySetAtFrameString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArraySetAtFrameStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtFrameStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArraySetAtLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArraySetAtLong64.argtypes = [ct.c_void_p, ct.c_long, ct.c_int64]
     theDLL.DTWAIN_ArraySetAtString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArraySetAtStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArraySetAtWideString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayStringToFloat.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayWideStringToFloat.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_CallCallback.argtypes = [ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_CallCallback64.argtypes = [ct.c_long, ct.c_long, ct.c_int64]
     theDLL.DTWAIN_CallDSMProc.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_CheckHandles.argtypes = [ct.c_long]
     theDLL.DTWAIN_ClearBuffers.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ClearPDFTextElements.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ClearPage.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_CloseSource.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_CloseSourceUI.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ConvertDIBToBitmap.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ConvertDIBToFullBitmap.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ConvertToAPIString.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_ConvertToAPIStringA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_ConvertToAPIStringEx.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ConvertToAPIStringExA.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ConvertToAPIStringExW.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ConvertToAPIStringW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_CreatePDFTextElementCopy.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_DeleteDIB.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_DestroyAcquisitionArray.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_DestroyPDFTextElement.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_DisableAppWindow.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoBorderDetect.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoBright.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoDeskew.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoFeed.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoRotate.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoScan.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutomaticSenseMedium.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableBarcodeDetection.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableDuplex.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableFeeder.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableGetMessageLoop.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableGetMessageLoopDetection.argtypes = [ct.c_long]
     theDLL.DTWAIN_EnableIndicator.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableJobFileHandling.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableLamp.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableMsgNotify.argtypes = [ct.c_long]
     theDLL.DTWAIN_EnablePatchcodeDetection.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnablePeekMessageLoop.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnablePrinter.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableThumbnail.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableTripletsNotify.argtypes = [ct.c_long]
     theDLL.DTWAIN_EndThread.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumAlarmVolumes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumAlarmVolumesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumAlarms.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumAlarmsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumAudioXferMechs.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumAudioXferMechsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumAutoFeedValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumAutoFeedValuesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumAutomaticCaptures.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumAutomaticCapturesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumAutomaticSenseMedium.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumAutomaticSenseMediumEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodeCodes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodeCodesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodeMaxPriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodeMaxPrioritiesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodeMaxRetries.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodeMaxRetriesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodePriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodePrioritiesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodeSearchModes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodeSearchModesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodeTimeOutValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodeTimeOutValuesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBitDepths.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBitDepthsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBitDepthsEx2.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumBottomCameras.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBottomCamerasEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBrightnessValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumBrightnessValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumCameras.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumCamerasEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumCamerasEx2.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumCapLabels.argtypes = [ct.c_long]
     theDLL.DTWAIN_EnumCompressionTypes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumCompressionTypesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumCompressionTypesEx2.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_EnumContrastValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumContrastValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumCustomCaps.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumCustomCapsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumDoubleFeedDetectLengths.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumDoubleFeedDetectLengthsEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumDoubleFeedDetectValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumDoubleFeedDetectValuesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumExtImageInfoTypes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumExtImageInfoTypesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumExtendedCaps.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumExtendedCapsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumExtendedCapsEx2.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumFileTypeBitsPerPixel.argtypes = [ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumFileXferFormats.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumFileXferFormatsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumHalftones.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumHalftonesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumHighlightValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumHighlightValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumJobControls.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumJobControlsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumLightPaths.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumLightPathsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumLightSources.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumLightSourcesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumMaxBuffers.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumMaxBuffersEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumNoiseFilters.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumNoiseFiltersEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumOCRInterfaces.argtypes = [ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumOCRSupportedCaps.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumOrientations.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumOrientationsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumOverscanValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumOverscanValuesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPaperSizes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPaperSizesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodeCodes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodeCodesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodeMaxPriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodeMaxPrioritiesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodeMaxRetries.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodeMaxRetriesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodePriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodePrioritiesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodeSearchModes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodeSearchModesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodeTimeOutValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodeTimeOutValuesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPixelTypes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPixelTypesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPrinterStringModes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPrinterStringModesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumResolutionValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumResolutionValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumShadowValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumShadowValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumSourceUnits.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumSourceUnitsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumSourceValues.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumSourceValuesA.argtypes = [ct.c_void_p, ct.c_char_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumSourceValuesW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumSources.argtypes = [ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumSupportedCaps.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumSupportedCapsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumSupportedCapsEx2.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumSupportedExtImageInfo.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumSupportedExtImageInfoEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumThresholdValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumThresholdValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumTopCameras.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumTopCamerasEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumTwainPrinters.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumTwainPrintersEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumXResolutionValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumXResolutionValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumYResolutionValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumYResolutionValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ExecuteOCR.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ExecuteOCRA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ExecuteOCRW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_FeedPage.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FlipBitmap.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FlushAcquiredPages.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FrameCreate.argtypes = [ct.c_double, ct.c_double, ct.c_double, ct.c_double]
     theDLL.DTWAIN_FrameCreateString.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_FrameCreateStringA.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_FrameCreateStringW.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_FrameDestroy.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FrameGetAll.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_FrameGetAllString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_FrameGetAllStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_FrameGetAllStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_FrameGetValue.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_FrameGetValueString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_FrameGetValueStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_FrameGetValueStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_FrameIsValid.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FrameSetAll.argtypes = [ct.c_void_p, ct.c_double, ct.c_double, ct.c_double, ct.c_double]
     theDLL.DTWAIN_FrameSetAllString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_FrameSetAllStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_FrameSetAllStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_FrameSetValue.argtypes = [ct.c_void_p, ct.c_long, ct.c_double]
     theDLL.DTWAIN_FrameSetValueString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_FrameSetValueStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_FrameSetValueStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_FreeExtImageInfo.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FreeMemory.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FreeMemoryEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetAPIHandleStatus.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetAcquireArea.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetAcquireArea2.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAcquireArea2String.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAcquireArea2StringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAcquireArea2StringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAcquireAreaEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetAcquireMetrics.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAcquireStripBuffer.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetAcquireStripData.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong)]
     theDLL.DTWAIN_GetAcquireStripSizes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong)]
     theDLL.DTWAIN_GetAcquiredImage.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetAcquiredImageArray.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetAcquisitionArray.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetActiveDSMPath.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetActiveDSMPathA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetActiveDSMPathW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetActiveDSMVersionInfo.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetActiveDSMVersionInfoA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetActiveDSMVersionInfoW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetAlarmVolume.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAllSourceDibs.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetAppInfo.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetAppInfoA.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_GetAppInfoW.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetAuthor.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetAuthorA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetAuthorW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetBarcodeMaxPriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetBarcodeMaxRetries.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetBarcodePriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetBarcodeSearchMode.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetBarcodeTimeOut.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetBatteryMinutes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetBatteryPercent.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetBitDepth.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetBitDepthEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetBlankPageAutoDetection.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetBrightness.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetBrightnessEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetBrightnessString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetBrightnessStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetBrightnessStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetBufferedTransferInfo.argtypes = [ct.c_void_p, ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong)]
     theDLL.DTWAIN_GetCapArrayType.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetCapContainer.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetCapContainerEx.argtypes = [ct.c_long, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetCapContainerEx2.argtypes = [ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetCapDataType.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetCapFromName.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_GetCapFromNameA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_GetCapFromNameW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_GetCapHelp.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetCapHelpA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetCapHelpW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetCapLabel.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetCapLabelA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetCapLabelW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetCapOperations.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetCapOperationsEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetCapValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetCapValuesEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetCapValuesEx2.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetCaption.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetCaptionA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetCaptionW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetCompressionSize.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetCompressionType.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetCompressionTypeEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetConditionCodeString.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetConditionCodeStringA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetConditionCodeStringW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetConstantFromTwainName.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_GetConstantFromTwainNameA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_GetConstantFromTwainNameW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_GetContrast.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetContrastEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetContrastString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetContrastStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetContrastStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetCurrentAcquiredImage.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetCurrentFileName.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetCurrentFileNameA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetCurrentFileNameW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetCurrentPageNum.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetCurrentRetryCount.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetCurrentTwainTriplet.argtypes = [ct.POINTER(TW_IDENTITY), ct.POINTER(TW_IDENTITY), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_int64)]
     theDLL.DTWAIN_GetCustomDSData.argtypes = [ct.c_void_p, ct.POINTER(ct.c_ubyte), ct.c_ulong, ct.POINTER(ct.c_ulong), ct.c_long]
     theDLL.DTWAIN_GetDSMFullName.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDSMFullNameA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDSMFullNameW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDSMSearchOrderEx.argtypes = [ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetDSMSearchOrderExA.argtypes = [ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_GetDSMSearchOrderExW.argtypes = [ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetDeviceEvent.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDeviceEventEx.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetDeviceEventInfo.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_GetDeviceNotifications.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDeviceTimeDate.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetDeviceTimeDateA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetDeviceTimeDateW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetDoubleFeedDetectLength.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.c_long]
     theDLL.DTWAIN_GetDoubleFeedDetectValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetDuplexType.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDuplexTypeEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetErrorBuffer.argtypes = [ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetErrorString.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetErrorStringA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetErrorStringW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetExtCapFromName.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_GetExtCapFromNameA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_GetExtCapFromNameW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_GetExtImageInfo.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetExtImageInfoData.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetExtImageInfoDataEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetExtImageInfoItem.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetExtImageInfoItemEx.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetExtNameFromCap.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetExtNameFromCapA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetExtNameFromCapW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetFeederAlignment.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetFeederFuncs.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetFeederOrder.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetFeederWaitTime.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetFileCompressionType.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetFileSavePageCount.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetFileTypeExtensions.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetFileTypeExtensionsA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetFileTypeExtensionsW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetFileTypeName.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetFileTypeNameA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetFileTypeNameW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetHalftone.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetHalftoneA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetHalftoneW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetHighlight.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetHighlightString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetHighlightStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetHighlightStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetImageInfo.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_void_p), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetImageInfoString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_void_p), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetImageInfoStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_void_p), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetImageInfoStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_void_p), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetJobControl.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetJobControlEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetJpegValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetJpegXRValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetLibraryPath.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetLibraryPathA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetLibraryPathW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetLightPath.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetLightPathEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetLightSource.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetLightSources.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetLightSourcesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetManualDuplexCount.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetMaxAcquisitions.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetMaxBuffers.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetMaxPagesToAcquire.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetMaxRetryAttempts.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetNameFromCap.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetNameFromCapA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetNameFromCapW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetNoiseFilter.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetNumAcquiredImages.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetNumAcquisitions.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetOCRCapValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetOCRErrorString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRErrorStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRErrorStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRLastError.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetOCRMajorMinorVersion.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetOCRManufacturer.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRManufacturerA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRManufacturerW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductFamily.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductFamilyA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductFamilyW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductName.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductNameA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductNameW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRText.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetOCRTextA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetOCRTextInfoFloat.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetOCRTextInfoFloatEx.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double), ct.c_long]
     theDLL.DTWAIN_GetOCRTextInfoHandle.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetOCRTextInfoLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetOCRTextInfoLongEx.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetOCRTextW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetOCRVersionInfo.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRVersionInfoA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRVersionInfoW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOrientation.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetOrientationEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetOverscan.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPDFTextElementFloat.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.c_long]
     theDLL.DTWAIN_GetPDFTextElementLong.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPDFTextElementString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetPDFTextElementStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetPDFTextElementStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetPDFType1FontName.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetPDFType1FontNameA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetPDFType1FontNameW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetPaperSize.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPaperSizeName.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetPaperSizeNameA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetPaperSizeNameW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetPatchcodeMaxPriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPatchcodeMaxRetries.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPatchcodePriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetPatchcodeSearchMode.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPatchcodeTimeOut.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPixelFlavor.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetPixelType.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPrinter.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPrinterEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetPrinterStartNumber.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetPrinterStartNumberEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetPrinterStringMode.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPrinterStringModeEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetPrinterStrings.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetPrinterStringsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetPrinterSuffixString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetPrinterSuffixStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetPrinterSuffixStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetResolution.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetResolutionEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetResolutionString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetResourceString.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetResourceStringA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetResourceStringW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetRotation.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetRotationEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetRotationString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetRotationStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetRotationStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetSaveFileName.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSaveFileNameA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSaveFileNameW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSessionDetails.argtypes = [ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetSessionDetailsA.argtypes = [ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetSessionDetailsW.argtypes = [ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetShadow.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetShadowString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetShadowStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetShadowStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetShortVersionString.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetShortVersionStringA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetShortVersionStringW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceAcquisitions.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetSourceDetails.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetSourceDetailsA.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetSourceDetailsW.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetSourceID.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetSourceIDEx.argtypes = [ct.c_void_p, ct.POINTER(TW_IDENTITY)]
     theDLL.DTWAIN_GetSourceManufacturer.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceManufacturerA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceManufacturerW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductFamily.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductFamilyA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductFamilyW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductName.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductNameA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductNameW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceUnit.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetSourceUnitEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetSourceVersionInfo.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceVersionInfoA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceVersionInfoW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceVersionNumber.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetTempFileDirectory.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetTempFileDirectoryA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTempFileDirectoryW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetThreshold.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetThresholdString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetThresholdStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetThresholdStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetTimeDate.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetTimeDateA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetTimeDateW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetTwainAppIDEx.argtypes = [ct.POINTER(TW_IDENTITY)]
     theDLL.DTWAIN_GetTwainAvailabilityEx.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetTwainAvailabilityExA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTwainAvailabilityExW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstant.argtypes = [ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstantA.argtypes = [ct.c_long, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstantEx.argtypes = [ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstantExA.argtypes = [ct.c_long, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstantExW.argtypes = [ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstantW.argtypes = [ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetVersion.argtypes = [ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetVersionCopyright.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetVersionCopyrightA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetVersionCopyrightW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetVersionEx.argtypes = [ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetVersionInfo.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetVersionInfoA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetVersionInfoW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetVersionString.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetVersionStringA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetVersionStringW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetWindowsVersionInfo.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetWindowsVersionInfoA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetWindowsVersionInfoW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetXResolution.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetXResolutionString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetXResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetXResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetYResolution.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetYResolutionString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetYResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetYResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_InitExtImageInfo.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_InitImageFileAppend.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_InitImageFileAppendA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_InitImageFileAppendW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_IsAudioXferSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsAutoBorderDetectEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoBorderDetectSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoBrightEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoBrightSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoDeskewEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoDeskewSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoFeedEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoFeedSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoRotateEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoRotateSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoScanEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutomaticSenseMediumEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutomaticSenseMediumSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsBarcodeCapsSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsBarcodeDetectionEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsBarcodeSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsBlankPageDetectionOn.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsBufferedTileModeOn.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsBufferedTileModeSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsCapSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsCompressionSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsCustomDSDataSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsDIBBlank.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_IsDIBBlankString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_IsDIBBlankStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_IsDIBBlankStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_IsDeviceEventSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsDeviceOnLine.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsDoubleFeedDetectLengthSupported.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_IsDoubleFeedDetectSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsDuplexEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsDuplexSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsExtImageInfoSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFeederEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFeederLoaded.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFeederSensitive.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFeederSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFileSystemSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFileXferSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsGetMessageLoopEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldALastPageSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldALevelSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldAPrintFormatSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldAValueSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldBLastPageSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldBLevelSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldBPrintFormatSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldBValueSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldCLastPageSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldCLevelSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldCPrintFormatSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldCValueSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldDLastPageSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldDLevelSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldDPrintFormatSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldDValueSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldELastPageSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldELevelSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldEPrintFormatSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldEValueSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsImageAddressingSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIndicatorEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIndicatorSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsJobControlSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsLampEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsLampSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsLightPathSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsLightSourceSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsMaxBuffersSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsMemFileXferSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsOCREngineActivated.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsOrientationSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsOverscanSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsPaperDetectable.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsPaperSizeSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsPatchcodeCapsSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsPatchcodeDetectionEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsPatchcodeSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsPeekMessageLoopEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsPixelTypeSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsPrinterEnabled.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsPrinterSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsRotationSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSkipImageInfoError.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSourceAcquiring.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSourceAcquiringEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsSourceInUIOnlyMode.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSourceOpen.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSourceSelected.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSourceValid.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsThumbnailEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsThumbnailSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsTwainAvailableEx.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_IsTwainAvailableExA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_IsTwainAvailableExW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_IsUIControllable.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsUIEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsUIOnlySupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_LoadCustomStringResources.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_LoadCustomStringResourcesA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_LoadCustomStringResourcesEx.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_LoadCustomStringResourcesExA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_LoadCustomStringResourcesExW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_LoadCustomStringResourcesW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_LoadLanguageResource.argtypes = [ct.c_long]
     theDLL.DTWAIN_LockMemory.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_LockMemoryEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_LogMessage.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_LogMessageA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_LogMessageW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_MakeRGB.argtypes = [ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_OpenSource.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_OpenSourcesOnSelect.argtypes = [ct.c_long]
     theDLL.DTWAIN_RangeCreate.argtypes = [ct.c_long]
     theDLL.DTWAIN_RangeCreateFromCap.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_RangeDestroy.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_RangeExpand.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_RangeExpandEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_RangeGetAll.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_RangeGetAllFloat.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_RangeGetAllFloatString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_RangeGetAllFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_RangeGetAllFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_RangeGetAllLong.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetCount.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_RangeGetExpValue.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_RangeGetExpValueFloat.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_RangeGetExpValueFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_RangeGetExpValueFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_RangeGetExpValueFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_RangeGetExpValueLong.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetNearestValue.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_RangeGetNearestValueFloat.argtypes = [ct.c_void_p, ct.c_double, ct.POINTER(ct.c_double), ct.c_long]
     theDLL.DTWAIN_RangeGetNearestValueFloatString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_RangeGetNearestValueFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_RangeGetNearestValueFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_RangeGetNearestValueLong.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_RangeGetPos.argtypes = [ct.c_void_p, ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetPosFloat.argtypes = [ct.c_void_p, ct.c_double, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetPosFloatString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetPosFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetPosFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetPosLong.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetValue.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_RangeGetValueFloat.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_RangeGetValueFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_RangeGetValueFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_RangeGetValueFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_RangeGetValueLong.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeIsValid.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeSetAll.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_RangeSetAllFloat.argtypes = [ct.c_void_p, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double]
     theDLL.DTWAIN_RangeSetAllFloatString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_RangeSetAllFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_RangeSetAllFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_RangeSetAllLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_RangeSetValue.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_RangeSetValueFloat.argtypes = [ct.c_void_p, ct.c_long, ct.c_double]
     theDLL.DTWAIN_RangeSetValueFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_RangeSetValueFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_RangeSetValueFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_RangeSetValueLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_RemovePDFTextElement.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ResetPDFTextElement.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_RewindPage.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_RotateImage.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_RotateImageString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_RotateImageStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_RotateImageStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SelectDefaultSourceWithOpen.argtypes = [ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2A.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2Ex.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2ExA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2ExW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2W.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectOCREngineByName.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SelectOCREngineByNameA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SelectOCREngineByNameW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SelectSource2.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectSource2A.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectSource2Ex.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SelectSource2ExA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SelectSource2ExW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SelectSource2W.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectSourceByName.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SelectSourceByNameA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SelectSourceByNameW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SelectSourceByNameWithOpen.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SelectSourceByNameWithOpenA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SelectSourceByNameWithOpenW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SelectSourceWithOpen.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetAcquireArea.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetAcquireArea2.argtypes = [ct.c_void_p, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetAcquireArea2String.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetAcquireArea2StringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetAcquireArea2StringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetAcquireImageNegative.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetAcquireImageScale.argtypes = [ct.c_void_p, ct.c_double, ct.c_double]
     theDLL.DTWAIN_SetAcquireImageScaleString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetAcquireImageScaleStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetAcquireImageScaleStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetAcquireStripBuffer.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetAcquireStripSize.argtypes = [ct.c_void_p, ct.c_ulong]
     theDLL.DTWAIN_SetAlarmVolume.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetAlarms.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetAllCapsToDefault.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_SetAppInfo.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetAppInfoA.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetAppInfoW.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetAuthor.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetAuthorA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetAuthorW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetAvailablePrinters.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetAvailablePrintersArray.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetBarcodeMaxPriorities.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetBarcodeMaxRetries.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetBarcodePriorities.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetBarcodeSearchMode.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetBarcodeTimeOut.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetBitDepth.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetection.argtypes = [ct.c_void_p, ct.c_double, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionEx.argtypes = [ct.c_void_p, ct.c_double, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionExString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionExStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionExStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBrightness.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetBrightnessString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetBrightnessStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetBrightnessStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetBufferedTileMode.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetCallback.argtypes = [theDLL.SETCALLBACK_TYPE, ct.c_long]
     theDLL.DTWAIN_SetCallback64.argtypes = [theDLL.SETCALLBACK64_TYPE, ct.c_int64]
     theDLL.DTWAIN_SetCamera.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetCameraA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetCameraW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetCapValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_SetCapValuesEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_SetCapValuesEx2.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_SetCaption.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetCaptionA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetCaptionW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetCompressionType.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetContrast.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetContrastString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetContrastStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetContrastStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetCountry.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetCurrentRetryCount.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetCustomDSData.argtypes = [ct.c_void_p, ct.c_void_p, ct.POINTER(ct.c_ubyte), ct.c_ulong, ct.c_long]
     theDLL.DTWAIN_SetDSMSearchOrder.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetDSMSearchOrderEx.argtypes = [ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetDSMSearchOrderExA.argtypes = [ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetDSMSearchOrderExW.argtypes = [ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetDefaultSource.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_SetDeviceNotifications.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetDeviceTimeDate.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetDeviceTimeDateA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetDeviceTimeDateW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetDoubleFeedDetectLength.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetDoubleFeedDetectLengthString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetDoubleFeedDetectLengthStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetDoubleFeedDetectLengthStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetDoubleFeedDetectValues.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetDoublePageCountOnDuplex.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetEOJDetectValue.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetErrorBufferThreshold.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetErrorCallback.argtypes = [theDLL.SETERRORPROC_TYPE, ct.c_long]
     theDLL.DTWAIN_SetErrorCallback64.argtypes = [theDLL.SETERRORPROC64_TYPE, ct.c_int64]
     theDLL.DTWAIN_SetFeederAlignment.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetFeederOrder.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetFeederWaitTime.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileAutoIncrement.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileCompressionType.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileSavePos.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileSavePosA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileSavePosW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileXferFormat.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetHalftone.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetHalftoneA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetHalftoneW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetHighlight.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetHighlightString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetHighlightStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetHighlightStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetJobControl.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetJpegValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetJpegXRValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetLanguage.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetLastError.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetLightPath.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetLightPathEx.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetLightSource.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetLightSources.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetLogSaveThreshold.argtypes = [ct.c_int64]
     theDLL.DTWAIN_SetLoggerCallback.argtypes = [theDLL.SETLOGGERPROC_TYPE, ct.c_int64]
     theDLL.DTWAIN_SetLoggerCallbackA.argtypes = [theDLL.SETLOGGERPROCA_TYPE, ct.c_int64]
     theDLL.DTWAIN_SetLoggerCallbackW.argtypes = [theDLL.SETLOGGERPROCW_TYPE, ct.c_int64]
     theDLL.DTWAIN_SetManualDuplexMode.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetMaxAcquisitions.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetMaxBuffers.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetMaxRetryAttempts.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetMultipageScanMode.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetNoiseFilter.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetOCRCapValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_SetOrientation.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetOverscan.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPDFAESEncryption.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPDFASCIICompression.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFAuthor.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFAuthorA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFAuthorW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFCompression.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFCreator.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFCreatorA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFCreatorW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFEncryption.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_ulong, ct.c_long]
     theDLL.DTWAIN_SetPDFEncryptionA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_ulong, ct.c_long]
     theDLL.DTWAIN_SetPDFEncryptionW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_ulong, ct.c_long]
     theDLL.DTWAIN_SetPDFJpegQuality.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFKeywords.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFKeywordsA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFKeywordsW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFOCRConversion.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPDFOCRMode.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFOrientation.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFPageScale.argtypes = [ct.c_void_p, ct.c_long, ct.c_double, ct.c_double]
     theDLL.DTWAIN_SetPDFPageScaleString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFPageScaleStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFPageScaleStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFPageSize.argtypes = [ct.c_void_p, ct.c_long, ct.c_double, ct.c_double]
     theDLL.DTWAIN_SetPDFPageSizeString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFPageSizeStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFPageSizeStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFPolarity.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFProducer.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFProducerA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFProducerW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFSubject.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFSubjectA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFSubjectW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFTextElementFloat.argtypes = [ct.c_void_p, ct.c_double, ct.c_double, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementFloatString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTitle.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFTitleA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFTitleW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPaperSize.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPatchcodeMaxPriorities.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPatchcodeMaxRetries.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPatchcodePriorities.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetPatchcodeSearchMode.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPatchcodeTimeOut.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPixelFlavor.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPixelType.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPostScriptTitle.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPostScriptTitleA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPostScriptTitleW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPostScriptType.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPrinter.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPrinterEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPrinterStartNumber.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPrinterStringMode.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPrinterStrings.argtypes = [ct.c_void_p, ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_SetPrinterSuffixString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPrinterSuffixStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPrinterSuffixStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetQueryCapSupport.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetResolution.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetResolutionString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetResourcePath.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SetResourcePathA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SetResourcePathW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SetRotation.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetRotationString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetRotationStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetRotationStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetSaveFileName.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetSaveFileNameA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetSaveFileNameW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetShadow.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetShadowString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetShadowStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetShadowStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetSourceUnit.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetTIFFCompressType.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetTIFFInvert.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetTempFileDirectory.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SetTempFileDirectoryA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SetTempFileDirectoryEx.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetTempFileDirectoryExA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetTempFileDirectoryExW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetTempFileDirectoryW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SetThreshold.argtypes = [ct.c_void_p, ct.c_double, ct.c_long]
     theDLL.DTWAIN_SetThresholdString.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetThresholdStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetThresholdStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetTwainDSM.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetTwainLog.argtypes = [ct.c_ulong, ct.c_wchar_p]
     theDLL.DTWAIN_SetTwainLogA.argtypes = [ct.c_ulong, ct.c_char_p]
     theDLL.DTWAIN_SetTwainLogW.argtypes = [ct.c_ulong, ct.c_wchar_p]
     theDLL.DTWAIN_SetTwainMode.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetTwainTimeout.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetUpdateDibProc.argtypes = [theDLL.DIBUPDATEPROC_TYPE]
     theDLL.DTWAIN_SetXResolution.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetXResolutionString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetXResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetXResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetYResolution.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetYResolutionString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetYResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetYResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ShowUIOnly.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ShutdownOCREngine.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_SkipImageInfoError.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_StartThread.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_StartTwainSession.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_StartTwainSessionA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_StartTwainSessionW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeEx.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeEx2.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeEx2A.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SysInitializeEx2W.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeExA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SysInitializeExW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeLib.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_SysInitializeLibEx.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeLibEx2.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeLibEx2A.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SysInitializeLibEx2W.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeLibExA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SysInitializeLibExW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_TestGetCap.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_UnlockMemory.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_UnlockMemoryEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_UpdateCurrentAcquiredImage.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_UseMultipleThreads.argtypes = [ct.c_long]

def setup_ansi(theDLL):
     # set up the callback types
     from ctypes.wintypes import WPARAM, LPARAM
     theDLL.SETCALLBACK_TYPE = ct.CFUNCTYPE(ct.c_long, WPARAM, LPARAM, ct.c_long)
     theDLL.SETCALLBACK64_TYPE = ct.CFUNCTYPE(ct.c_long, WPARAM, LPARAM, ct.c_int64)
     theDLL.SETERRORPROC_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_long, ct.c_long)
     theDLL.SETERRORPROC64_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_long, ct.c_int64)
     theDLL.SETLOGGERPROC_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_char_p, ct.c_int64)
     theDLL.SETLOGGERPROCA_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_char_p, ct.c_int64)
     theDLL.SETLOGGERPROCW_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_wchar_p, ct.c_int64)
     theDLL.ERRORPROC_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_long, ct.c_long)
     theDLL.ERRORPROC64_TYPE = ct.CFUNCTYPE(ct.c_long, ct.c_long, ct.c_int64)
     theDLL.DIBUPDATEPROC_TYPE = ct.CFUNCTYPE(ct.c_void_p, ct.c_void_p, ct.c_long, ct.c_void_p)

     #set up the return types
     theDLL.DTWAIN_AcquireAudioFile.restype = ct.c_long
     theDLL.DTWAIN_AcquireAudioFileA.restype = ct.c_long
     theDLL.DTWAIN_AcquireAudioFileW.restype = ct.c_long
     theDLL.DTWAIN_AcquireAudioNative.restype = ct.c_void_p
     theDLL.DTWAIN_AcquireAudioNativeEx.restype = ct.c_long
     theDLL.DTWAIN_AcquireBuffered.restype = ct.c_void_p
     theDLL.DTWAIN_AcquireBufferedEx.restype = ct.c_long
     theDLL.DTWAIN_AcquireFile.restype = ct.c_long
     theDLL.DTWAIN_AcquireFileA.restype = ct.c_long
     theDLL.DTWAIN_AcquireFileEx.restype = ct.c_long
     theDLL.DTWAIN_AcquireFileW.restype = ct.c_long
     theDLL.DTWAIN_AcquireNative.restype = ct.c_void_p
     theDLL.DTWAIN_AcquireNativeEx.restype = ct.c_long
     theDLL.DTWAIN_AcquireToClipboard.restype = ct.c_void_p
     theDLL.DTWAIN_AddExtImageInfoQuery.restype = ct.c_long
     theDLL.DTWAIN_AddPDFText.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextA.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextElement.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextEx.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextExA.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextExW.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextString.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextStringA.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextStringW.restype = ct.c_long
     theDLL.DTWAIN_AddPDFTextW.restype = ct.c_long
     theDLL.DTWAIN_AllocateMemory.restype = ct.c_void_p
     theDLL.DTWAIN_AllocateMemory64.restype = ct.c_void_p
     theDLL.DTWAIN_AllocateMemoryEx.restype = ct.c_void_p
     theDLL.DTWAIN_AppHandlesExceptions.restype = ct.c_long
     theDLL.DTWAIN_ArrayANSIStringToFloat.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayAdd.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddANSIString.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddANSIStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloat.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatString.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatStringNA.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatStringNW.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFrame.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddFrameN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddLong.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddLong64.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddLong64N.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddLongN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddString.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddStringNA.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddStringNW.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddWideString.restype = ct.c_long
     theDLL.DTWAIN_ArrayAddWideStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayConvertFix32ToFloat.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayConvertFloatToFix32.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCopy.restype = ct.c_long
     theDLL.DTWAIN_ArrayCreate.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCreateCopy.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCreateFromCap.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCreateFromLong64s.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCreateFromLongs.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayCreateFromReals.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayDestroy.restype = ct.c_long
     theDLL.DTWAIN_ArrayDestroyFrames.restype = ct.c_long
     theDLL.DTWAIN_ArrayDumpToLog.restype = ct.c_long
     theDLL.DTWAIN_ArrayFind.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindANSIString.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindFloat.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindFloatString.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindLong.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindLong64.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindString.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayFindWideString.restype = ct.c_long
     theDLL.DTWAIN_ArrayFix32GetAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayFix32SetAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayFloatToANSIString.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayFloatToString.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayFloatToWideString.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtANSIString.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtANSIStringPtr.restype = ct.c_char_p
     theDLL.DTWAIN_ArrayGetAtFloat.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFloatEx.restype = ct.c_double
     theDLL.DTWAIN_ArrayGetAtFloatString.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFrame.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFrameEx.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFrameString.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFrameStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtFrameStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtLong.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtLong64.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtLong64Ex.restype = ct.c_int64
     theDLL.DTWAIN_ArrayGetAtLongEx.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtSource.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtSourceEx.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetAtString.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtStringPtr.restype = ct.c_char_p
     theDLL.DTWAIN_ArrayGetAtStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtWideString.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetAtWideStringPtr.restype = ct.c_wchar_p
     theDLL.DTWAIN_ArrayGetBuffer.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetCapValues.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetCapValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetCapValuesEx2.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayGetCount.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetMaxStringLength.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetSourceAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetStringLength.restype = ct.c_long
     theDLL.DTWAIN_ArrayGetType.restype = ct.c_long
     theDLL.DTWAIN_ArrayInit.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayInsertAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtANSIString.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtANSIStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloat.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatString.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatStringNA.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatStringNW.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFrame.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtFrameN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtLong.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtLong64.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtLong64N.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtLongN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtString.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtStringA.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtStringNA.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtStringNW.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtStringW.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtWideString.restype = ct.c_long
     theDLL.DTWAIN_ArrayInsertAtWideStringN.restype = ct.c_long
     theDLL.DTWAIN_ArrayRemoveAll.restype = ct.c_long
     theDLL.DTWAIN_ArrayRemoveAt.restype = ct.c_long
     theDLL.DTWAIN_ArrayRemoveAtN.restype = ct.c_long
     theDLL.DTWAIN_ArrayResize.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAt.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtANSIString.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFloat.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFloatString.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFrame.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFrameEx.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFrameString.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFrameStringA.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtFrameStringW.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtLong.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtLong64.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtString.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtStringA.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtStringW.restype = ct.c_long
     theDLL.DTWAIN_ArraySetAtWideString.restype = ct.c_long
     theDLL.DTWAIN_ArrayStringToFloat.restype = ct.c_void_p
     theDLL.DTWAIN_ArrayWideStringToFloat.restype = ct.c_void_p
     theDLL.DTWAIN_CallCallback.restype = ct.c_long
     theDLL.DTWAIN_CallCallback64.restype = ct.c_long
     theDLL.DTWAIN_CallDSMProc.restype = ct.c_long
     theDLL.DTWAIN_CheckHandles.restype = ct.c_long
     theDLL.DTWAIN_ClearBuffers.restype = ct.c_long
     theDLL.DTWAIN_ClearErrorBuffer.restype = ct.c_long
     theDLL.DTWAIN_ClearPDFTextElements.restype = ct.c_long
     theDLL.DTWAIN_ClearPage.restype = ct.c_long
     theDLL.DTWAIN_CloseSource.restype = ct.c_long
     theDLL.DTWAIN_CloseSourceUI.restype = ct.c_long
     theDLL.DTWAIN_ConvertDIBToBitmap.restype = ct.c_void_p
     theDLL.DTWAIN_ConvertDIBToFullBitmap.restype = ct.c_void_p
     theDLL.DTWAIN_ConvertToAPIString.restype = ct.c_void_p
     theDLL.DTWAIN_ConvertToAPIStringA.restype = ct.c_void_p
     theDLL.DTWAIN_ConvertToAPIStringEx.restype = ct.c_long
     theDLL.DTWAIN_ConvertToAPIStringExA.restype = ct.c_long
     theDLL.DTWAIN_ConvertToAPIStringExW.restype = ct.c_long
     theDLL.DTWAIN_ConvertToAPIStringW.restype = ct.c_void_p
     theDLL.DTWAIN_CreateAcquisitionArray.restype = ct.c_void_p
     theDLL.DTWAIN_CreatePDFTextElement.restype = ct.c_void_p
     theDLL.DTWAIN_CreatePDFTextElementCopy.restype = ct.c_void_p
     theDLL.DTWAIN_DeleteDIB.restype = ct.c_long
     theDLL.DTWAIN_DestroyAcquisitionArray.restype = ct.c_long
     theDLL.DTWAIN_DestroyPDFTextElement.restype = ct.c_long
     theDLL.DTWAIN_DisableAppWindow.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoBorderDetect.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoBright.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoDeskew.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoFeed.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoRotate.restype = ct.c_long
     theDLL.DTWAIN_EnableAutoScan.restype = ct.c_long
     theDLL.DTWAIN_EnableAutomaticSenseMedium.restype = ct.c_long
     theDLL.DTWAIN_EnableBarcodeDetection.restype = ct.c_long
     theDLL.DTWAIN_EnableDuplex.restype = ct.c_long
     theDLL.DTWAIN_EnableFeeder.restype = ct.c_long
     theDLL.DTWAIN_EnableGetMessageLoop.restype = ct.c_long
     theDLL.DTWAIN_EnableGetMessageLoopDetection.restype = ct.c_long
     theDLL.DTWAIN_EnableIndicator.restype = ct.c_long
     theDLL.DTWAIN_EnableJobFileHandling.restype = ct.c_long
     theDLL.DTWAIN_EnableLamp.restype = ct.c_long
     theDLL.DTWAIN_EnableMsgNotify.restype = ct.c_long
     theDLL.DTWAIN_EnablePatchcodeDetection.restype = ct.c_long
     theDLL.DTWAIN_EnablePeekMessageLoop.restype = ct.c_long
     theDLL.DTWAIN_EnablePrinter.restype = ct.c_long
     theDLL.DTWAIN_EnableThumbnail.restype = ct.c_long
     theDLL.DTWAIN_EnableTripletsNotify.restype = ct.c_long
     theDLL.DTWAIN_EndThread.restype = ct.c_long
     theDLL.DTWAIN_EndTwainSession.restype = ct.c_long
     theDLL.DTWAIN_EnumAlarmVolumes.restype = ct.c_long
     theDLL.DTWAIN_EnumAlarmVolumesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumAlarms.restype = ct.c_long
     theDLL.DTWAIN_EnumAlarmsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumAudioXferMechs.restype = ct.c_long
     theDLL.DTWAIN_EnumAudioXferMechsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumAutoFeedValues.restype = ct.c_long
     theDLL.DTWAIN_EnumAutoFeedValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumAutomaticCaptures.restype = ct.c_long
     theDLL.DTWAIN_EnumAutomaticCapturesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumAutomaticSenseMedium.restype = ct.c_long
     theDLL.DTWAIN_EnumAutomaticSenseMediumEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodeCodes.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodeCodesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodeMaxPrioritiesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodeMaxRetriesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodePrioritiesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodeSearchModes.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodeSearchModesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBarcodeTimeOutValues.restype = ct.c_long
     theDLL.DTWAIN_EnumBarcodeTimeOutValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBitDepths.restype = ct.c_long
     theDLL.DTWAIN_EnumBitDepthsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBitDepthsEx2.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBottomCameras.restype = ct.c_long
     theDLL.DTWAIN_EnumBottomCamerasEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumBrightnessValues.restype = ct.c_long
     theDLL.DTWAIN_EnumBrightnessValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCameras.restype = ct.c_long
     theDLL.DTWAIN_EnumCamerasEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCamerasEx2.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCapLabels.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCompressionTypes.restype = ct.c_long
     theDLL.DTWAIN_EnumCompressionTypesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCompressionTypesEx2.restype = ct.c_void_p
     theDLL.DTWAIN_EnumContrastValues.restype = ct.c_long
     theDLL.DTWAIN_EnumContrastValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumCustomCaps.restype = ct.c_long
     theDLL.DTWAIN_EnumCustomCapsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumDoubleFeedDetectLengths.restype = ct.c_long
     theDLL.DTWAIN_EnumDoubleFeedDetectLengthsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumDoubleFeedDetectValues.restype = ct.c_long
     theDLL.DTWAIN_EnumDoubleFeedDetectValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumExtImageInfoTypes.restype = ct.c_long
     theDLL.DTWAIN_EnumExtImageInfoTypesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumExtendedCaps.restype = ct.c_long
     theDLL.DTWAIN_EnumExtendedCapsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumExtendedCapsEx2.restype = ct.c_void_p
     theDLL.DTWAIN_EnumFileTypeBitsPerPixel.restype = ct.c_long
     theDLL.DTWAIN_EnumFileXferFormats.restype = ct.c_long
     theDLL.DTWAIN_EnumFileXferFormatsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumHalftones.restype = ct.c_long
     theDLL.DTWAIN_EnumHalftonesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumHighlightValues.restype = ct.c_long
     theDLL.DTWAIN_EnumHighlightValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumJobControls.restype = ct.c_long
     theDLL.DTWAIN_EnumJobControlsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumLightPaths.restype = ct.c_long
     theDLL.DTWAIN_EnumLightPathsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumLightSources.restype = ct.c_long
     theDLL.DTWAIN_EnumLightSourcesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumMaxBuffers.restype = ct.c_long
     theDLL.DTWAIN_EnumMaxBuffersEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumNoiseFilters.restype = ct.c_long
     theDLL.DTWAIN_EnumNoiseFiltersEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumOCRInterfaces.restype = ct.c_long
     theDLL.DTWAIN_EnumOCRInterfacesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumOCRSupportedCaps.restype = ct.c_long
     theDLL.DTWAIN_EnumOrientations.restype = ct.c_long
     theDLL.DTWAIN_EnumOrientationsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumOverscanValues.restype = ct.c_long
     theDLL.DTWAIN_EnumOverscanValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPaperSizes.restype = ct.c_long
     theDLL.DTWAIN_EnumPaperSizesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodeCodes.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodeCodesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodeMaxPrioritiesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodeMaxRetriesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodePrioritiesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodeSearchModes.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodeSearchModesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPatchcodeTimeOutValues.restype = ct.c_long
     theDLL.DTWAIN_EnumPatchcodeTimeOutValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPixelTypes.restype = ct.c_long
     theDLL.DTWAIN_EnumPixelTypesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumPrinterStringModes.restype = ct.c_long
     theDLL.DTWAIN_EnumPrinterStringModesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumResolutionValues.restype = ct.c_long
     theDLL.DTWAIN_EnumResolutionValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumShadowValues.restype = ct.c_long
     theDLL.DTWAIN_EnumShadowValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSourceUnits.restype = ct.c_long
     theDLL.DTWAIN_EnumSourceUnitsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSourceValues.restype = ct.c_long
     theDLL.DTWAIN_EnumSourceValuesA.restype = ct.c_long
     theDLL.DTWAIN_EnumSourceValuesW.restype = ct.c_long
     theDLL.DTWAIN_EnumSources.restype = ct.c_long
     theDLL.DTWAIN_EnumSourcesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedCaps.restype = ct.c_long
     theDLL.DTWAIN_EnumSupportedCapsEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedCapsEx2.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedExtImageInfo.restype = ct.c_long
     theDLL.DTWAIN_EnumSupportedExtImageInfoEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedFileTypes.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedMultiPageFileTypes.restype = ct.c_void_p
     theDLL.DTWAIN_EnumSupportedSinglePageFileTypes.restype = ct.c_void_p
     theDLL.DTWAIN_EnumThresholdValues.restype = ct.c_long
     theDLL.DTWAIN_EnumThresholdValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumTopCameras.restype = ct.c_long
     theDLL.DTWAIN_EnumTopCamerasEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumTwainPrinters.restype = ct.c_long
     theDLL.DTWAIN_EnumTwainPrintersEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumXResolutionValues.restype = ct.c_long
     theDLL.DTWAIN_EnumXResolutionValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_EnumYResolutionValues.restype = ct.c_long
     theDLL.DTWAIN_EnumYResolutionValuesEx.restype = ct.c_void_p
     theDLL.DTWAIN_ExecuteOCR.restype = ct.c_long
     theDLL.DTWAIN_ExecuteOCRA.restype = ct.c_long
     theDLL.DTWAIN_ExecuteOCRW.restype = ct.c_long
     theDLL.DTWAIN_FeedPage.restype = ct.c_long
     theDLL.DTWAIN_FlipBitmap.restype = ct.c_long
     theDLL.DTWAIN_FlushAcquiredPages.restype = ct.c_long
     theDLL.DTWAIN_FrameCreate.restype = ct.c_void_p
     theDLL.DTWAIN_FrameCreateString.restype = ct.c_void_p
     theDLL.DTWAIN_FrameCreateStringA.restype = ct.c_void_p
     theDLL.DTWAIN_FrameCreateStringW.restype = ct.c_void_p
     theDLL.DTWAIN_FrameDestroy.restype = ct.c_long
     theDLL.DTWAIN_FrameGetAll.restype = ct.c_long
     theDLL.DTWAIN_FrameGetAllString.restype = ct.c_long
     theDLL.DTWAIN_FrameGetAllStringA.restype = ct.c_long
     theDLL.DTWAIN_FrameGetAllStringW.restype = ct.c_long
     theDLL.DTWAIN_FrameGetValue.restype = ct.c_long
     theDLL.DTWAIN_FrameGetValueString.restype = ct.c_long
     theDLL.DTWAIN_FrameGetValueStringA.restype = ct.c_long
     theDLL.DTWAIN_FrameGetValueStringW.restype = ct.c_long
     theDLL.DTWAIN_FrameIsValid.restype = ct.c_long
     theDLL.DTWAIN_FrameSetAll.restype = ct.c_long
     theDLL.DTWAIN_FrameSetAllString.restype = ct.c_long
     theDLL.DTWAIN_FrameSetAllStringA.restype = ct.c_long
     theDLL.DTWAIN_FrameSetAllStringW.restype = ct.c_long
     theDLL.DTWAIN_FrameSetValue.restype = ct.c_long
     theDLL.DTWAIN_FrameSetValueString.restype = ct.c_long
     theDLL.DTWAIN_FrameSetValueStringA.restype = ct.c_long
     theDLL.DTWAIN_FrameSetValueStringW.restype = ct.c_long
     theDLL.DTWAIN_FreeExtImageInfo.restype = ct.c_long
     theDLL.DTWAIN_FreeMemory.restype = ct.c_long
     theDLL.DTWAIN_FreeMemoryEx.restype = ct.c_long
     theDLL.DTWAIN_GetAPIHandleStatus.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireArea.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireArea2.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireArea2String.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireArea2StringA.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireArea2StringW.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireAreaEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetAcquireMetrics.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireStripBuffer.restype = ct.c_void_p
     theDLL.DTWAIN_GetAcquireStripData.restype = ct.c_long
     theDLL.DTWAIN_GetAcquireStripSizes.restype = ct.c_long
     theDLL.DTWAIN_GetAcquiredImage.restype = ct.c_void_p
     theDLL.DTWAIN_GetAcquiredImageArray.restype = ct.c_void_p
     theDLL.DTWAIN_GetAcquisitionArray.restype = ct.c_void_p
     theDLL.DTWAIN_GetActiveDSMPath.restype = ct.c_long
     theDLL.DTWAIN_GetActiveDSMPathA.restype = ct.c_long
     theDLL.DTWAIN_GetActiveDSMPathW.restype = ct.c_long
     theDLL.DTWAIN_GetActiveDSMVersionInfo.restype = ct.c_long
     theDLL.DTWAIN_GetActiveDSMVersionInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetActiveDSMVersionInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetAlarmVolume.restype = ct.c_long
     theDLL.DTWAIN_GetAllSourceDibs.restype = ct.c_void_p
     theDLL.DTWAIN_GetAppInfo.restype = ct.c_long
     theDLL.DTWAIN_GetAppInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetAppInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetAuthor.restype = ct.c_long
     theDLL.DTWAIN_GetAuthorA.restype = ct.c_long
     theDLL.DTWAIN_GetAuthorW.restype = ct.c_long
     theDLL.DTWAIN_GetBarcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_GetBarcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_GetBarcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_GetBarcodeSearchMode.restype = ct.c_long
     theDLL.DTWAIN_GetBarcodeTimeOut.restype = ct.c_long
     theDLL.DTWAIN_GetBatteryMinutes.restype = ct.c_long
     theDLL.DTWAIN_GetBatteryPercent.restype = ct.c_long
     theDLL.DTWAIN_GetBitDepth.restype = ct.c_long
     theDLL.DTWAIN_GetBitDepthEx.restype = ct.c_long
     theDLL.DTWAIN_GetBlankPageAutoDetection.restype = ct.c_long
     theDLL.DTWAIN_GetBrightness.restype = ct.c_long
     theDLL.DTWAIN_GetBrightnessEx.restype = ct.c_double
     theDLL.DTWAIN_GetBrightnessString.restype = ct.c_long
     theDLL.DTWAIN_GetBrightnessStringA.restype = ct.c_long
     theDLL.DTWAIN_GetBrightnessStringW.restype = ct.c_long
     theDLL.DTWAIN_GetBufferedTransferInfo.restype = ct.c_void_p
     theDLL.DTWAIN_GetCallback.restype = theDLL.SETCALLBACK_TYPE
     theDLL.DTWAIN_GetCallback64.restype = theDLL.SETCALLBACK64_TYPE
     theDLL.DTWAIN_GetCapArrayType.restype = ct.c_long
     theDLL.DTWAIN_GetCapContainer.restype = ct.c_long
     theDLL.DTWAIN_GetCapContainerEx.restype = ct.c_long
     theDLL.DTWAIN_GetCapContainerEx2.restype = ct.c_void_p
     theDLL.DTWAIN_GetCapDataType.restype = ct.c_long
     theDLL.DTWAIN_GetCapFromName.restype = ct.c_long
     theDLL.DTWAIN_GetCapFromNameA.restype = ct.c_long
     theDLL.DTWAIN_GetCapFromNameW.restype = ct.c_long
     theDLL.DTWAIN_GetCapHelp.restype = ct.c_long
     theDLL.DTWAIN_GetCapHelpA.restype = ct.c_long
     theDLL.DTWAIN_GetCapHelpW.restype = ct.c_long
     theDLL.DTWAIN_GetCapLabel.restype = ct.c_long
     theDLL.DTWAIN_GetCapLabelA.restype = ct.c_long
     theDLL.DTWAIN_GetCapLabelW.restype = ct.c_long
     theDLL.DTWAIN_GetCapOperations.restype = ct.c_long
     theDLL.DTWAIN_GetCapOperationsEx.restype = ct.c_long
     theDLL.DTWAIN_GetCapValues.restype = ct.c_long
     theDLL.DTWAIN_GetCapValuesEx.restype = ct.c_long
     theDLL.DTWAIN_GetCapValuesEx2.restype = ct.c_long
     theDLL.DTWAIN_GetCaption.restype = ct.c_long
     theDLL.DTWAIN_GetCaptionA.restype = ct.c_long
     theDLL.DTWAIN_GetCaptionW.restype = ct.c_long
     theDLL.DTWAIN_GetCompressionSize.restype = ct.c_long
     theDLL.DTWAIN_GetCompressionType.restype = ct.c_long
     theDLL.DTWAIN_GetCompressionTypeEx.restype = ct.c_long
     theDLL.DTWAIN_GetConditionCodeString.restype = ct.c_long
     theDLL.DTWAIN_GetConditionCodeStringA.restype = ct.c_long
     theDLL.DTWAIN_GetConditionCodeStringW.restype = ct.c_long
     theDLL.DTWAIN_GetConstantFromTwainName.restype = ct.c_long
     theDLL.DTWAIN_GetConstantFromTwainNameA.restype = ct.c_long
     theDLL.DTWAIN_GetConstantFromTwainNameW.restype = ct.c_long
     theDLL.DTWAIN_GetContrast.restype = ct.c_long
     theDLL.DTWAIN_GetContrastEx.restype = ct.c_double
     theDLL.DTWAIN_GetContrastString.restype = ct.c_long
     theDLL.DTWAIN_GetContrastStringA.restype = ct.c_long
     theDLL.DTWAIN_GetContrastStringW.restype = ct.c_long
     theDLL.DTWAIN_GetCountry.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentAcquiredImage.restype = ct.c_void_p
     theDLL.DTWAIN_GetCurrentFileName.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentFileNameA.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentFileNameW.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentPageNum.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentRetryCount.restype = ct.c_long
     theDLL.DTWAIN_GetCurrentTwainTriplet.restype = ct.c_long
     theDLL.DTWAIN_GetCustomDSData.restype = ct.c_void_p
     theDLL.DTWAIN_GetDSMFullName.restype = ct.c_long
     theDLL.DTWAIN_GetDSMFullNameA.restype = ct.c_long
     theDLL.DTWAIN_GetDSMFullNameW.restype = ct.c_long
     theDLL.DTWAIN_GetDSMSearchOrder.restype = ct.c_long
     theDLL.DTWAIN_GetDSMSearchOrderEx.restype = ct.c_long
     theDLL.DTWAIN_GetDSMSearchOrderExA.restype = ct.c_long
     theDLL.DTWAIN_GetDSMSearchOrderExW.restype = ct.c_long
     theDLL.DTWAIN_GetDTWAINHandle.restype = ct.c_void_p
     theDLL.DTWAIN_GetDeviceEvent.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceEventEx.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceEventInfo.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceNotifications.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceTimeDate.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceTimeDateA.restype = ct.c_long
     theDLL.DTWAIN_GetDeviceTimeDateW.restype = ct.c_long
     theDLL.DTWAIN_GetDoubleFeedDetectLength.restype = ct.c_long
     theDLL.DTWAIN_GetDoubleFeedDetectValues.restype = ct.c_long
     theDLL.DTWAIN_GetDuplexType.restype = ct.c_long
     theDLL.DTWAIN_GetDuplexTypeEx.restype = ct.c_long
     theDLL.DTWAIN_GetErrorBuffer.restype = ct.c_long
     theDLL.DTWAIN_GetErrorBufferThreshold.restype = ct.c_long
     theDLL.DTWAIN_GetErrorCallback.restype = theDLL.SETERRORPROC_TYPE
     theDLL.DTWAIN_GetErrorCallback64.restype = theDLL.SETERRORPROC64_TYPE
     theDLL.DTWAIN_GetErrorString.restype = ct.c_long
     theDLL.DTWAIN_GetErrorStringA.restype = ct.c_long
     theDLL.DTWAIN_GetErrorStringW.restype = ct.c_long
     theDLL.DTWAIN_GetExtCapFromName.restype = ct.c_long
     theDLL.DTWAIN_GetExtCapFromNameA.restype = ct.c_long
     theDLL.DTWAIN_GetExtCapFromNameW.restype = ct.c_long
     theDLL.DTWAIN_GetExtImageInfo.restype = ct.c_long
     theDLL.DTWAIN_GetExtImageInfoData.restype = ct.c_long
     theDLL.DTWAIN_GetExtImageInfoDataEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetExtImageInfoItem.restype = ct.c_long
     theDLL.DTWAIN_GetExtImageInfoItemEx.restype = ct.c_long
     theDLL.DTWAIN_GetExtNameFromCap.restype = ct.c_long
     theDLL.DTWAIN_GetExtNameFromCapA.restype = ct.c_long
     theDLL.DTWAIN_GetExtNameFromCapW.restype = ct.c_long
     theDLL.DTWAIN_GetFeederAlignment.restype = ct.c_long
     theDLL.DTWAIN_GetFeederFuncs.restype = ct.c_long
     theDLL.DTWAIN_GetFeederOrder.restype = ct.c_long
     theDLL.DTWAIN_GetFeederWaitTime.restype = ct.c_long
     theDLL.DTWAIN_GetFileCompressionType.restype = ct.c_long
     theDLL.DTWAIN_GetFileSavePageCount.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeExtensions.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeExtensionsA.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeExtensionsW.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeName.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeNameA.restype = ct.c_long
     theDLL.DTWAIN_GetFileTypeNameW.restype = ct.c_long
     theDLL.DTWAIN_GetHalftone.restype = ct.c_long
     theDLL.DTWAIN_GetHalftoneA.restype = ct.c_long
     theDLL.DTWAIN_GetHalftoneW.restype = ct.c_long
     theDLL.DTWAIN_GetHighlight.restype = ct.c_long
     theDLL.DTWAIN_GetHighlightString.restype = ct.c_long
     theDLL.DTWAIN_GetHighlightStringA.restype = ct.c_long
     theDLL.DTWAIN_GetHighlightStringW.restype = ct.c_long
     theDLL.DTWAIN_GetImageInfo.restype = ct.c_long
     theDLL.DTWAIN_GetImageInfoString.restype = ct.c_long
     theDLL.DTWAIN_GetImageInfoStringA.restype = ct.c_long
     theDLL.DTWAIN_GetImageInfoStringW.restype = ct.c_long
     theDLL.DTWAIN_GetJobControl.restype = ct.c_long
     theDLL.DTWAIN_GetJobControlEx.restype = ct.c_long
     theDLL.DTWAIN_GetJpegValues.restype = ct.c_long
     theDLL.DTWAIN_GetJpegXRValues.restype = ct.c_long
     theDLL.DTWAIN_GetLanguage.restype = ct.c_long
     theDLL.DTWAIN_GetLastError.restype = ct.c_long
     theDLL.DTWAIN_GetLibraryPath.restype = ct.c_long
     theDLL.DTWAIN_GetLibraryPathA.restype = ct.c_long
     theDLL.DTWAIN_GetLibraryPathW.restype = ct.c_long
     theDLL.DTWAIN_GetLightPath.restype = ct.c_long
     theDLL.DTWAIN_GetLightPathEx.restype = ct.c_long
     theDLL.DTWAIN_GetLightSource.restype = ct.c_long
     theDLL.DTWAIN_GetLightSources.restype = ct.c_long
     theDLL.DTWAIN_GetLightSourcesEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetLoggerCallback.restype = theDLL.SETLOGGERPROC_TYPE
     theDLL.DTWAIN_GetLoggerCallbackA.restype = theDLL.SETLOGGERPROCA_TYPE
     theDLL.DTWAIN_GetLoggerCallbackW.restype = theDLL.SETLOGGERPROCW_TYPE
     theDLL.DTWAIN_GetManualDuplexCount.restype = ct.c_long
     theDLL.DTWAIN_GetMaxAcquisitions.restype = ct.c_long
     theDLL.DTWAIN_GetMaxBuffers.restype = ct.c_long
     theDLL.DTWAIN_GetMaxPagesToAcquire.restype = ct.c_long
     theDLL.DTWAIN_GetMaxRetryAttempts.restype = ct.c_long
     theDLL.DTWAIN_GetNameFromCap.restype = ct.c_long
     theDLL.DTWAIN_GetNameFromCapA.restype = ct.c_long
     theDLL.DTWAIN_GetNameFromCapW.restype = ct.c_long
     theDLL.DTWAIN_GetNoiseFilter.restype = ct.c_long
     theDLL.DTWAIN_GetNumAcquiredImages.restype = ct.c_long
     theDLL.DTWAIN_GetNumAcquisitions.restype = ct.c_long
     theDLL.DTWAIN_GetOCRCapValues.restype = ct.c_long
     theDLL.DTWAIN_GetOCRErrorString.restype = ct.c_long
     theDLL.DTWAIN_GetOCRErrorStringA.restype = ct.c_long
     theDLL.DTWAIN_GetOCRErrorStringW.restype = ct.c_long
     theDLL.DTWAIN_GetOCRLastError.restype = ct.c_long
     theDLL.DTWAIN_GetOCRMajorMinorVersion.restype = ct.c_long
     theDLL.DTWAIN_GetOCRManufacturer.restype = ct.c_long
     theDLL.DTWAIN_GetOCRManufacturerA.restype = ct.c_long
     theDLL.DTWAIN_GetOCRManufacturerW.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductFamily.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductFamilyA.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductFamilyW.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductName.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductNameA.restype = ct.c_long
     theDLL.DTWAIN_GetOCRProductNameW.restype = ct.c_long
     theDLL.DTWAIN_GetOCRText.restype = ct.c_void_p
     theDLL.DTWAIN_GetOCRTextA.restype = ct.c_void_p
     theDLL.DTWAIN_GetOCRTextInfoFloat.restype = ct.c_long
     theDLL.DTWAIN_GetOCRTextInfoFloatEx.restype = ct.c_long
     theDLL.DTWAIN_GetOCRTextInfoHandle.restype = ct.c_void_p
     theDLL.DTWAIN_GetOCRTextInfoLong.restype = ct.c_long
     theDLL.DTWAIN_GetOCRTextInfoLongEx.restype = ct.c_long
     theDLL.DTWAIN_GetOCRTextW.restype = ct.c_void_p
     theDLL.DTWAIN_GetOCRVersionInfo.restype = ct.c_long
     theDLL.DTWAIN_GetOCRVersionInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetOCRVersionInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetOrientation.restype = ct.c_long
     theDLL.DTWAIN_GetOrientationEx.restype = ct.c_long
     theDLL.DTWAIN_GetOverscan.restype = ct.c_long
     theDLL.DTWAIN_GetPDFTextElementFloat.restype = ct.c_long
     theDLL.DTWAIN_GetPDFTextElementLong.restype = ct.c_long
     theDLL.DTWAIN_GetPDFTextElementString.restype = ct.c_long
     theDLL.DTWAIN_GetPDFTextElementStringA.restype = ct.c_long
     theDLL.DTWAIN_GetPDFTextElementStringW.restype = ct.c_long
     theDLL.DTWAIN_GetPDFType1FontName.restype = ct.c_long
     theDLL.DTWAIN_GetPDFType1FontNameA.restype = ct.c_long
     theDLL.DTWAIN_GetPDFType1FontNameW.restype = ct.c_long
     theDLL.DTWAIN_GetPaperSize.restype = ct.c_long
     theDLL.DTWAIN_GetPaperSizeName.restype = ct.c_long
     theDLL.DTWAIN_GetPaperSizeNameA.restype = ct.c_long
     theDLL.DTWAIN_GetPaperSizeNameW.restype = ct.c_long
     theDLL.DTWAIN_GetPatchcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_GetPatchcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_GetPatchcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_GetPatchcodeSearchMode.restype = ct.c_long
     theDLL.DTWAIN_GetPatchcodeTimeOut.restype = ct.c_long
     theDLL.DTWAIN_GetPixelFlavor.restype = ct.c_long
     theDLL.DTWAIN_GetPixelType.restype = ct.c_long
     theDLL.DTWAIN_GetPrinter.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterEx.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStartNumber.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStartNumberEx.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStringMode.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStringModeEx.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStrings.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterStringsEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetPrinterSuffixString.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterSuffixStringA.restype = ct.c_long
     theDLL.DTWAIN_GetPrinterSuffixStringW.restype = ct.c_long
     theDLL.DTWAIN_GetRegisteredMsg.restype = ct.c_long
     theDLL.DTWAIN_GetResolution.restype = ct.c_long
     theDLL.DTWAIN_GetResolutionEx.restype = ct.c_double
     theDLL.DTWAIN_GetResolutionString.restype = ct.c_long
     theDLL.DTWAIN_GetResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_GetResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_GetResourceString.restype = ct.c_long
     theDLL.DTWAIN_GetResourceStringA.restype = ct.c_long
     theDLL.DTWAIN_GetResourceStringW.restype = ct.c_long
     theDLL.DTWAIN_GetRotation.restype = ct.c_long
     theDLL.DTWAIN_GetRotationEx.restype = ct.c_double
     theDLL.DTWAIN_GetRotationString.restype = ct.c_long
     theDLL.DTWAIN_GetRotationStringA.restype = ct.c_long
     theDLL.DTWAIN_GetRotationStringW.restype = ct.c_long
     theDLL.DTWAIN_GetSaveFileName.restype = ct.c_long
     theDLL.DTWAIN_GetSaveFileNameA.restype = ct.c_long
     theDLL.DTWAIN_GetSaveFileNameW.restype = ct.c_long
     theDLL.DTWAIN_GetSessionDetails.restype = ct.c_long
     theDLL.DTWAIN_GetSessionDetailsA.restype = ct.c_long
     theDLL.DTWAIN_GetSessionDetailsW.restype = ct.c_long
     theDLL.DTWAIN_GetShadow.restype = ct.c_long
     theDLL.DTWAIN_GetShadowString.restype = ct.c_long
     theDLL.DTWAIN_GetShadowStringA.restype = ct.c_long
     theDLL.DTWAIN_GetShadowStringW.restype = ct.c_long
     theDLL.DTWAIN_GetShortVersionString.restype = ct.c_long
     theDLL.DTWAIN_GetShortVersionStringA.restype = ct.c_long
     theDLL.DTWAIN_GetShortVersionStringW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceAcquisitions.restype = ct.c_void_p
     theDLL.DTWAIN_GetSourceDetails.restype = ct.c_long
     theDLL.DTWAIN_GetSourceDetailsA.restype = ct.c_long
     theDLL.DTWAIN_GetSourceDetailsW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceID.restype = ct.c_void_p
     theDLL.DTWAIN_GetSourceIDEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetSourceManufacturer.restype = ct.c_long
     theDLL.DTWAIN_GetSourceManufacturerA.restype = ct.c_long
     theDLL.DTWAIN_GetSourceManufacturerW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductFamily.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductFamilyA.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductFamilyW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductName.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductNameA.restype = ct.c_long
     theDLL.DTWAIN_GetSourceProductNameW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceUnit.restype = ct.c_long
     theDLL.DTWAIN_GetSourceUnitEx.restype = ct.c_long
     theDLL.DTWAIN_GetSourceVersionInfo.restype = ct.c_long
     theDLL.DTWAIN_GetSourceVersionInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetSourceVersionInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetSourceVersionNumber.restype = ct.c_long
     theDLL.DTWAIN_GetStaticLibVersion.restype = ct.c_long
     theDLL.DTWAIN_GetTempFileDirectory.restype = ct.c_long
     theDLL.DTWAIN_GetTempFileDirectoryA.restype = ct.c_long
     theDLL.DTWAIN_GetTempFileDirectoryW.restype = ct.c_long
     theDLL.DTWAIN_GetThreshold.restype = ct.c_long
     theDLL.DTWAIN_GetThresholdString.restype = ct.c_long
     theDLL.DTWAIN_GetThresholdStringA.restype = ct.c_long
     theDLL.DTWAIN_GetThresholdStringW.restype = ct.c_long
     theDLL.DTWAIN_GetTimeDate.restype = ct.c_long
     theDLL.DTWAIN_GetTimeDateA.restype = ct.c_long
     theDLL.DTWAIN_GetTimeDateW.restype = ct.c_long
     theDLL.DTWAIN_GetTwainAppID.restype = ct.c_void_p
     theDLL.DTWAIN_GetTwainAppIDEx.restype = ct.c_void_p
     theDLL.DTWAIN_GetTwainAvailability.restype = ct.c_long
     theDLL.DTWAIN_GetTwainAvailabilityEx.restype = ct.c_long
     theDLL.DTWAIN_GetTwainAvailabilityExA.restype = ct.c_long
     theDLL.DTWAIN_GetTwainAvailabilityExW.restype = ct.c_long
     theDLL.DTWAIN_GetTwainHwnd.restype = ct.c_void_p
     theDLL.DTWAIN_GetTwainMode.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstant.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstantA.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstantEx.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstantExA.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstantExW.restype = ct.c_long
     theDLL.DTWAIN_GetTwainNameFromConstantW.restype = ct.c_long
     theDLL.DTWAIN_GetTwainTimeout.restype = ct.c_long
     theDLL.DTWAIN_GetVersion.restype = ct.c_long
     theDLL.DTWAIN_GetVersionCopyright.restype = ct.c_long
     theDLL.DTWAIN_GetVersionCopyrightA.restype = ct.c_long
     theDLL.DTWAIN_GetVersionCopyrightW.restype = ct.c_long
     theDLL.DTWAIN_GetVersionEx.restype = ct.c_long
     theDLL.DTWAIN_GetVersionInfo.restype = ct.c_long
     theDLL.DTWAIN_GetVersionInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetVersionInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetVersionString.restype = ct.c_long
     theDLL.DTWAIN_GetVersionStringA.restype = ct.c_long
     theDLL.DTWAIN_GetVersionStringW.restype = ct.c_long
     theDLL.DTWAIN_GetWindowsVersionInfo.restype = ct.c_long
     theDLL.DTWAIN_GetWindowsVersionInfoA.restype = ct.c_long
     theDLL.DTWAIN_GetWindowsVersionInfoW.restype = ct.c_long
     theDLL.DTWAIN_GetXResolution.restype = ct.c_long
     theDLL.DTWAIN_GetXResolutionString.restype = ct.c_long
     theDLL.DTWAIN_GetXResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_GetXResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_GetYResolution.restype = ct.c_long
     theDLL.DTWAIN_GetYResolutionString.restype = ct.c_long
     theDLL.DTWAIN_GetYResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_GetYResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_InitExtImageInfo.restype = ct.c_long
     theDLL.DTWAIN_InitImageFileAppend.restype = ct.c_long
     theDLL.DTWAIN_InitImageFileAppendA.restype = ct.c_long
     theDLL.DTWAIN_InitImageFileAppendW.restype = ct.c_long
     theDLL.DTWAIN_InitOCRInterface.restype = ct.c_long
     theDLL.DTWAIN_IsAcquiring.restype = ct.c_long
     theDLL.DTWAIN_IsAudioXferSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoBorderDetectEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutoBorderDetectSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoBrightEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutoBrightSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoDeskewEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutoDeskewSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoFeedEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutoFeedSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoRotateEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutoRotateSupported.restype = ct.c_long
     theDLL.DTWAIN_IsAutoScanEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutomaticSenseMediumEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsAutomaticSenseMediumSupported.restype = ct.c_long
     theDLL.DTWAIN_IsBarcodeCapsSupported.restype = ct.c_long
     theDLL.DTWAIN_IsBarcodeDetectionEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsBarcodeSupported.restype = ct.c_long
     theDLL.DTWAIN_IsBlankPageDetectionOn.restype = ct.c_long
     theDLL.DTWAIN_IsBufferedTileModeOn.restype = ct.c_long
     theDLL.DTWAIN_IsBufferedTileModeSupported.restype = ct.c_long
     theDLL.DTWAIN_IsCapSupported.restype = ct.c_long
     theDLL.DTWAIN_IsCompressionSupported.restype = ct.c_long
     theDLL.DTWAIN_IsCustomDSDataSupported.restype = ct.c_long
     theDLL.DTWAIN_IsDIBBlank.restype = ct.c_long
     theDLL.DTWAIN_IsDIBBlankString.restype = ct.c_long
     theDLL.DTWAIN_IsDIBBlankStringA.restype = ct.c_long
     theDLL.DTWAIN_IsDIBBlankStringW.restype = ct.c_long
     theDLL.DTWAIN_IsDeviceEventSupported.restype = ct.c_long
     theDLL.DTWAIN_IsDeviceOnLine.restype = ct.c_long
     theDLL.DTWAIN_IsDoubleFeedDetectLengthSupported.restype = ct.c_long
     theDLL.DTWAIN_IsDoubleFeedDetectSupported.restype = ct.c_long
     theDLL.DTWAIN_IsDuplexEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsDuplexSupported.restype = ct.c_long
     theDLL.DTWAIN_IsExtImageInfoSupported.restype = ct.c_long
     theDLL.DTWAIN_IsFeederEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsFeederLoaded.restype = ct.c_long
     theDLL.DTWAIN_IsFeederSensitive.restype = ct.c_long
     theDLL.DTWAIN_IsFeederSupported.restype = ct.c_long
     theDLL.DTWAIN_IsFileSystemSupported.restype = ct.c_long
     theDLL.DTWAIN_IsFileXferSupported.restype = ct.c_long
     theDLL.DTWAIN_IsGetMessageLoopDetectionOn.restype = ct.c_long
     theDLL.DTWAIN_IsGetMessageLoopEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldALastPageSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldALevelSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldAPrintFormatSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldAValueSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldBLastPageSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldBLevelSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldBPrintFormatSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldBValueSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldCLastPageSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldCLevelSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldCPrintFormatSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldCValueSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldDLastPageSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldDLevelSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldDPrintFormatSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldDValueSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldELastPageSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldELevelSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldEPrintFormatSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIAFieldEValueSupported.restype = ct.c_long
     theDLL.DTWAIN_IsImageAddressingSupported.restype = ct.c_long
     theDLL.DTWAIN_IsIndicatorEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsIndicatorSupported.restype = ct.c_long
     theDLL.DTWAIN_IsInitialized.restype = ct.c_long
     theDLL.DTWAIN_IsJobControlSupported.restype = ct.c_long
     theDLL.DTWAIN_IsLampEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsLampSupported.restype = ct.c_long
     theDLL.DTWAIN_IsLightPathSupported.restype = ct.c_long
     theDLL.DTWAIN_IsLightSourceSupported.restype = ct.c_long
     theDLL.DTWAIN_IsMaxBuffersSupported.restype = ct.c_long
     theDLL.DTWAIN_IsMemFileXferSupported.restype = ct.c_long
     theDLL.DTWAIN_IsMsgNotifyEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsNotifyTripletsEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsOCREngineActivated.restype = ct.c_long
     theDLL.DTWAIN_IsOpenSourcesOnSelect.restype = ct.c_long
     theDLL.DTWAIN_IsOrientationSupported.restype = ct.c_long
     theDLL.DTWAIN_IsOverscanSupported.restype = ct.c_long
     theDLL.DTWAIN_IsPaperDetectable.restype = ct.c_long
     theDLL.DTWAIN_IsPaperSizeSupported.restype = ct.c_long
     theDLL.DTWAIN_IsPatchcodeCapsSupported.restype = ct.c_long
     theDLL.DTWAIN_IsPatchcodeDetectionEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsPatchcodeSupported.restype = ct.c_long
     theDLL.DTWAIN_IsPeekMessageLoopEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsPixelTypeSupported.restype = ct.c_long
     theDLL.DTWAIN_IsPrinterEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsPrinterSupported.restype = ct.c_long
     theDLL.DTWAIN_IsRotationSupported.restype = ct.c_long
     theDLL.DTWAIN_IsSessionEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsSkipImageInfoError.restype = ct.c_long
     theDLL.DTWAIN_IsSourceAcquiring.restype = ct.c_long
     theDLL.DTWAIN_IsSourceAcquiringEx.restype = ct.c_long
     theDLL.DTWAIN_IsSourceInUIOnlyMode.restype = ct.c_long
     theDLL.DTWAIN_IsSourceOpen.restype = ct.c_long
     theDLL.DTWAIN_IsSourceSelected.restype = ct.c_long
     theDLL.DTWAIN_IsSourceValid.restype = ct.c_long
     theDLL.DTWAIN_IsThumbnailEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsThumbnailSupported.restype = ct.c_long
     theDLL.DTWAIN_IsTwainAvailable.restype = ct.c_long
     theDLL.DTWAIN_IsTwainAvailableEx.restype = ct.c_long
     theDLL.DTWAIN_IsTwainAvailableExA.restype = ct.c_long
     theDLL.DTWAIN_IsTwainAvailableExW.restype = ct.c_long
     theDLL.DTWAIN_IsUIControllable.restype = ct.c_long
     theDLL.DTWAIN_IsUIEnabled.restype = ct.c_long
     theDLL.DTWAIN_IsUIOnlySupported.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResources.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResourcesA.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResourcesEx.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResourcesExA.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResourcesExW.restype = ct.c_long
     theDLL.DTWAIN_LoadCustomStringResourcesW.restype = ct.c_long
     theDLL.DTWAIN_LoadLanguageResource.restype = ct.c_long
     theDLL.DTWAIN_LockMemory.restype = ct.c_void_p
     theDLL.DTWAIN_LockMemoryEx.restype = ct.c_void_p
     theDLL.DTWAIN_LogMessage.restype = ct.c_long
     theDLL.DTWAIN_LogMessageA.restype = ct.c_long
     theDLL.DTWAIN_LogMessageW.restype = ct.c_long
     theDLL.DTWAIN_MakeRGB.restype = ct.c_long
     theDLL.DTWAIN_OpenSource.restype = ct.c_long
     theDLL.DTWAIN_OpenSourcesOnSelect.restype = ct.c_long
     theDLL.DTWAIN_RangeCreate.restype = ct.c_void_p
     theDLL.DTWAIN_RangeCreateFromCap.restype = ct.c_void_p
     theDLL.DTWAIN_RangeDestroy.restype = ct.c_long
     theDLL.DTWAIN_RangeExpand.restype = ct.c_long
     theDLL.DTWAIN_RangeExpandEx.restype = ct.c_void_p
     theDLL.DTWAIN_RangeGetAll.restype = ct.c_long
     theDLL.DTWAIN_RangeGetAllFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeGetAllFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeGetAllFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeGetAllFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeGetAllLong.restype = ct.c_long
     theDLL.DTWAIN_RangeGetCount.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValue.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValueFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValueFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValueFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValueFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeGetExpValueLong.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValue.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValueFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValueFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValueFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValueFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeGetNearestValueLong.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPos.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPosFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPosFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPosFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPosFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeGetPosLong.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValue.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValueFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValueFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValueFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValueFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeGetValueLong.restype = ct.c_long
     theDLL.DTWAIN_RangeIsValid.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAll.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAllFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAllFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAllFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAllFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeSetAllLong.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValue.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValueFloat.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValueFloatString.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValueFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValueFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_RangeSetValueLong.restype = ct.c_long
     theDLL.DTWAIN_RemovePDFTextElement.restype = ct.c_long
     theDLL.DTWAIN_ResetPDFTextElement.restype = ct.c_long
     theDLL.DTWAIN_RewindPage.restype = ct.c_long
     theDLL.DTWAIN_RotateImage.restype = ct.c_void_p
     theDLL.DTWAIN_RotateImageString.restype = ct.c_void_p
     theDLL.DTWAIN_RotateImageStringA.restype = ct.c_void_p
     theDLL.DTWAIN_RotateImageStringW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectDefaultOCREngine.restype = ct.c_void_p
     theDLL.DTWAIN_SelectDefaultSource.restype = ct.c_void_p
     theDLL.DTWAIN_SelectDefaultSourceWithOpen.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2A.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2Ex.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2ExA.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2ExW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngine2W.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngineByName.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngineByNameA.restype = ct.c_void_p
     theDLL.DTWAIN_SelectOCREngineByNameW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2A.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2Ex.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2ExA.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2ExW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSource2W.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByName.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByNameA.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByNameW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByNameWithOpen.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByNameWithOpenA.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceByNameWithOpenW.restype = ct.c_void_p
     theDLL.DTWAIN_SelectSourceWithOpen.restype = ct.c_void_p
     theDLL.DTWAIN_SetAcquireArea.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireArea2.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireArea2String.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireArea2StringA.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireArea2StringW.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireImageNegative.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireImageScale.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireImageScaleString.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireImageScaleStringA.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireImageScaleStringW.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireStripBuffer.restype = ct.c_long
     theDLL.DTWAIN_SetAcquireStripSize.restype = ct.c_long
     theDLL.DTWAIN_SetAlarmVolume.restype = ct.c_long
     theDLL.DTWAIN_SetAlarms.restype = ct.c_long
     theDLL.DTWAIN_SetAllCapsToDefault.restype = ct.c_long
     theDLL.DTWAIN_SetAppInfo.restype = ct.c_long
     theDLL.DTWAIN_SetAppInfoA.restype = ct.c_long
     theDLL.DTWAIN_SetAppInfoW.restype = ct.c_long
     theDLL.DTWAIN_SetAuthor.restype = ct.c_long
     theDLL.DTWAIN_SetAuthorA.restype = ct.c_long
     theDLL.DTWAIN_SetAuthorW.restype = ct.c_long
     theDLL.DTWAIN_SetAvailablePrinters.restype = ct.c_long
     theDLL.DTWAIN_SetAvailablePrintersArray.restype = ct.c_long
     theDLL.DTWAIN_SetBarcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_SetBarcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_SetBarcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_SetBarcodeSearchMode.restype = ct.c_long
     theDLL.DTWAIN_SetBarcodeTimeOut.restype = ct.c_long
     theDLL.DTWAIN_SetBitDepth.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetection.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionEx.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionExString.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionExStringA.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionExStringW.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionString.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionStringA.restype = ct.c_long
     theDLL.DTWAIN_SetBlankPageDetectionStringW.restype = ct.c_long
     theDLL.DTWAIN_SetBrightness.restype = ct.c_long
     theDLL.DTWAIN_SetBrightnessString.restype = ct.c_long
     theDLL.DTWAIN_SetBrightnessStringA.restype = ct.c_long
     theDLL.DTWAIN_SetBrightnessStringW.restype = ct.c_long
     theDLL.DTWAIN_SetBufferedTileMode.restype = ct.c_long
     theDLL.DTWAIN_SetCallback.restype = theDLL.SETCALLBACK_TYPE
     theDLL.DTWAIN_SetCallback64.restype = theDLL.SETCALLBACK64_TYPE
     theDLL.DTWAIN_SetCamera.restype = ct.c_long
     theDLL.DTWAIN_SetCameraA.restype = ct.c_long
     theDLL.DTWAIN_SetCameraW.restype = ct.c_long
     theDLL.DTWAIN_SetCapValues.restype = ct.c_long
     theDLL.DTWAIN_SetCapValuesEx.restype = ct.c_long
     theDLL.DTWAIN_SetCapValuesEx2.restype = ct.c_long
     theDLL.DTWAIN_SetCaption.restype = ct.c_long
     theDLL.DTWAIN_SetCaptionA.restype = ct.c_long
     theDLL.DTWAIN_SetCaptionW.restype = ct.c_long
     theDLL.DTWAIN_SetCompressionType.restype = ct.c_long
     theDLL.DTWAIN_SetContrast.restype = ct.c_long
     theDLL.DTWAIN_SetContrastString.restype = ct.c_long
     theDLL.DTWAIN_SetContrastStringA.restype = ct.c_long
     theDLL.DTWAIN_SetContrastStringW.restype = ct.c_long
     theDLL.DTWAIN_SetCountry.restype = ct.c_long
     theDLL.DTWAIN_SetCurrentRetryCount.restype = ct.c_long
     theDLL.DTWAIN_SetCustomDSData.restype = ct.c_long
     theDLL.DTWAIN_SetDSMSearchOrder.restype = ct.c_long
     theDLL.DTWAIN_SetDSMSearchOrderEx.restype = ct.c_long
     theDLL.DTWAIN_SetDSMSearchOrderExA.restype = ct.c_long
     theDLL.DTWAIN_SetDSMSearchOrderExW.restype = ct.c_long
     theDLL.DTWAIN_SetDefaultSource.restype = ct.c_long
     theDLL.DTWAIN_SetDeviceNotifications.restype = ct.c_long
     theDLL.DTWAIN_SetDeviceTimeDate.restype = ct.c_long
     theDLL.DTWAIN_SetDeviceTimeDateA.restype = ct.c_long
     theDLL.DTWAIN_SetDeviceTimeDateW.restype = ct.c_long
     theDLL.DTWAIN_SetDoubleFeedDetectLength.restype = ct.c_long
     theDLL.DTWAIN_SetDoubleFeedDetectLengthString.restype = ct.c_long
     theDLL.DTWAIN_SetDoubleFeedDetectLengthStringA.restype = ct.c_long
     theDLL.DTWAIN_SetDoubleFeedDetectLengthStringW.restype = ct.c_long
     theDLL.DTWAIN_SetDoubleFeedDetectValues.restype = ct.c_long
     theDLL.DTWAIN_SetDoublePageCountOnDuplex.restype = ct.c_long
     theDLL.DTWAIN_SetEOJDetectValue.restype = ct.c_long
     theDLL.DTWAIN_SetErrorBufferThreshold.restype = ct.c_long
     theDLL.DTWAIN_SetErrorCallback.restype = ct.c_long
     theDLL.DTWAIN_SetErrorCallback64.restype = ct.c_long
     theDLL.DTWAIN_SetFeederAlignment.restype = ct.c_long
     theDLL.DTWAIN_SetFeederOrder.restype = ct.c_long
     theDLL.DTWAIN_SetFeederWaitTime.restype = ct.c_long
     theDLL.DTWAIN_SetFileAutoIncrement.restype = ct.c_long
     theDLL.DTWAIN_SetFileCompressionType.restype = ct.c_long
     theDLL.DTWAIN_SetFileSavePos.restype = ct.c_long
     theDLL.DTWAIN_SetFileSavePosA.restype = ct.c_long
     theDLL.DTWAIN_SetFileSavePosW.restype = ct.c_long
     theDLL.DTWAIN_SetFileXferFormat.restype = ct.c_long
     theDLL.DTWAIN_SetHalftone.restype = ct.c_long
     theDLL.DTWAIN_SetHalftoneA.restype = ct.c_long
     theDLL.DTWAIN_SetHalftoneW.restype = ct.c_long
     theDLL.DTWAIN_SetHighlight.restype = ct.c_long
     theDLL.DTWAIN_SetHighlightString.restype = ct.c_long
     theDLL.DTWAIN_SetHighlightStringA.restype = ct.c_long
     theDLL.DTWAIN_SetHighlightStringW.restype = ct.c_long
     theDLL.DTWAIN_SetJobControl.restype = ct.c_long
     theDLL.DTWAIN_SetJpegValues.restype = ct.c_long
     theDLL.DTWAIN_SetJpegXRValues.restype = ct.c_long
     theDLL.DTWAIN_SetLanguage.restype = ct.c_long
     theDLL.DTWAIN_SetLastError.restype = ct.c_long
     theDLL.DTWAIN_SetLightPath.restype = ct.c_long
     theDLL.DTWAIN_SetLightPathEx.restype = ct.c_long
     theDLL.DTWAIN_SetLightSource.restype = ct.c_long
     theDLL.DTWAIN_SetLightSources.restype = ct.c_long
     theDLL.DTWAIN_SetLogSaveThreshold.restype = ct.c_long
     theDLL.DTWAIN_SetLoggerCallback.restype = ct.c_long
     theDLL.DTWAIN_SetLoggerCallbackA.restype = ct.c_long
     theDLL.DTWAIN_SetLoggerCallbackW.restype = ct.c_long
     theDLL.DTWAIN_SetManualDuplexMode.restype = ct.c_long
     theDLL.DTWAIN_SetMaxAcquisitions.restype = ct.c_long
     theDLL.DTWAIN_SetMaxBuffers.restype = ct.c_long
     theDLL.DTWAIN_SetMaxRetryAttempts.restype = ct.c_long
     theDLL.DTWAIN_SetMultipageScanMode.restype = ct.c_long
     theDLL.DTWAIN_SetNoiseFilter.restype = ct.c_long
     theDLL.DTWAIN_SetOCRCapValues.restype = ct.c_long
     theDLL.DTWAIN_SetOrientation.restype = ct.c_long
     theDLL.DTWAIN_SetOverscan.restype = ct.c_long
     theDLL.DTWAIN_SetPDFAESEncryption.restype = ct.c_long
     theDLL.DTWAIN_SetPDFASCIICompression.restype = ct.c_long
     theDLL.DTWAIN_SetPDFAuthor.restype = ct.c_long
     theDLL.DTWAIN_SetPDFAuthorA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFAuthorW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFCompression.restype = ct.c_long
     theDLL.DTWAIN_SetPDFCreator.restype = ct.c_long
     theDLL.DTWAIN_SetPDFCreatorA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFCreatorW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFEncryption.restype = ct.c_long
     theDLL.DTWAIN_SetPDFEncryptionA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFEncryptionW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFJpegQuality.restype = ct.c_long
     theDLL.DTWAIN_SetPDFKeywords.restype = ct.c_long
     theDLL.DTWAIN_SetPDFKeywordsA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFKeywordsW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFOCRConversion.restype = ct.c_long
     theDLL.DTWAIN_SetPDFOCRMode.restype = ct.c_long
     theDLL.DTWAIN_SetPDFOrientation.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageScale.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageScaleString.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageScaleStringA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageScaleStringW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageSize.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageSizeString.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageSizeStringA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPageSizeStringW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFPolarity.restype = ct.c_long
     theDLL.DTWAIN_SetPDFProducer.restype = ct.c_long
     theDLL.DTWAIN_SetPDFProducerA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFProducerW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFSubject.restype = ct.c_long
     theDLL.DTWAIN_SetPDFSubjectA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFSubjectW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementFloat.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementFloatString.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementFloatStringA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementFloatStringW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementLong.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementString.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementStringA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTextElementStringW.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTitle.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTitleA.restype = ct.c_long
     theDLL.DTWAIN_SetPDFTitleW.restype = ct.c_long
     theDLL.DTWAIN_SetPaperSize.restype = ct.c_long
     theDLL.DTWAIN_SetPatchcodeMaxPriorities.restype = ct.c_long
     theDLL.DTWAIN_SetPatchcodeMaxRetries.restype = ct.c_long
     theDLL.DTWAIN_SetPatchcodePriorities.restype = ct.c_long
     theDLL.DTWAIN_SetPatchcodeSearchMode.restype = ct.c_long
     theDLL.DTWAIN_SetPatchcodeTimeOut.restype = ct.c_long
     theDLL.DTWAIN_SetPixelFlavor.restype = ct.c_long
     theDLL.DTWAIN_SetPixelType.restype = ct.c_long
     theDLL.DTWAIN_SetPostScriptTitle.restype = ct.c_long
     theDLL.DTWAIN_SetPostScriptTitleA.restype = ct.c_long
     theDLL.DTWAIN_SetPostScriptTitleW.restype = ct.c_long
     theDLL.DTWAIN_SetPostScriptType.restype = ct.c_long
     theDLL.DTWAIN_SetPrinter.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterEx.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterStartNumber.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterStringMode.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterStrings.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterSuffixString.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterSuffixStringA.restype = ct.c_long
     theDLL.DTWAIN_SetPrinterSuffixStringW.restype = ct.c_long
     theDLL.DTWAIN_SetQueryCapSupport.restype = ct.c_long
     theDLL.DTWAIN_SetResolution.restype = ct.c_long
     theDLL.DTWAIN_SetResolutionString.restype = ct.c_long
     theDLL.DTWAIN_SetResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_SetResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_SetResourcePath.restype = ct.c_long
     theDLL.DTWAIN_SetResourcePathA.restype = ct.c_long
     theDLL.DTWAIN_SetResourcePathW.restype = ct.c_long
     theDLL.DTWAIN_SetRotation.restype = ct.c_long
     theDLL.DTWAIN_SetRotationString.restype = ct.c_long
     theDLL.DTWAIN_SetRotationStringA.restype = ct.c_long
     theDLL.DTWAIN_SetRotationStringW.restype = ct.c_long
     theDLL.DTWAIN_SetSaveFileName.restype = ct.c_long
     theDLL.DTWAIN_SetSaveFileNameA.restype = ct.c_long
     theDLL.DTWAIN_SetSaveFileNameW.restype = ct.c_long
     theDLL.DTWAIN_SetShadow.restype = ct.c_long
     theDLL.DTWAIN_SetShadowString.restype = ct.c_long
     theDLL.DTWAIN_SetShadowStringA.restype = ct.c_long
     theDLL.DTWAIN_SetShadowStringW.restype = ct.c_long
     theDLL.DTWAIN_SetSourceUnit.restype = ct.c_long
     theDLL.DTWAIN_SetTIFFCompressType.restype = ct.c_long
     theDLL.DTWAIN_SetTIFFInvert.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectory.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectoryA.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectoryEx.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectoryExA.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectoryExW.restype = ct.c_long
     theDLL.DTWAIN_SetTempFileDirectoryW.restype = ct.c_long
     theDLL.DTWAIN_SetThreshold.restype = ct.c_long
     theDLL.DTWAIN_SetThresholdString.restype = ct.c_long
     theDLL.DTWAIN_SetThresholdStringA.restype = ct.c_long
     theDLL.DTWAIN_SetThresholdStringW.restype = ct.c_long
     theDLL.DTWAIN_SetTwainDSM.restype = ct.c_long
     theDLL.DTWAIN_SetTwainLog.restype = ct.c_long
     theDLL.DTWAIN_SetTwainLogA.restype = ct.c_long
     theDLL.DTWAIN_SetTwainLogW.restype = ct.c_long
     theDLL.DTWAIN_SetTwainMode.restype = ct.c_long
     theDLL.DTWAIN_SetTwainTimeout.restype = ct.c_long
     theDLL.DTWAIN_SetUpdateDibProc.restype = theDLL.DIBUPDATEPROC_TYPE
     theDLL.DTWAIN_SetXResolution.restype = ct.c_long
     theDLL.DTWAIN_SetXResolutionString.restype = ct.c_long
     theDLL.DTWAIN_SetXResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_SetXResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_SetYResolution.restype = ct.c_long
     theDLL.DTWAIN_SetYResolutionString.restype = ct.c_long
     theDLL.DTWAIN_SetYResolutionStringA.restype = ct.c_long
     theDLL.DTWAIN_SetYResolutionStringW.restype = ct.c_long
     theDLL.DTWAIN_ShowUIOnly.restype = ct.c_long
     theDLL.DTWAIN_ShutdownOCREngine.restype = ct.c_long
     theDLL.DTWAIN_SkipImageInfoError.restype = ct.c_long
     theDLL.DTWAIN_StartThread.restype = ct.c_long
     theDLL.DTWAIN_StartTwainSession.restype = ct.c_long
     theDLL.DTWAIN_StartTwainSessionA.restype = ct.c_long
     theDLL.DTWAIN_StartTwainSessionW.restype = ct.c_long
     theDLL.DTWAIN_SysDestroy.restype = ct.c_long
     theDLL.DTWAIN_SysInitialize.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeEx.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeEx2.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeEx2A.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeEx2W.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeExA.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeExW.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLib.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibEx.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibEx2.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibEx2A.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibEx2W.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibExA.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeLibExW.restype = ct.c_void_p
     theDLL.DTWAIN_SysInitializeNoBlocking.restype = ct.c_void_p
     theDLL.DTWAIN_TestGetCap.restype = ct.c_void_p
     theDLL.DTWAIN_UnlockMemory.restype = ct.c_long
     theDLL.DTWAIN_UnlockMemoryEx.restype = ct.c_long
     theDLL.DTWAIN_UpdateCurrentAcquiredImage.restype = ct.c_long
     theDLL.DTWAIN_UseMultipleThreads.restype = ct.c_long

     #set up the argument types
     theDLL.DTWAIN_AcquireAudioFile.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireAudioFileA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireAudioFileW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireAudioNative.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireAudioNativeEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireBuffered.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireBufferedEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireFile.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireFileA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireFileEx.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireFileW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireNative.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireNativeEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AcquireToClipboard.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_AddExtImageInfoQuery.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_AddPDFText.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_ulong]
     theDLL.DTWAIN_AddPDFTextA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_ulong]
     theDLL.DTWAIN_AddPDFTextElement.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_AddPDFTextEx.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_long]
     theDLL.DTWAIN_AddPDFTextExA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_long]
     theDLL.DTWAIN_AddPDFTextExW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_long]
     theDLL.DTWAIN_AddPDFTextString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_ulong]
     theDLL.DTWAIN_AddPDFTextStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_ulong]
     theDLL.DTWAIN_AddPDFTextStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_ulong]
     theDLL.DTWAIN_AddPDFTextW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_double, ct.c_long, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_ulong]
     theDLL.DTWAIN_AllocateMemory.argtypes = [ct.c_ulong]
     theDLL.DTWAIN_AllocateMemory64.argtypes = [ct.c_uint64]
     theDLL.DTWAIN_AllocateMemoryEx.argtypes = [ct.c_ulong]
     theDLL.DTWAIN_AppHandlesExceptions.argtypes = [ct.c_long]
     theDLL.DTWAIN_ArrayANSIStringToFloat.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayAdd.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ArrayAddANSIString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayAddANSIStringN.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddFloat.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_ArrayAddFloatN.argtypes = [ct.c_void_p, ct.c_double, ct.c_long]
     theDLL.DTWAIN_ArrayAddFloatString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayAddFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayAddFloatStringN.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddFloatStringNA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddFloatStringNW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayAddFrame.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ArrayAddFrameN.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddLong.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddLong64.argtypes = [ct.c_void_p, ct.c_int64]
     theDLL.DTWAIN_ArrayAddLong64N.argtypes = [ct.c_void_p, ct.c_int64, ct.c_long]
     theDLL.DTWAIN_ArrayAddLongN.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayAddN.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayAddStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayAddStringN.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddStringNA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddStringNW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayAddStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayAddWideString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayAddWideStringN.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayConvertFix32ToFloat.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayConvertFloatToFix32.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayCopy.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ArrayCreate.argtypes = [ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayCreateCopy.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayCreateFromCap.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayCreateFromLong64s.argtypes = [ct.POINTER(ct.c_int64), ct.c_long]
     theDLL.DTWAIN_ArrayCreateFromLongs.argtypes = [ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_ArrayCreateFromReals.argtypes = [ct.POINTER(ct.c_double), ct.c_long]
     theDLL.DTWAIN_ArrayDestroy.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayDestroyFrames.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayDumpToLog.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayFind.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ArrayFindANSIString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayFindFloat.argtypes = [ct.c_void_p, ct.c_double, ct.c_double]
     theDLL.DTWAIN_ArrayFindFloatString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayFindFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayFindFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayFindLong.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayFindLong64.argtypes = [ct.c_void_p, ct.c_int64]
     theDLL.DTWAIN_ArrayFindString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayFindStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayFindStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayFindWideString.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayFix32GetAt.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_ArrayFix32SetAt.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayFloatToANSIString.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayFloatToString.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayFloatToWideString.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayGetAt.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArrayGetAtANSIString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtANSIStringPtr.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtFloat.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_ArrayGetAtFloatEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtFrame.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_ArrayGetAtFrameEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArrayGetAtFrameString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtFrameStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtFrameStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtLong.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_ArrayGetAtLong64.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_int64)]
     theDLL.DTWAIN_ArrayGetAtLong64Ex.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtLongEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtSource.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_ArrayGetAtSourceEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayGetAtStringPtr.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetAtStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtWideString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayGetAtWideStringPtr.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetBuffer.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetCapValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayGetCapValuesEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayGetCapValuesEx2.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayGetCount.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayGetMaxStringLength.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayGetSourceAt.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_ArrayGetStringLength.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayGetType.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayInsertAt.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArrayInsertAtANSIString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayInsertAtANSIStringN.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtFloat.argtypes = [ct.c_void_p, ct.c_long, ct.c_double]
     theDLL.DTWAIN_ArrayInsertAtFloatN.argtypes = [ct.c_void_p, ct.c_long, ct.c_double, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayInsertAtFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayInsertAtFloatStringN.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtFloatStringNA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtFloatStringNW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayInsertAtFrame.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArrayInsertAtFrameN.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtLong64.argtypes = [ct.c_void_p, ct.c_long, ct.c_int64]
     theDLL.DTWAIN_ArrayInsertAtLong64N.argtypes = [ct.c_void_p, ct.c_long, ct.c_int64, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtLongN.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtN.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayInsertAtStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArrayInsertAtStringN.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtStringNA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtStringNW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayInsertAtStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayInsertAtWideString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayInsertAtWideStringN.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ArrayRemoveAll.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayRemoveAt.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArrayRemoveAtN.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArrayResize.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ArraySetAt.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArraySetAtANSIString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtFloat.argtypes = [ct.c_void_p, ct.c_long, ct.c_double]
     theDLL.DTWAIN_ArraySetAtFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArraySetAtFrame.argtypes = [ct.c_void_p, ct.c_long, ct.c_double, ct.c_double, ct.c_double, ct.c_double]
     theDLL.DTWAIN_ArraySetAtFrameEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_ArraySetAtFrameString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtFrameStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtFrameStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_ArraySetAtLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ArraySetAtLong64.argtypes = [ct.c_void_p, ct.c_long, ct.c_int64]
     theDLL.DTWAIN_ArraySetAtString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_ArraySetAtStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArraySetAtWideString.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_ArrayStringToFloat.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ArrayWideStringToFloat.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_CallCallback.argtypes = [ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_CallCallback64.argtypes = [ct.c_long, ct.c_long, ct.c_int64]
     theDLL.DTWAIN_CallDSMProc.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_CheckHandles.argtypes = [ct.c_long]
     theDLL.DTWAIN_ClearBuffers.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ClearPDFTextElements.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ClearPage.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_CloseSource.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_CloseSourceUI.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ConvertDIBToBitmap.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ConvertDIBToFullBitmap.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ConvertToAPIString.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_ConvertToAPIStringA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_ConvertToAPIStringEx.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ConvertToAPIStringExA.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_ConvertToAPIStringExW.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_ConvertToAPIStringW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_CreatePDFTextElementCopy.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_DeleteDIB.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_DestroyAcquisitionArray.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_DestroyPDFTextElement.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_DisableAppWindow.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoBorderDetect.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoBright.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoDeskew.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoFeed.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoRotate.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutoScan.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableAutomaticSenseMedium.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableBarcodeDetection.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableDuplex.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableFeeder.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableGetMessageLoop.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableGetMessageLoopDetection.argtypes = [ct.c_long]
     theDLL.DTWAIN_EnableIndicator.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableJobFileHandling.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableLamp.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableMsgNotify.argtypes = [ct.c_long]
     theDLL.DTWAIN_EnablePatchcodeDetection.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnablePeekMessageLoop.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnablePrinter.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableThumbnail.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnableTripletsNotify.argtypes = [ct.c_long]
     theDLL.DTWAIN_EndThread.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumAlarmVolumes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumAlarmVolumesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumAlarms.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumAlarmsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumAudioXferMechs.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumAudioXferMechsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumAutoFeedValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumAutoFeedValuesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumAutomaticCaptures.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumAutomaticCapturesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumAutomaticSenseMedium.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumAutomaticSenseMediumEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodeCodes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodeCodesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodeMaxPriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodeMaxPrioritiesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodeMaxRetries.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodeMaxRetriesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodePriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodePrioritiesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodeSearchModes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodeSearchModesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBarcodeTimeOutValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBarcodeTimeOutValuesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBitDepths.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBitDepthsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBitDepthsEx2.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumBottomCameras.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumBottomCamerasEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumBrightnessValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumBrightnessValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumCameras.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumCamerasEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumCamerasEx2.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumCapLabels.argtypes = [ct.c_long]
     theDLL.DTWAIN_EnumCompressionTypes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumCompressionTypesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumCompressionTypesEx2.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_EnumContrastValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumContrastValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumCustomCaps.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumCustomCapsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumDoubleFeedDetectLengths.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumDoubleFeedDetectLengthsEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumDoubleFeedDetectValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumDoubleFeedDetectValuesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumExtImageInfoTypes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumExtImageInfoTypesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumExtendedCaps.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumExtendedCapsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumExtendedCapsEx2.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumFileTypeBitsPerPixel.argtypes = [ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumFileXferFormats.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumFileXferFormatsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumHalftones.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumHalftonesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumHighlightValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumHighlightValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumJobControls.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumJobControlsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumLightPaths.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumLightPathsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumLightSources.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumLightSourcesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumMaxBuffers.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumMaxBuffersEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumNoiseFilters.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumNoiseFiltersEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumOCRInterfaces.argtypes = [ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumOCRSupportedCaps.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumOrientations.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumOrientationsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumOverscanValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumOverscanValuesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPaperSizes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPaperSizesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodeCodes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodeCodesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodeMaxPriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodeMaxPrioritiesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodeMaxRetries.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodeMaxRetriesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodePriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodePrioritiesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodeSearchModes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodeSearchModesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPatchcodeTimeOutValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPatchcodeTimeOutValuesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPixelTypes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPixelTypesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumPrinterStringModes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumPrinterStringModesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumResolutionValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumResolutionValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumShadowValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumShadowValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumSourceUnits.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumSourceUnitsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumSourceValues.argtypes = [ct.c_void_p, ct.c_char_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumSourceValuesA.argtypes = [ct.c_void_p, ct.c_char_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumSourceValuesW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumSources.argtypes = [ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumSupportedCaps.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumSupportedCapsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumSupportedCapsEx2.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumSupportedExtImageInfo.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumSupportedExtImageInfoEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumThresholdValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumThresholdValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumTopCameras.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumTopCamerasEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumTwainPrinters.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_EnumTwainPrintersEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_EnumXResolutionValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumXResolutionValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_EnumYResolutionValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p), ct.c_long]
     theDLL.DTWAIN_EnumYResolutionValuesEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_ExecuteOCR.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ExecuteOCRA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_ExecuteOCRW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_FeedPage.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FlipBitmap.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FlushAcquiredPages.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FrameCreate.argtypes = [ct.c_double, ct.c_double, ct.c_double, ct.c_double]
     theDLL.DTWAIN_FrameCreateString.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_FrameCreateStringA.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_FrameCreateStringW.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_FrameDestroy.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FrameGetAll.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_FrameGetAllString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_FrameGetAllStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_FrameGetAllStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_FrameGetValue.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_FrameGetValueString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_FrameGetValueStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_FrameGetValueStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_FrameIsValid.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FrameSetAll.argtypes = [ct.c_void_p, ct.c_double, ct.c_double, ct.c_double, ct.c_double]
     theDLL.DTWAIN_FrameSetAllString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_FrameSetAllStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_FrameSetAllStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_FrameSetValue.argtypes = [ct.c_void_p, ct.c_long, ct.c_double]
     theDLL.DTWAIN_FrameSetValueString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_FrameSetValueStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_FrameSetValueStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_FreeExtImageInfo.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FreeMemory.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_FreeMemoryEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetAPIHandleStatus.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetAcquireArea.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetAcquireArea2.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAcquireArea2String.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAcquireArea2StringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAcquireArea2StringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAcquireAreaEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetAcquireMetrics.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAcquireStripBuffer.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetAcquireStripData.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong)]
     theDLL.DTWAIN_GetAcquireStripSizes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong)]
     theDLL.DTWAIN_GetAcquiredImage.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetAcquiredImageArray.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetAcquisitionArray.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetActiveDSMPath.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetActiveDSMPathA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetActiveDSMPathW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetActiveDSMVersionInfo.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetActiveDSMVersionInfoA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetActiveDSMVersionInfoW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetAlarmVolume.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetAllSourceDibs.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetAppInfo.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_GetAppInfoA.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_GetAppInfoW.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetAuthor.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetAuthorA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetAuthorW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetBarcodeMaxPriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetBarcodeMaxRetries.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetBarcodePriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetBarcodeSearchMode.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetBarcodeTimeOut.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetBatteryMinutes.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetBatteryPercent.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetBitDepth.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetBitDepthEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetBlankPageAutoDetection.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetBrightness.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetBrightnessEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetBrightnessString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetBrightnessStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetBrightnessStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetBufferedTransferInfo.argtypes = [ct.c_void_p, ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong), ct.POINTER(ct.c_ulong)]
     theDLL.DTWAIN_GetCapArrayType.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetCapContainer.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetCapContainerEx.argtypes = [ct.c_long, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetCapContainerEx2.argtypes = [ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetCapDataType.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetCapFromName.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_GetCapFromNameA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_GetCapFromNameW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_GetCapHelp.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetCapHelpA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetCapHelpW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetCapLabel.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetCapLabelA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetCapLabelW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetCapOperations.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetCapOperationsEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetCapValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetCapValuesEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetCapValuesEx2.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetCaption.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetCaptionA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetCaptionW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetCompressionSize.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetCompressionType.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetCompressionTypeEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetConditionCodeString.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetConditionCodeStringA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetConditionCodeStringW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetConstantFromTwainName.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_GetConstantFromTwainNameA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_GetConstantFromTwainNameW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_GetContrast.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetContrastEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetContrastString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetContrastStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetContrastStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetCurrentAcquiredImage.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetCurrentFileName.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetCurrentFileNameA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetCurrentFileNameW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetCurrentPageNum.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetCurrentRetryCount.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetCurrentTwainTriplet.argtypes = [ct.POINTER(TW_IDENTITY), ct.POINTER(TW_IDENTITY), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_int64)]
     theDLL.DTWAIN_GetCustomDSData.argtypes = [ct.c_void_p, ct.POINTER(ct.c_ubyte), ct.c_ulong, ct.POINTER(ct.c_ulong), ct.c_long]
     theDLL.DTWAIN_GetDSMFullName.argtypes = [ct.c_long, ct.c_char_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDSMFullNameA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDSMFullNameW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDSMSearchOrderEx.argtypes = [ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_GetDSMSearchOrderExA.argtypes = [ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_GetDSMSearchOrderExW.argtypes = [ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetDeviceEvent.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDeviceEventEx.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetDeviceEventInfo.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_GetDeviceNotifications.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDeviceTimeDate.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetDeviceTimeDateA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetDeviceTimeDateW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetDoubleFeedDetectLength.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.c_long]
     theDLL.DTWAIN_GetDoubleFeedDetectValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetDuplexType.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetDuplexTypeEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetErrorBuffer.argtypes = [ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetErrorString.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetErrorStringA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetErrorStringW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetExtCapFromName.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_GetExtCapFromNameA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_GetExtCapFromNameW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_GetExtImageInfo.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetExtImageInfoData.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetExtImageInfoDataEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetExtImageInfoItem.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetExtImageInfoItemEx.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetExtNameFromCap.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetExtNameFromCapA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetExtNameFromCapW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetFeederAlignment.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetFeederFuncs.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetFeederOrder.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetFeederWaitTime.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetFileCompressionType.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetFileSavePageCount.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetFileTypeExtensions.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetFileTypeExtensionsA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetFileTypeExtensionsW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetFileTypeName.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetFileTypeNameA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetFileTypeNameW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetHalftone.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetHalftoneA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetHalftoneW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetHighlight.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetHighlightString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetHighlightStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetHighlightStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetImageInfo.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_void_p), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetImageInfoString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_void_p), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetImageInfoStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_void_p), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetImageInfoStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_void_p), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetJobControl.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetJobControlEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetJpegValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetJpegXRValues.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetLibraryPath.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetLibraryPathA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetLibraryPathW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetLightPath.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetLightPathEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetLightSource.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetLightSources.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetLightSourcesEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetManualDuplexCount.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetMaxAcquisitions.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetMaxBuffers.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetMaxPagesToAcquire.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetMaxRetryAttempts.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetNameFromCap.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetNameFromCapA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetNameFromCapW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetNoiseFilter.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetNumAcquiredImages.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetNumAcquisitions.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetOCRCapValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetOCRErrorString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRErrorStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRErrorStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRLastError.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetOCRMajorMinorVersion.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetOCRManufacturer.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRManufacturerA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRManufacturerW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductFamily.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductFamilyA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductFamilyW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductName.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductNameA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRProductNameW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOCRText.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetOCRTextA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_long, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetOCRTextInfoFloat.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetOCRTextInfoFloatEx.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double), ct.c_long]
     theDLL.DTWAIN_GetOCRTextInfoHandle.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetOCRTextInfoLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetOCRTextInfoLongEx.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetOCRTextW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_long, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetOCRVersionInfo.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRVersionInfoA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetOCRVersionInfoW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetOrientation.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetOrientationEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetOverscan.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPDFTextElementFloat.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.c_long]
     theDLL.DTWAIN_GetPDFTextElementLong.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPDFTextElementString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetPDFTextElementStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetPDFTextElementStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetPDFType1FontName.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetPDFType1FontNameA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetPDFType1FontNameW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetPaperSize.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPaperSizeName.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetPaperSizeNameA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetPaperSizeNameW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetPatchcodeMaxPriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPatchcodeMaxRetries.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPatchcodePriorities.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetPatchcodeSearchMode.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPatchcodeTimeOut.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPixelFlavor.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetPixelType.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPrinter.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPrinterEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetPrinterStartNumber.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetPrinterStartNumberEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetPrinterStringMode.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_GetPrinterStringModeEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_GetPrinterStrings.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_GetPrinterStringsEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetPrinterSuffixString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetPrinterSuffixStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetPrinterSuffixStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetResolution.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetResolutionEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetResolutionString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetResourceString.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetResourceStringA.argtypes = [ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetResourceStringW.argtypes = [ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetRotation.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetRotationEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetRotationString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetRotationStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetRotationStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetSaveFileName.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSaveFileNameA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSaveFileNameW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSessionDetails.argtypes = [ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetSessionDetailsA.argtypes = [ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetSessionDetailsW.argtypes = [ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetShadow.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetShadowString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetShadowStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetShadowStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetShortVersionString.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetShortVersionStringA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetShortVersionStringW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceAcquisitions.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetSourceDetails.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetSourceDetailsA.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetSourceDetailsW.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_GetSourceID.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetSourceIDEx.argtypes = [ct.c_void_p, ct.POINTER(TW_IDENTITY)]
     theDLL.DTWAIN_GetSourceManufacturer.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceManufacturerA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceManufacturerW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductFamily.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductFamilyA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductFamilyW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductName.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductNameA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceProductNameW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceUnit.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetSourceUnitEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_GetSourceVersionInfo.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceVersionInfoA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetSourceVersionInfoW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetSourceVersionNumber.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetTempFileDirectory.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTempFileDirectoryA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTempFileDirectoryW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetThreshold.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetThresholdString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetThresholdStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetThresholdStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetTimeDate.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetTimeDateA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetTimeDateW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetTwainAppIDEx.argtypes = [ct.POINTER(TW_IDENTITY)]
     theDLL.DTWAIN_GetTwainAvailabilityEx.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTwainAvailabilityExA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTwainAvailabilityExW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstant.argtypes = [ct.c_long, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstantA.argtypes = [ct.c_long, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstantEx.argtypes = [ct.c_long, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstantExA.argtypes = [ct.c_long, ct.c_long, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstantExW.argtypes = [ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetTwainNameFromConstantW.argtypes = [ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetVersion.argtypes = [ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetVersionCopyright.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetVersionCopyrightA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetVersionCopyrightW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetVersionEx.argtypes = [ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_GetVersionInfo.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetVersionInfoA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetVersionInfoW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetVersionString.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetVersionStringA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetVersionStringW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetWindowsVersionInfo.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetWindowsVersionInfoA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_GetWindowsVersionInfoW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_GetXResolution.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetXResolutionString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetXResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetXResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_GetYResolution.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_GetYResolutionString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetYResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_GetYResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_InitExtImageInfo.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_InitImageFileAppend.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_InitImageFileAppendA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_InitImageFileAppendW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_IsAudioXferSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsAutoBorderDetectEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoBorderDetectSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoBrightEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoBrightSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoDeskewEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoDeskewSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoFeedEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoFeedSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoRotateEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoRotateSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutoScanEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutomaticSenseMediumEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsAutomaticSenseMediumSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsBarcodeCapsSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsBarcodeDetectionEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsBarcodeSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsBlankPageDetectionOn.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsBufferedTileModeOn.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsBufferedTileModeSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsCapSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsCompressionSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsCustomDSDataSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsDIBBlank.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_IsDIBBlankString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_IsDIBBlankStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_IsDIBBlankStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_IsDeviceEventSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsDeviceOnLine.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsDoubleFeedDetectLengthSupported.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_IsDoubleFeedDetectSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsDuplexEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsDuplexSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsExtImageInfoSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFeederEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFeederLoaded.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFeederSensitive.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFeederSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFileSystemSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsFileXferSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsGetMessageLoopEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldALastPageSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldALevelSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldAPrintFormatSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldAValueSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldBLastPageSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldBLevelSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldBPrintFormatSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldBValueSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldCLastPageSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldCLevelSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldCPrintFormatSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldCValueSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldDLastPageSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldDLevelSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldDPrintFormatSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldDValueSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldELastPageSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldELevelSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldEPrintFormatSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIAFieldEValueSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsImageAddressingSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIndicatorEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsIndicatorSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsJobControlSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsLampEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsLampSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsLightPathSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsLightSourceSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsMaxBuffersSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsMemFileXferSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsOCREngineActivated.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsOrientationSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsOverscanSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsPaperDetectable.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsPaperSizeSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsPatchcodeCapsSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsPatchcodeDetectionEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsPatchcodeSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsPeekMessageLoopEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsPixelTypeSupported.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsPrinterEnabled.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsPrinterSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsRotationSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSkipImageInfoError.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSourceAcquiring.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSourceAcquiringEx.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_IsSourceInUIOnlyMode.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSourceOpen.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSourceSelected.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsSourceValid.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsThumbnailEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsThumbnailSupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsTwainAvailableEx.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_IsTwainAvailableExA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_IsTwainAvailableExW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_IsUIControllable.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsUIEnabled.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_IsUIOnlySupported.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_LoadCustomStringResources.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_LoadCustomStringResourcesA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_LoadCustomStringResourcesEx.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_LoadCustomStringResourcesExA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_LoadCustomStringResourcesExW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_LoadCustomStringResourcesW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_LoadLanguageResource.argtypes = [ct.c_long]
     theDLL.DTWAIN_LockMemory.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_LockMemoryEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_LogMessage.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_LogMessageA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_LogMessageW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_MakeRGB.argtypes = [ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_OpenSource.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_OpenSourcesOnSelect.argtypes = [ct.c_long]
     theDLL.DTWAIN_RangeCreate.argtypes = [ct.c_long]
     theDLL.DTWAIN_RangeCreateFromCap.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_RangeDestroy.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_RangeExpand.argtypes = [ct.c_void_p, ct.POINTER(ct.c_void_p)]
     theDLL.DTWAIN_RangeExpandEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_RangeGetAll.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_RangeGetAllFloat.argtypes = [ct.c_void_p, ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double), ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_RangeGetAllFloatString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_RangeGetAllFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_RangeGetAllFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_RangeGetAllLong.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long), ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetCount.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_RangeGetExpValue.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_RangeGetExpValueFloat.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_RangeGetExpValueFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_RangeGetExpValueFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_RangeGetExpValueFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_RangeGetExpValueLong.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetNearestValue.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_RangeGetNearestValueFloat.argtypes = [ct.c_void_p, ct.c_double, ct.POINTER(ct.c_double), ct.c_long]
     theDLL.DTWAIN_RangeGetNearestValueFloatString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_RangeGetNearestValueFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_RangeGetNearestValueFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_RangeGetNearestValueLong.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long), ct.c_long]
     theDLL.DTWAIN_RangeGetPos.argtypes = [ct.c_void_p, ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetPosFloat.argtypes = [ct.c_void_p, ct.c_double, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetPosFloatString.argtypes = [ct.c_void_p, ct.c_char_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetPosFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetPosFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetPosLong.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeGetValue.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_RangeGetValueFloat.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_double)]
     theDLL.DTWAIN_RangeGetValueFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_RangeGetValueFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_RangeGetValueFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_RangeGetValueLong.argtypes = [ct.c_void_p, ct.c_long, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeIsValid.argtypes = [ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_RangeSetAll.argtypes = [ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_RangeSetAllFloat.argtypes = [ct.c_void_p, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_double]
     theDLL.DTWAIN_RangeSetAllFloatString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_RangeSetAllFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_RangeSetAllFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_RangeSetAllLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_RangeSetValue.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_RangeSetValueFloat.argtypes = [ct.c_void_p, ct.c_long, ct.c_double]
     theDLL.DTWAIN_RangeSetValueFloatString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_RangeSetValueFloatStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p]
     theDLL.DTWAIN_RangeSetValueFloatStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p]
     theDLL.DTWAIN_RangeSetValueLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_RemovePDFTextElement.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_ResetPDFTextElement.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_RewindPage.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_RotateImage.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_RotateImageString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_RotateImageStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_RotateImageStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SelectDefaultSourceWithOpen.argtypes = [ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2A.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2Ex.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2ExA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2ExW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SelectOCREngine2W.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectOCREngineByName.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SelectOCREngineByNameA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SelectOCREngineByNameW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SelectSource2.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectSource2A.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectSource2Ex.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SelectSource2ExA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SelectSource2ExW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SelectSource2W.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SelectSourceByName.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SelectSourceByNameA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SelectSourceByNameW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SelectSourceByNameWithOpen.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SelectSourceByNameWithOpenA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SelectSourceByNameWithOpenW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SelectSourceWithOpen.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetAcquireArea.argtypes = [ct.c_void_p, ct.c_long, ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetAcquireArea2.argtypes = [ct.c_void_p, ct.c_double, ct.c_double, ct.c_double, ct.c_double, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetAcquireArea2String.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetAcquireArea2StringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetAcquireArea2StringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetAcquireImageNegative.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetAcquireImageScale.argtypes = [ct.c_void_p, ct.c_double, ct.c_double]
     theDLL.DTWAIN_SetAcquireImageScaleString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetAcquireImageScaleStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetAcquireImageScaleStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetAcquireStripBuffer.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetAcquireStripSize.argtypes = [ct.c_void_p, ct.c_ulong]
     theDLL.DTWAIN_SetAlarmVolume.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetAlarms.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetAllCapsToDefault.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_SetAppInfo.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetAppInfoA.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetAppInfoW.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetAuthor.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetAuthorA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetAuthorW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetAvailablePrinters.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetAvailablePrintersArray.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetBarcodeMaxPriorities.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetBarcodeMaxRetries.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetBarcodePriorities.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetBarcodeSearchMode.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetBarcodeTimeOut.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetBitDepth.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetection.argtypes = [ct.c_void_p, ct.c_double, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionEx.argtypes = [ct.c_void_p, ct.c_double, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionExString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionExStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionExStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBlankPageDetectionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetBrightness.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetBrightnessString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetBrightnessStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetBrightnessStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetBufferedTileMode.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetCallback.argtypes = [theDLL.SETCALLBACK_TYPE, ct.c_long]
     theDLL.DTWAIN_SetCallback64.argtypes = [theDLL.SETCALLBACK64_TYPE, ct.c_int64]
     theDLL.DTWAIN_SetCamera.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetCameraA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetCameraW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetCapValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_SetCapValuesEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_SetCapValuesEx2.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_SetCaption.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetCaptionA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetCaptionW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetCompressionType.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetContrast.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetContrastString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetContrastStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetContrastStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetCountry.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetCurrentRetryCount.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetCustomDSData.argtypes = [ct.c_void_p, ct.c_void_p, ct.POINTER(ct.c_ubyte), ct.c_ulong, ct.c_long]
     theDLL.DTWAIN_SetDSMSearchOrder.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetDSMSearchOrderEx.argtypes = [ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetDSMSearchOrderExA.argtypes = [ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetDSMSearchOrderExW.argtypes = [ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetDefaultSource.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_SetDeviceNotifications.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetDeviceTimeDate.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetDeviceTimeDateA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetDeviceTimeDateW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetDoubleFeedDetectLength.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetDoubleFeedDetectLengthString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetDoubleFeedDetectLengthStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetDoubleFeedDetectLengthStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetDoubleFeedDetectValues.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetDoublePageCountOnDuplex.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetEOJDetectValue.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetErrorBufferThreshold.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetErrorCallback.argtypes = [theDLL.SETERRORPROC_TYPE, ct.c_long]
     theDLL.DTWAIN_SetErrorCallback64.argtypes = [theDLL.SETERRORPROC64_TYPE, ct.c_int64]
     theDLL.DTWAIN_SetFeederAlignment.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetFeederOrder.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetFeederWaitTime.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileAutoIncrement.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileCompressionType.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileSavePos.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileSavePosA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileSavePosW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetFileXferFormat.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetHalftone.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetHalftoneA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetHalftoneW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetHighlight.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetHighlightString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetHighlightStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetHighlightStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetJobControl.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetJpegValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetJpegXRValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetLanguage.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetLastError.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetLightPath.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetLightPathEx.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetLightSource.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetLightSources.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetLogSaveThreshold.argtypes = [ct.c_int64]
     theDLL.DTWAIN_SetLoggerCallback.argtypes = [theDLL.SETLOGGERPROC_TYPE, ct.c_int64]
     theDLL.DTWAIN_SetLoggerCallbackA.argtypes = [theDLL.SETLOGGERPROCA_TYPE, ct.c_int64]
     theDLL.DTWAIN_SetLoggerCallbackW.argtypes = [theDLL.SETLOGGERPROCW_TYPE, ct.c_int64]
     theDLL.DTWAIN_SetManualDuplexMode.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetMaxAcquisitions.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetMaxBuffers.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetMaxRetryAttempts.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetMultipageScanMode.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetNoiseFilter.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetOCRCapValues.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_void_p]
     theDLL.DTWAIN_SetOrientation.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetOverscan.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPDFAESEncryption.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPDFASCIICompression.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFAuthor.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFAuthorA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFAuthorW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFCompression.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFCreator.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFCreatorA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFCreatorW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFEncryption.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_ulong, ct.c_long]
     theDLL.DTWAIN_SetPDFEncryptionA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p, ct.c_ulong, ct.c_long]
     theDLL.DTWAIN_SetPDFEncryptionW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p, ct.c_ulong, ct.c_long]
     theDLL.DTWAIN_SetPDFJpegQuality.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFKeywords.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFKeywordsA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFKeywordsW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFOCRConversion.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPDFOCRMode.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFOrientation.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFPageScale.argtypes = [ct.c_void_p, ct.c_long, ct.c_double, ct.c_double]
     theDLL.DTWAIN_SetPDFPageScaleString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFPageScaleStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFPageScaleStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFPageSize.argtypes = [ct.c_void_p, ct.c_long, ct.c_double, ct.c_double]
     theDLL.DTWAIN_SetPDFPageSizeString.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFPageSizeStringA.argtypes = [ct.c_void_p, ct.c_long, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFPageSizeStringW.argtypes = [ct.c_void_p, ct.c_long, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFPolarity.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPDFProducer.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFProducerA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFProducerW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFSubject.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFSubjectA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFSubjectW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPDFTextElementFloat.argtypes = [ct.c_void_p, ct.c_double, ct.c_double, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementFloatString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementFloatStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementFloatStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementLong.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTextElementStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetPDFTitle.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFTitleA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPDFTitleW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPaperSize.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPatchcodeMaxPriorities.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPatchcodeMaxRetries.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPatchcodePriorities.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_SetPatchcodeSearchMode.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPatchcodeTimeOut.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPixelFlavor.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPixelType.argtypes = [ct.c_void_p, ct.c_long, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPostScriptTitle.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPostScriptTitleA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPostScriptTitleW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetPostScriptType.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPrinter.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPrinterEx.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPrinterStartNumber.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetPrinterStringMode.argtypes = [ct.c_void_p, ct.c_long, ct.c_long]
     theDLL.DTWAIN_SetPrinterStrings.argtypes = [ct.c_void_p, ct.c_void_p, ct.POINTER(ct.c_long)]
     theDLL.DTWAIN_SetPrinterSuffixString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPrinterSuffixStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetPrinterSuffixStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetQueryCapSupport.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetResolution.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetResolutionString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetResourcePath.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SetResourcePathA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SetResourcePathW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SetRotation.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetRotationString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetRotationStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetRotationStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetSaveFileName.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetSaveFileNameA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetSaveFileNameW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetShadow.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetShadowString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetShadowStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetShadowStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetSourceUnit.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetTIFFCompressType.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetTIFFInvert.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_SetTempFileDirectory.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SetTempFileDirectoryA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SetTempFileDirectoryEx.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetTempFileDirectoryExA.argtypes = [ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetTempFileDirectoryExW.argtypes = [ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetTempFileDirectoryW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SetThreshold.argtypes = [ct.c_void_p, ct.c_double, ct.c_long]
     theDLL.DTWAIN_SetThresholdString.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetThresholdStringA.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_long]
     theDLL.DTWAIN_SetThresholdStringW.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_long]
     theDLL.DTWAIN_SetTwainDSM.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetTwainLog.argtypes = [ct.c_ulong, ct.c_char_p]
     theDLL.DTWAIN_SetTwainLogA.argtypes = [ct.c_ulong, ct.c_char_p]
     theDLL.DTWAIN_SetTwainLogW.argtypes = [ct.c_ulong, ct.c_wchar_p]
     theDLL.DTWAIN_SetTwainMode.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetTwainTimeout.argtypes = [ct.c_long]
     theDLL.DTWAIN_SetUpdateDibProc.argtypes = [theDLL.DIBUPDATEPROC_TYPE]
     theDLL.DTWAIN_SetXResolution.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetXResolutionString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetXResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetXResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SetYResolution.argtypes = [ct.c_void_p, ct.c_double]
     theDLL.DTWAIN_SetYResolutionString.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetYResolutionStringA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SetYResolutionStringW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_ShowUIOnly.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_ShutdownOCREngine.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_SkipImageInfoError.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_StartThread.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_StartTwainSession.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_StartTwainSessionA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_StartTwainSessionW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeEx.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SysInitializeEx2.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SysInitializeEx2A.argtypes = [ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SysInitializeEx2W.argtypes = [ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeExA.argtypes = [ct.c_char_p]
     theDLL.DTWAIN_SysInitializeExW.argtypes = [ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeLib.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_SysInitializeLibEx.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SysInitializeLibEx2.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SysInitializeLibEx2A.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p]
     theDLL.DTWAIN_SysInitializeLibEx2W.argtypes = [ct.c_void_p, ct.c_wchar_p, ct.c_wchar_p, ct.c_wchar_p]
     theDLL.DTWAIN_SysInitializeLibExA.argtypes = [ct.c_void_p, ct.c_char_p]
     theDLL.DTWAIN_SysInitializeLibExW.argtypes = [ct.c_void_p, ct.c_wchar_p]
     theDLL.DTWAIN_TestGetCap.argtypes = [ct.c_void_p, ct.c_long]
     theDLL.DTWAIN_UnlockMemory.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_UnlockMemoryEx.argtypes = [ct.c_void_p]
     theDLL.DTWAIN_UpdateCurrentAcquiredImage.argtypes = [ct.c_void_p, ct.c_void_p]
     theDLL.DTWAIN_UseMultipleThreads.argtypes = [ct.c_long]
