Just for fun.

This commit is contained in:
soukoku
2014-04-11 23:16:33 -04:00
parent efe9b469ba
commit 55edb65608
2 changed files with 544 additions and 307 deletions

View File

@@ -7,280 +7,277 @@ namespace NTwain.Triplets
{ {
static partial class PInvoke static partial class PInvoke
{ {
// not sure if the signatures are correct yet static partial class NativeMethods
// so just a placeholder for now {
[DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
public static extern ReturnCode DsmEntryLinux(
[In, Out]TWIdentity origin,
[In, Out]TWIdentity destination,
DataGroups dg,
DataArgumentType dat,
Message msg,
ref IntPtr data);
//static partial class NativeMethods [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
//{ public static extern ReturnCode DsmEntryLinux(
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [In, Out]TWIdentity origin,
// public static extern ReturnCode DsmEntryLinux( [In, Out]TWIdentity destination,
// [In, Out]TWIdentity origin, DataGroups dg,
// [In, Out]TWIdentity destination, DataArgumentType dat,
// DataGroups dg, Message msg,
// DataArgumentType dat, ref DataGroups data);
// Message msg,
// ref IntPtr data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// ref DataGroups data); [In, Out]TWAudioInfo data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWAudioInfo data); [In, Out]TWCapability data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWCapability data); [In, Out]TWCustomDSData data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWCustomDSData data); [In, Out]TWDeviceEvent data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWDeviceEvent data); [In, Out]TWCallback data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWCallback data); [In, Out]TWCallback2 data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWCallback2 data); [In, Out]TWEntryPoint data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWEntryPoint data); [In, Out]TWEvent data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWEvent data); [In, Out]TWFileSystem data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, IntPtr zero,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWFileSystem data); [In, Out]TWIdentity data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// IntPtr zero, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWIdentity data); [In, Out]TWPassThru data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWPassThru data); [In, Out]TWPendingXfers data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWPendingXfers data); [In, Out]TWSetupFileXfer data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWSetupFileXfer data); [In, Out]TWSetupMemXfer data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWSetupMemXfer data); [In, Out]TWStatusUtf8 data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWStatusUtf8 data); [In, Out]TWUserInterface data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWUserInterface data); [In, Out]TWCieColor data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWCieColor data); [In, Out]TWExtImageInfo data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWExtImageInfo data); [In, Out]TWFilter data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWFilter data); [In, Out]TWGrayResponse data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWGrayResponse data); [In, Out]TWImageInfo data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWImageInfo data); [In, Out]TWImageLayout data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWImageLayout data); [In, Out]TWImageMemXfer data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWImageMemXfer data); [In, Out]TWJpegCompression data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWJpegCompression data); [In, Out]TWPalette8 data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWPalette8 data); [In, Out]TWRgbResponse data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWRgbResponse data); [In, Out]TWStatus data);
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")] [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux( public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
// DataGroups dg, DataGroups dg,
// DataArgumentType dat, DataArgumentType dat,
// Message msg, Message msg,
// [In, Out]TWStatus data); ref TWMemory data);
}
// [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "#1")]
// public static extern ReturnCode DsmEntryLinux(
// [In, Out]TWIdentity origin,
// [In, Out]TWIdentity destination,
// DataGroups dg,
// DataArgumentType dat,
// Message msg,
// ref TWMemory data);
//}
} }
} }

View File

@@ -21,7 +21,7 @@ namespace NTwain.Triplets
// 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 :(
public static readonly bool CanUseTwainDSM = CheckIfCanUseNewDSM(); public static readonly bool CanUseNewDSM = CheckIfCanUseNewDSM();
private static bool CheckIfCanUseNewDSM() private static bool CheckIfCanUseNewDSM()
{ {
@@ -47,9 +47,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
ref IntPtr data) ref IntPtr data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, dg, dat, msg, ref data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, dg, dat, msg, ref data); }
else { return NativeMethods.DsmEntry32(origin, destination, dg, dat, msg, ref data); } else { return NativeMethods.DsmEntry32(origin, destination, dg, dat, msg, ref data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, dg, dat, msg, ref data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
TWIdentity origin, TWIdentity origin,
@@ -59,9 +67,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
ref DataGroups data) ref DataGroups data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, dg, dat, msg, ref data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, dg, dat, msg, ref data); }
else { return NativeMethods.DsmEntry32(origin, destination, dg, dat, msg, ref data); } else { return NativeMethods.DsmEntry32(origin, destination, dg, dat, msg, ref data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, dg, dat, msg, ref data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
TWIdentity origin, TWIdentity origin,
@@ -69,9 +85,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWAudioInfo data) TWAudioInfo data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -80,9 +104,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWCapability data) TWCapability data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -91,9 +123,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWCustomDSData data) TWCustomDSData data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -102,9 +142,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWDeviceEvent data) TWDeviceEvent data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -113,9 +161,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWCallback data) TWCallback data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -124,9 +180,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWCallback2 data) TWCallback2 data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -135,9 +199,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWEntryPoint data) TWEntryPoint data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -146,9 +218,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWEvent data) TWEvent data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -157,18 +237,34 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWFileSystem data) TWFileSystem data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
TWIdentity origin, TWIdentity origin,
Message msg, Message msg,
TWIdentity data) TWIdentity data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
else { return NativeMethods.DsmEntry32(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); } else { return NativeMethods.DsmEntry32(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -177,9 +273,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWPassThru data) TWPassThru data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -188,9 +292,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWPendingXfers data) TWPendingXfers data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -199,9 +311,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWSetupFileXfer data) TWSetupFileXfer data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -210,9 +330,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWSetupMemXfer data) TWSetupMemXfer data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -221,9 +349,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWStatusUtf8 data) TWStatusUtf8 data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -232,9 +368,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWUserInterface data) TWUserInterface data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -243,9 +387,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWCieColor data) TWCieColor data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -254,9 +406,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWExtImageInfo data) TWExtImageInfo data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
TWIdentity origin, TWIdentity origin,
@@ -264,9 +424,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWFilter data) TWFilter data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
TWIdentity origin, TWIdentity origin,
@@ -274,9 +442,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWGrayResponse data) TWGrayResponse data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -285,9 +461,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWImageInfo data) TWImageInfo data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -296,9 +480,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWImageLayout data) TWImageLayout data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -307,9 +499,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWImageMemXfer data) TWImageMemXfer data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -318,9 +518,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWJpegCompression data) TWJpegCompression data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -329,9 +537,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWPalette8 data) TWPalette8 data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -340,9 +556,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWRgbResponse data) TWRgbResponse data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -351,9 +575,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
TWStatus data) TWStatus data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry( public static ReturnCode DsmEntry(
@@ -363,9 +595,17 @@ namespace NTwain.Triplets
Message msg, Message msg,
ref TWMemory data) ref TWMemory data)
{ {
if (CanUseTwainDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, dat, msg, ref data); } if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmEntry64(origin, destination, DataGroups.Control, dat, msg, ref data); }
else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, dat, msg, ref data); } else { return NativeMethods.DsmEntry32(origin, destination, DataGroups.Control, dat, msg, ref data); }
} }
else if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, dat, msg, ref data);
}
throw new PlatformNotSupportedException();
}
#endregion #endregion