mirror of
https://github.com/soukoku/ntwain.git
synced 2026-01-02 04:17:08 +08:00
Try to use twaindsm by default.
This commit is contained in:
@@ -2,28 +2,36 @@
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using NTwain.Data;
|
using NTwain.Data;
|
||||||
using NTwain.Values;
|
using NTwain.Values;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace NTwain.Triplets
|
namespace NTwain.Triplets
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Contains the full TWAIN entry signatures through pinvoke.
|
/// Contains the full TWAIN entry signatures through pinvoke.
|
||||||
/// These are called by all the defined triplets methods in
|
/// These are called by all the defined triplets methods in
|
||||||
/// this namespace.
|
/// this namespace.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static partial class PInvoke
|
static partial class PInvoke
|
||||||
{
|
{
|
||||||
// Change pinvoke base on where running in 64bit mode.
|
// Change pinvoke base on where running in 64bit mode.
|
||||||
// Theoretically [DllImport("twaindsm", EntryPoint = "#1")]
|
// Theoretically [DllImport("twaindsm", EntryPoint = "#1")]
|
||||||
// works on both 32 and 64 bit
|
// works on both 32 and 64 bit
|
||||||
// but it's not installed on either system by default.
|
// but it's not installed on either system by default.
|
||||||
// A proper 64 bit twain driver would've installed it so
|
// A proper 64 bit twain driver would've installed it so
|
||||||
// in essence it only exists in 64 bit systems and thus
|
// in essence it only exists in 64 bit systems and thus
|
||||||
// the 2 sets of identical pinvokes :(
|
// the 2 sets of identical pinvokes :(
|
||||||
// There's another way of doing own pinvoke at runtime but
|
|
||||||
// that's not easy to understand.
|
|
||||||
public static readonly bool Is64Bit = IntPtr.Size == 8;
|
|
||||||
|
|
||||||
// define sig for each different data type since "object" doesn't work
|
public static readonly bool CanUseTwainDSM = CheckIfCanUseNewDSM();
|
||||||
|
|
||||||
|
private static bool CheckIfCanUseNewDSM()
|
||||||
|
{
|
||||||
|
var path = Path.Combine(Environment.SystemDirectory, "twaindsm.dll");
|
||||||
|
// if 64bit or the dll exists use it
|
||||||
|
return IntPtr.Size == 8 ||
|
||||||
|
File.Exists(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// define sig for each different data type since "object" doesn't work
|
||||||
|
|
||||||
#region wrapped calls
|
#region wrapped calls
|
||||||
|
|
||||||
@@ -35,7 +43,7 @@ namespace NTwain.Triplets
|
|||||||
Message msg,
|
Message msg,
|
||||||
ref IntPtr data)
|
ref IntPtr data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, dg, dat, msg, ref data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, dg, dat, msg, ref data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, dg, dat, msg, ref data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, dg, dat, msg, ref data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,204 +55,204 @@ namespace NTwain.Triplets
|
|||||||
Message msg,
|
Message msg,
|
||||||
ref uint data)
|
ref uint data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, dg, dat, msg, ref data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, dg, dat, msg, ref data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, dg, dat, msg, ref data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, dg, dat, msg, ref data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWAudioInfo data)
|
TWAudioInfo data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWCapability data)
|
TWCapability data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWCustomDSData data)
|
TWCustomDSData data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWDeviceEvent data)
|
TWDeviceEvent data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWCallback data)
|
TWCallback data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWCallback2 data)
|
TWCallback2 data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWEntryPoint data)
|
TWEntryPoint data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWEvent data)
|
TWEvent data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWFileSystem data)
|
TWFileSystem data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWIdentity data)
|
TWIdentity data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWPassThru data)
|
TWPassThru data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWPendingXfers data)
|
TWPendingXfers data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWSetupFileXfer data)
|
TWSetupFileXfer data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWSetupMemXfer data)
|
TWSetupMemXfer data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWStatusUtf8 data)
|
TWStatusUtf8 data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWUserInterface data)
|
TWUserInterface data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWCieColor data)
|
TWCieColor data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWExtImageInfo data)
|
TWExtImageInfo data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
@@ -252,110 +260,110 @@ namespace NTwain.Triplets
|
|||||||
Message msg,
|
Message msg,
|
||||||
TWFilter data)
|
TWFilter data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWGrayResponse data)
|
TWGrayResponse data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWImageInfo data)
|
TWImageInfo data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWImageLayout data)
|
TWImageLayout data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWImageMemXfer data)
|
TWImageMemXfer data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWJpegCompression data)
|
TWJpegCompression data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWPalette8 data)
|
TWPalette8 data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWRgbResponse data)
|
TWRgbResponse data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
Message msg,
|
Message msg,
|
||||||
TWStatus data)
|
TWStatus data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ReturnCode DsmEntry(
|
public static ReturnCode DsmEntry(
|
||||||
TWIdentity origin,
|
TWIdentity origin,
|
||||||
TWIdentity destination,
|
TWIdentity destination,
|
||||||
DataArgumentType dat,
|
DataArgumentType dat,
|
||||||
Message msg,
|
Message msg,
|
||||||
ref TWMemory data)
|
ref TWMemory data)
|
||||||
{
|
{
|
||||||
if (Is64Bit) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, dat, msg, ref data); }
|
if (CanUseTwainDSM) { return WinNativeMethods.DsmEntry64(origin, destination, DataGroups.Control, dat, msg, ref data); }
|
||||||
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, dat, msg, ref data); }
|
else { return WinNativeMethods.DsmEntry32(origin, destination, DataGroups.Control, dat, msg, ref data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
|
|||||||
Reference in New Issue
Block a user