Updated internal pinvoke names.

This commit is contained in:
soukoku
2014-04-12 07:10:56 -04:00
parent 55edb65608
commit f13cffeee1
41 changed files with 800 additions and 797 deletions

View File

@@ -75,9 +75,9 @@
<Compile Include="Triplets\DGControl\DGControl.Callback2.cs" /> <Compile Include="Triplets\DGControl\DGControl.Callback2.cs" />
<Compile Include="Triplets\DGImage\DGImage.Filter.cs" /> <Compile Include="Triplets\DGImage\DGImage.Filter.cs" />
<Compile Include="Triplets\OpBase.cs" /> <Compile Include="Triplets\OpBase.cs" />
<Compile Include="Triplets\PInvoke.Linux.cs" /> <Compile Include="Triplets\Dsm.Linux.cs" />
<Compile Include="Triplets\PInvoke.Win32.cs" /> <Compile Include="Triplets\Dsm.WinOld.cs" />
<Compile Include="Triplets\PInvoke.Win64.cs" /> <Compile Include="Triplets\Dsm.WinNew.cs" />
<Compile Include="TwainSessionExtensions.cs" /> <Compile Include="TwainSessionExtensions.cs" />
<Compile Include="TwainSession.cs" /> <Compile Include="TwainSession.cs" />
<Compile Include="TwainSessionWPF.cs" /> <Compile Include="TwainSessionWPF.cs" />
@@ -121,7 +121,7 @@
<Compile Include="Triplets\DGImage\DGImage.JpegCompression.cs" /> <Compile Include="Triplets\DGImage\DGImage.JpegCompression.cs" />
<Compile Include="Triplets\DGImage\DGImage.Palette8.cs" /> <Compile Include="Triplets\DGImage\DGImage.Palette8.cs" />
<Compile Include="Triplets\DGImage\DGImage.RgbResponse.cs" /> <Compile Include="Triplets\DGImage\DGImage.RgbResponse.cs" />
<Compile Include="Triplets\PInvoke.cs" /> <Compile Include="Triplets\Dsm.cs" />
<Compile Include="TwainException.cs" /> <Compile Include="TwainException.cs" />
<Compile Include="TwainSessionOld.cs" /> <Compile Include="TwainSessionOld.cs" />
<Compile Include="Values\DataValues.cs" /> <Compile Include="Values\DataValues.cs" />

View File

@@ -18,7 +18,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(6, 6, DataGroups.Audio, DataArgumentType.AudioFileXfer, Message.Get); Session.VerifyState(6, 6, DataGroups.Audio, DataArgumentType.AudioFileXfer, Message.Get);
IntPtr z = IntPtr.Zero; IntPtr z = IntPtr.Zero;
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Audio, DataArgumentType.AudioFileXfer, Message.Get, ref z); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Audio, DataArgumentType.AudioFileXfer, Message.Get, ref z);
} }
} }
} }

View File

@@ -18,7 +18,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(6, 7, DataGroups.Audio, DataArgumentType.AudioInfo, Message.Get); Session.VerifyState(6, 7, DataGroups.Audio, DataArgumentType.AudioInfo, Message.Get);
info = new TWAudioInfo(); info = new TWAudioInfo();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, info); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, info);
} }
} }
} }

View File

@@ -21,7 +21,7 @@ namespace NTwain.Triplets
public ReturnCode Get(ref IntPtr handle) public ReturnCode Get(ref IntPtr handle)
{ {
Session.VerifyState(6, 6, DataGroups.Audio, DataArgumentType.AudioNativeXfer, Message.Get); Session.VerifyState(6, 6, DataGroups.Audio, DataArgumentType.AudioNativeXfer, Message.Get);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Audio, DataArgumentType.AudioNativeXfer, Message.Get, ref handle); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Audio, DataArgumentType.AudioNativeXfer, Message.Get, ref handle);
} }
} }
} }

View File

@@ -17,7 +17,7 @@ namespace NTwain.Triplets
public ReturnCode RegisterCallback(TWCallback callback) public ReturnCode RegisterCallback(TWCallback callback)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Callback, Message.RegisterCallback); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Callback, Message.RegisterCallback);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.RegisterCallback, callback); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.RegisterCallback, callback);
} }
} }
} }

View File

@@ -17,7 +17,7 @@ namespace NTwain.Triplets
public ReturnCode RegisterCallback(TWCallback2 callback) public ReturnCode RegisterCallback(TWCallback2 callback)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Callback, Message.RegisterCallback); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Callback, Message.RegisterCallback);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.RegisterCallback, callback); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.RegisterCallback, callback);
} }
} }
} }

View File

@@ -18,7 +18,7 @@ namespace NTwain.Triplets
public ReturnCode Get(TWCapability capability) public ReturnCode Get(TWCapability capability)
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Capability, Message.Get); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Capability, Message.Get);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, capability);
} }
/// <summary> /// <summary>
@@ -29,7 +29,7 @@ namespace NTwain.Triplets
public ReturnCode GetCurrent(TWCapability capability) public ReturnCode GetCurrent(TWCapability capability)
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Capability, Message.GetCurrent); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Capability, Message.GetCurrent);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetCurrent, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetCurrent, capability);
} }
/// <summary> /// <summary>
@@ -40,7 +40,7 @@ namespace NTwain.Triplets
public ReturnCode GetDefault(TWCapability capability) public ReturnCode GetDefault(TWCapability capability)
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Capability, Message.GetDefault); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Capability, Message.GetDefault);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, capability);
} }
/// <summary> /// <summary>
@@ -52,7 +52,7 @@ namespace NTwain.Triplets
public ReturnCode GetHelp(TWCapability capability) public ReturnCode GetHelp(TWCapability capability)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Capability, Message.GetHelp); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Capability, Message.GetHelp);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetHelp, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetHelp, capability);
} }
/// <summary> /// <summary>
@@ -64,7 +64,7 @@ namespace NTwain.Triplets
public ReturnCode GetLabel(TWCapability capability) public ReturnCode GetLabel(TWCapability capability)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Capability, Message.GetLabel); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Capability, Message.GetLabel);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetLabel, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetLabel, capability);
} }
/// <summary> /// <summary>
@@ -76,7 +76,7 @@ namespace NTwain.Triplets
public ReturnCode GetLabelEnum(TWCapability capability) public ReturnCode GetLabelEnum(TWCapability capability)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Capability, Message.GetLabelEnum); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Capability, Message.GetLabelEnum);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetLabelEnum, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetLabelEnum, capability);
} }
/// <summary> /// <summary>
@@ -87,7 +87,7 @@ namespace NTwain.Triplets
public ReturnCode QuerySupport(TWCapability capability) public ReturnCode QuerySupport(TWCapability capability)
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Capability, Message.QuerySupport); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Capability, Message.QuerySupport);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.QuerySupport, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.QuerySupport, capability);
} }
/// <summary> /// <summary>
@@ -99,7 +99,7 @@ namespace NTwain.Triplets
public ReturnCode Reset(TWCapability capability) public ReturnCode Reset(TWCapability capability)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Capability, Message.Reset); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Capability, Message.Reset);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, capability);
} }
/// <summary> /// <summary>
@@ -111,7 +111,7 @@ namespace NTwain.Triplets
public ReturnCode ResetAll(TWCapability capability) public ReturnCode ResetAll(TWCapability capability)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Capability, Message.ResetAll); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Capability, Message.ResetAll);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.ResetAll, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.ResetAll, capability);
} }
/// <summary> /// <summary>
@@ -126,7 +126,7 @@ namespace NTwain.Triplets
public ReturnCode Set(TWCapability capability) public ReturnCode Set(TWCapability capability)
{ {
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.Capability, Message.Set); Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.Capability, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, capability);
} }
/// <summary> /// <summary>
@@ -140,7 +140,7 @@ namespace NTwain.Triplets
public ReturnCode SetConstraint(TWCapability capability) public ReturnCode SetConstraint(TWCapability capability)
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Capability, Message.SetConstraint); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Capability, Message.SetConstraint);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.SetConstraint, capability); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.SetConstraint, capability);
} }
} }
} }

View File

@@ -21,7 +21,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.CustomDSData, Message.Get); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.CustomDSData, Message.Get);
customData = new TWCustomDSData(); customData = new TWCustomDSData();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, customData); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, customData);
} }
/// <summary> /// <summary>
@@ -34,7 +34,7 @@ namespace NTwain.Triplets
public ReturnCode Set(TWCustomDSData customData) public ReturnCode Set(TWCustomDSData customData)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.CustomDSData, Message.Set); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.CustomDSData, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, customData); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, customData);
} }
} }
} }

View File

@@ -14,7 +14,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.DeviceEvent, Message.Get); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.DeviceEvent, Message.Get);
sourceDeviceEvent = new TWDeviceEvent(); sourceDeviceEvent = new TWDeviceEvent();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, sourceDeviceEvent); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, sourceDeviceEvent);
} }
} }
} }

View File

@@ -19,7 +19,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.EntryPoint, Message.Get); Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.EntryPoint, Message.Get);
entryPoint = new TWEntryPoint(); entryPoint = new TWEntryPoint();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, entryPoint); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, entryPoint);
} }
} }
} }

View File

@@ -23,7 +23,7 @@ namespace NTwain.Triplets
public ReturnCode ProcessEvent(TWEvent theEvent) public ReturnCode ProcessEvent(TWEvent theEvent)
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Event, Message.ProcessEvent); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Event, Message.ProcessEvent);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.ProcessEvent, theEvent); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.ProcessEvent, theEvent);
} }
} }
} }

View File

@@ -22,7 +22,7 @@ namespace NTwain.Triplets
public ReturnCode AutomaticCaptureDirectory(TWFileSystem fileSystem) public ReturnCode AutomaticCaptureDirectory(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.AutomaticCaptureDirectory); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.AutomaticCaptureDirectory);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.AutomaticCaptureDirectory, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.AutomaticCaptureDirectory, fileSystem);
} }
/// <summary> /// <summary>
@@ -37,7 +37,7 @@ namespace NTwain.Triplets
public ReturnCode ChangeDirectory(TWFileSystem fileSystem) public ReturnCode ChangeDirectory(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.ChangeDirectory); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.ChangeDirectory);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.ChangeDirectory, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.ChangeDirectory, fileSystem);
} }
/// <summary> /// <summary>
@@ -53,7 +53,7 @@ namespace NTwain.Triplets
public ReturnCode Copy(TWFileSystem fileSystem) public ReturnCode Copy(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.Copy); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.Copy);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Copy, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Copy, fileSystem);
} }
/// <summary> /// <summary>
@@ -65,7 +65,7 @@ namespace NTwain.Triplets
public ReturnCode CreateDirectory(TWFileSystem fileSystem) public ReturnCode CreateDirectory(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.CreateDirectory); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.CreateDirectory);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.CreateDirectory, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.CreateDirectory, fileSystem);
} }
/// <summary> /// <summary>
@@ -78,7 +78,7 @@ namespace NTwain.Triplets
public ReturnCode Delete(TWFileSystem fileSystem) public ReturnCode Delete(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.Delete); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.Delete);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Delete, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Delete, fileSystem);
} }
/// <summary> /// <summary>
@@ -90,7 +90,7 @@ namespace NTwain.Triplets
public ReturnCode FormatMedia(TWFileSystem fileSystem) public ReturnCode FormatMedia(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.FormatMedia); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.FormatMedia);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.FormatMedia, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.FormatMedia, fileSystem);
} }
/// <summary> /// <summary>
@@ -103,7 +103,7 @@ namespace NTwain.Triplets
public ReturnCode GetClose(TWFileSystem fileSystem) public ReturnCode GetClose(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.FileSystem, Message.GetClose); Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.FileSystem, Message.GetClose);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetClose, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetClose, fileSystem);
} }
/// <summary> /// <summary>
@@ -115,7 +115,7 @@ namespace NTwain.Triplets
public ReturnCode GetFirstFile(TWFileSystem fileSystem) public ReturnCode GetFirstFile(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.FileSystem, Message.GetFirstFile); Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.FileSystem, Message.GetFirstFile);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetFirstFile, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetFirstFile, fileSystem);
} }
/// <summary> /// <summary>
@@ -128,7 +128,7 @@ namespace NTwain.Triplets
public ReturnCode GetInfo(TWFileSystem fileSystem) public ReturnCode GetInfo(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.FileSystem, Message.GetInfo); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.FileSystem, Message.GetInfo);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetInfo, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetInfo, fileSystem);
} }
/// <summary> /// <summary>
@@ -140,7 +140,7 @@ namespace NTwain.Triplets
public ReturnCode GetNextFile(TWFileSystem fileSystem) public ReturnCode GetNextFile(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.FileSystem, Message.GetNextFile); Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.FileSystem, Message.GetNextFile);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetNextFile, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetNextFile, fileSystem);
} }
/// <summary> /// <summary>
@@ -156,7 +156,7 @@ namespace NTwain.Triplets
public ReturnCode Rename(TWFileSystem fileSystem) public ReturnCode Rename(TWFileSystem fileSystem)
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.Rename); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.FileSystem, Message.Rename);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Rename, fileSystem); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Rename, fileSystem);
} }
} }
} }

View File

@@ -20,7 +20,7 @@ namespace NTwain.Triplets
internal ReturnCode CloseDS() internal ReturnCode CloseDS()
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Identity, Message.CloseDS); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Identity, Message.CloseDS);
var rc = PInvoke.DsmEntry(Session.GetAppId(), Message.CloseDS, Session.SourceId); var rc = Dsm.DsmEntry(Session.GetAppId(), Message.CloseDS, Session.SourceId);
if (rc == ReturnCode.Success) if (rc == ReturnCode.Success)
{ {
Session.ChangeSourceId(null); Session.ChangeSourceId(null);
@@ -38,7 +38,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.GetDefault); Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.GetDefault);
source = new TWIdentity(); source = new TWIdentity();
return PInvoke.DsmEntry(Session.GetAppId(), Message.GetDefault, source); return Dsm.DsmEntry(Session.GetAppId(), Message.GetDefault, source);
} }
@@ -52,7 +52,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.GetFirst); Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.GetFirst);
source = new TWIdentity(); source = new TWIdentity();
return PInvoke.DsmEntry(Session.GetAppId(), Message.GetFirst, source); return Dsm.DsmEntry(Session.GetAppId(), Message.GetFirst, source);
} }
/// <summary> /// <summary>
@@ -65,7 +65,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.GetNext); Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.GetNext);
source = new TWIdentity(); source = new TWIdentity();
return PInvoke.DsmEntry(Session.GetAppId(), Message.GetNext, source); return Dsm.DsmEntry(Session.GetAppId(), Message.GetNext, source);
} }
/// <summary> /// <summary>
@@ -76,7 +76,7 @@ namespace NTwain.Triplets
internal ReturnCode OpenDS(TWIdentity source) internal ReturnCode OpenDS(TWIdentity source)
{ {
Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.Identity, Message.OpenDS); Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.Identity, Message.OpenDS);
var rc = PInvoke.DsmEntry(Session.GetAppId(), Message.OpenDS, source); var rc = Dsm.DsmEntry(Session.GetAppId(), Message.OpenDS, source);
if (rc == ReturnCode.Success) if (rc == ReturnCode.Success)
{ {
Session.ChangeSourceId(source); Session.ChangeSourceId(source);
@@ -95,7 +95,7 @@ namespace NTwain.Triplets
public ReturnCode Set(TWIdentity source) public ReturnCode Set(TWIdentity source)
{ {
Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.Identity, Message.Set); Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.Identity, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Message.Set, source); return Dsm.DsmEntry(Session.GetAppId(), Message.Set, source);
} }
/// <summary> /// <summary>
@@ -108,7 +108,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.UserSelect); Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.UserSelect);
source = new TWIdentity(); source = new TWIdentity();
return PInvoke.DsmEntry(Session.GetAppId(), Message.UserSelect, source); return Dsm.DsmEntry(Session.GetAppId(), Message.UserSelect, source);
} }
} }
} }

View File

@@ -23,7 +23,7 @@ namespace NTwain.Triplets
public ReturnCode CloseDsm(IntPtr handle) public ReturnCode CloseDsm(IntPtr handle)
{ {
Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.Parent, Message.CloseDsm); Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.Parent, Message.CloseDsm);
var rc = PInvoke.DsmEntry(Session.GetAppId(), null, DataGroups.Control, DataArgumentType.Parent, Message.CloseDsm, ref handle); var rc = Dsm.DsmEntry(Session.GetAppId(), null, DataGroups.Control, DataArgumentType.Parent, Message.CloseDsm, ref handle);
if (rc == ReturnCode.Success) if (rc == ReturnCode.Success)
{ {
Session.ChangeState(2, true); Session.ChangeState(2, true);
@@ -41,7 +41,7 @@ namespace NTwain.Triplets
public ReturnCode OpenDsm(IntPtr handle) public ReturnCode OpenDsm(IntPtr handle)
{ {
Session.VerifyState(1, 2, DataGroups.Control, DataArgumentType.Parent, Message.OpenDsm); Session.VerifyState(1, 2, DataGroups.Control, DataArgumentType.Parent, Message.OpenDsm);
var rc = PInvoke.DsmEntry(Session.GetAppId(), null, DataGroups.Control, DataArgumentType.Parent, Message.OpenDsm, ref handle); var rc = Dsm.DsmEntry(Session.GetAppId(), null, DataGroups.Control, DataArgumentType.Parent, Message.OpenDsm, ref handle);
if (rc == ReturnCode.Success) if (rc == ReturnCode.Success)
{ {
Session.ChangeState(3, true); Session.ChangeState(3, true);

View File

@@ -19,7 +19,7 @@ namespace NTwain.Triplets
public ReturnCode PassThrough(TWPassThru sourcePassThru) public ReturnCode PassThrough(TWPassThru sourcePassThru)
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.PassThru, Message.PassThru); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.PassThru, Message.PassThru);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.PassThru, sourcePassThru); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.PassThru, sourcePassThru);
} }
} }
} }

View File

@@ -21,7 +21,7 @@ namespace NTwain.Triplets
internal ReturnCode EndXfer(TWPendingXfers pendingXfers) internal ReturnCode EndXfer(TWPendingXfers pendingXfers)
{ {
Session.VerifyState(6, 7, DataGroups.Control, DataArgumentType.PendingXfers, Message.EndXfer); Session.VerifyState(6, 7, DataGroups.Control, DataArgumentType.PendingXfers, Message.EndXfer);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.EndXfer, pendingXfers); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.EndXfer, pendingXfers);
} }
/// <summary> /// <summary>
@@ -35,7 +35,7 @@ namespace NTwain.Triplets
public ReturnCode Get(TWPendingXfers pendingXfers) public ReturnCode Get(TWPendingXfers pendingXfers)
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.PendingXfers, Message.Get); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.PendingXfers, Message.Get);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, pendingXfers); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, pendingXfers);
} }
/// <summary> /// <summary>
@@ -46,7 +46,7 @@ namespace NTwain.Triplets
internal ReturnCode Reset(TWPendingXfers pendingXfers) internal ReturnCode Reset(TWPendingXfers pendingXfers)
{ {
Session.VerifyState(6, 6, DataGroups.Control, DataArgumentType.PendingXfers, Message.Reset); Session.VerifyState(6, 6, DataGroups.Control, DataArgumentType.PendingXfers, Message.Reset);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, pendingXfers); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, pendingXfers);
} }
/// <summary> /// <summary>
@@ -58,7 +58,7 @@ namespace NTwain.Triplets
public ReturnCode StopFeeder(TWPendingXfers pendingXfers) public ReturnCode StopFeeder(TWPendingXfers pendingXfers)
{ {
Session.VerifyState(6, 6, DataGroups.Control, DataArgumentType.PendingXfers, Message.StopFeeder); Session.VerifyState(6, 6, DataGroups.Control, DataArgumentType.PendingXfers, Message.StopFeeder);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.StopFeeder, pendingXfers); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.StopFeeder, pendingXfers);
} }
} }
} }

View File

@@ -20,7 +20,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Get); Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Get);
setupFileXfer = new TWSetupFileXfer(); setupFileXfer = new TWSetupFileXfer();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, setupFileXfer); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, setupFileXfer);
} }
/// <summary> /// <summary>
@@ -32,7 +32,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.GetDefault); Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.GetDefault);
setupFileXfer = new TWSetupFileXfer(); setupFileXfer = new TWSetupFileXfer();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, setupFileXfer); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, setupFileXfer);
} }
/// <summary> /// <summary>
@@ -45,7 +45,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Reset); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Reset);
setupFileXfer = new TWSetupFileXfer(); setupFileXfer = new TWSetupFileXfer();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, setupFileXfer); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, setupFileXfer);
} }
/// <summary> /// <summary>
@@ -60,7 +60,7 @@ namespace NTwain.Triplets
public ReturnCode Set(TWSetupFileXfer setupFileXfer) public ReturnCode Set(TWSetupFileXfer setupFileXfer)
{ {
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Set); Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, setupFileXfer); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, setupFileXfer);
} }
} }

View File

@@ -20,7 +20,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupMemXfer, Message.Get); Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupMemXfer, Message.Get);
setupMemXfer = new TWSetupMemXfer(); setupMemXfer = new TWSetupMemXfer();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, setupMemXfer); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, setupMemXfer);
} }
} }
} }

View File

@@ -19,7 +19,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(2, 7, DataGroups.Control, DataArgumentType.Status, Message.Get); Session.VerifyState(2, 7, DataGroups.Control, DataArgumentType.Status, Message.Get);
status = new TWStatus(); status = new TWStatus();
return PInvoke.DsmEntry(Session.GetAppId(), null, Message.Get, status); return Dsm.DsmEntry(Session.GetAppId(), null, Message.Get, status);
} }
/// <summary> /// <summary>
@@ -31,7 +31,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Status, Message.Get); Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Status, Message.Get);
status = new TWStatus(); status = new TWStatus();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, status); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, status);
} }
} }
} }

View File

@@ -19,7 +19,7 @@ namespace NTwain.Triplets
public ReturnCode Get(TWStatusUtf8 status) public ReturnCode Get(TWStatusUtf8 status)
{ {
Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.StatusUtf8, Message.Get); Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.StatusUtf8, Message.Get);
return PInvoke.DsmEntry(Session.GetAppId(), null, Message.Get, status); return Dsm.DsmEntry(Session.GetAppId(), null, Message.Get, status);
} }
} }
} }

View File

@@ -23,7 +23,7 @@ namespace NTwain.Triplets
public ReturnCode DisableDS(TWUserInterface userInterface) public ReturnCode DisableDS(TWUserInterface userInterface)
{ {
Session.VerifyState(5, 5, DataGroups.Control, DataArgumentType.UserInterface, Message.DisableDS); Session.VerifyState(5, 5, DataGroups.Control, DataArgumentType.UserInterface, Message.DisableDS);
var rc = PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.DisableDS, userInterface); var rc = Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.DisableDS, userInterface);
if (rc == ReturnCode.Success) if (rc == ReturnCode.Success)
{ {
Session.ChangeState(4, true); Session.ChangeState(4, true);
@@ -41,7 +41,7 @@ namespace NTwain.Triplets
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.UserInterface, Message.EnableDS); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.UserInterface, Message.EnableDS);
using (var pending = Session.GetPendingStateChanger(5)) using (var pending = Session.GetPendingStateChanger(5))
{ {
var rc = PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.EnableDS, userInterface); var rc = Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.EnableDS, userInterface);
if (rc == ReturnCode.Success || if (rc == ReturnCode.Success ||
(!userInterface.ShowUI && rc == ReturnCode.CheckStatus)) (!userInterface.ShowUI && rc == ReturnCode.CheckStatus))
{ {
@@ -63,7 +63,7 @@ namespace NTwain.Triplets
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.UserInterface, Message.EnableDSUIOnly); Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.UserInterface, Message.EnableDSUIOnly);
using (var pending = Session.GetPendingStateChanger(5)) using (var pending = Session.GetPendingStateChanger(5))
{ {
var rc = PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.EnableDSUIOnly, userInterface); var rc = Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.EnableDSUIOnly, userInterface);
if (rc == ReturnCode.Success) if (rc == ReturnCode.Success)
{ {
pending.Commit(); pending.Commit();

View File

@@ -20,7 +20,7 @@ namespace NTwain.Triplets
public ReturnCode Get(ref DataGroups value) public ReturnCode Get(ref DataGroups value)
{ {
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.XferGroup, Message.Get); Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.XferGroup, Message.Get);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Control, DataArgumentType.XferGroup, Message.Get, ref value); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Control, DataArgumentType.XferGroup, Message.Get, ref value);
} }
/// <summary> /// <summary>
@@ -33,7 +33,7 @@ namespace NTwain.Triplets
public ReturnCode Set(DataGroups value) public ReturnCode Set(DataGroups value)
{ {
Session.VerifyState(6, 6, DataGroups.Control, DataArgumentType.XferGroup, Message.Set); Session.VerifyState(6, 6, DataGroups.Control, DataArgumentType.XferGroup, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Control, DataArgumentType.XferGroup, Message.Set, ref value); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Control, DataArgumentType.XferGroup, Message.Set, ref value);
} }
} }
} }

View File

@@ -21,7 +21,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.CieColor, Message.Get); Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.CieColor, Message.Get);
cieColor = new TWCieColor(); cieColor = new TWCieColor();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, cieColor); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, cieColor);
} }
} }
} }

View File

@@ -15,7 +15,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(7, 7, DataGroups.Image, DataArgumentType.ExtImageInfo, Message.Get); Session.VerifyState(7, 7, DataGroups.Image, DataArgumentType.ExtImageInfo, Message.Get);
info = new TWExtImageInfo(); info = new TWExtImageInfo();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, info); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, info);
} }
} }
} }

View File

@@ -22,7 +22,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Filter, Message.Get); Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Filter, Message.Get);
filter = new TWFilter(); filter = new TWFilter();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, filter); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, filter);
} }
/// <summary> /// <summary>
@@ -34,7 +34,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Filter, Message.GetDefault); Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Filter, Message.GetDefault);
filter = new TWFilter(); filter = new TWFilter();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, filter); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, filter);
} }
/// <summary> /// <summary>
@@ -46,7 +46,7 @@ namespace NTwain.Triplets
public ReturnCode Set(TWFilter filter) public ReturnCode Set(TWFilter filter)
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Filter, Message.Set); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Filter, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, filter); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, filter);
} }
/// <summary> /// <summary>
@@ -58,7 +58,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Filter, Message.Reset); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Filter, Message.Reset);
filter = new TWFilter(); filter = new TWFilter();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, filter); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, filter);
} }
} }
} }

View File

@@ -21,7 +21,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.GrayResponse, Message.Reset); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.GrayResponse, Message.Reset);
response = new TWGrayResponse(); response = new TWGrayResponse();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, response); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, response);
} }
/// <summary> /// <summary>
@@ -33,7 +33,7 @@ namespace NTwain.Triplets
public ReturnCode Set(TWGrayResponse response) public ReturnCode Set(TWGrayResponse response)
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.GrayResponse, Message.Set); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.GrayResponse, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, response); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, response);
} }
} }
} }

View File

@@ -21,7 +21,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(6, 7, DataGroups.Image, DataArgumentType.IccProfile, Message.Get); Session.VerifyState(6, 7, DataGroups.Image, DataArgumentType.IccProfile, Message.Get);
profile = new TWMemory(); profile = new TWMemory();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, DataArgumentType.IccProfile, Message.Get, ref profile); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, DataArgumentType.IccProfile, Message.Get, ref profile);
} }
} }
} }

View File

@@ -20,7 +20,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(6, 6, DataGroups.Image, DataArgumentType.ImageFileXfer, Message.Get); Session.VerifyState(6, 6, DataGroups.Image, DataArgumentType.ImageFileXfer, Message.Get);
IntPtr z = IntPtr.Zero; IntPtr z = IntPtr.Zero;
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Image, DataArgumentType.ImageFileXfer, Message.Get, ref z); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Image, DataArgumentType.ImageFileXfer, Message.Get, ref z);
} }
} }
} }

View File

@@ -15,7 +15,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(6, 7, DataGroups.Image, DataArgumentType.ImageInfo, Message.Get); Session.VerifyState(6, 7, DataGroups.Image, DataArgumentType.ImageInfo, Message.Get);
info = new TWImageInfo(); info = new TWImageInfo();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, info); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, info);
} }
} }
} }

View File

@@ -15,27 +15,27 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.ImageLayout, Message.Get); Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.ImageLayout, Message.Get);
layout = new TWImageLayout(); layout = new TWImageLayout();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, layout); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, layout);
} }
public ReturnCode GetDefault(out TWImageLayout layout) public ReturnCode GetDefault(out TWImageLayout layout)
{ {
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.ImageLayout, Message.GetDefault); Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.ImageLayout, Message.GetDefault);
layout = new TWImageLayout(); layout = new TWImageLayout();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, layout); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, layout);
} }
public ReturnCode Reset(out TWImageLayout layout) public ReturnCode Reset(out TWImageLayout layout)
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.ImageLayout, Message.Reset); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.ImageLayout, Message.Reset);
layout = new TWImageLayout(); layout = new TWImageLayout();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, layout); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, layout);
} }
public ReturnCode Set(TWImageLayout layout) public ReturnCode Set(TWImageLayout layout)
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.ImageLayout, Message.Set); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.ImageLayout, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, layout); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, layout);
} }
} }
} }

View File

@@ -17,7 +17,7 @@ namespace NTwain.Triplets
public ReturnCode Get(TWImageMemXfer xfer) public ReturnCode Get(TWImageMemXfer xfer)
{ {
Session.VerifyState(6, 6, DataGroups.Image, DataArgumentType.ImageMemFileXfer, Message.Get); Session.VerifyState(6, 6, DataGroups.Image, DataArgumentType.ImageMemFileXfer, Message.Get);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, xfer); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, xfer);
} }
} }

View File

@@ -17,7 +17,7 @@ namespace NTwain.Triplets
public ReturnCode Get(TWImageMemXfer xfer) public ReturnCode Get(TWImageMemXfer xfer)
{ {
Session.VerifyState(6, 7, DataGroups.Image, DataArgumentType.ImageMemXfer, Message.Get); Session.VerifyState(6, 7, DataGroups.Image, DataArgumentType.ImageMemXfer, Message.Get);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, xfer); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, xfer);
} }
} }
} }

View File

@@ -20,7 +20,7 @@ namespace NTwain.Triplets
public ReturnCode Get(ref IntPtr handle) public ReturnCode Get(ref IntPtr handle)
{ {
Session.VerifyState(6, 6, DataGroups.Image, DataArgumentType.ImageNativeXfer, Message.Get); Session.VerifyState(6, 6, DataGroups.Image, DataArgumentType.ImageNativeXfer, Message.Get);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Image, DataArgumentType.ImageNativeXfer, Message.Get, ref handle); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, DataGroups.Image, DataArgumentType.ImageNativeXfer, Message.Get, ref handle);
} }
} }
} }

View File

@@ -21,7 +21,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.JpegCompression, Message.Get); Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.JpegCompression, Message.Get);
compression = new TWJpegCompression(); compression = new TWJpegCompression();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, compression); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, compression);
} }
/// <summary> /// <summary>
@@ -34,7 +34,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.JpegCompression, Message.GetDefault); Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.JpegCompression, Message.GetDefault);
compression = new TWJpegCompression(); compression = new TWJpegCompression();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, compression); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, compression);
} }
/// <summary> /// <summary>
@@ -46,7 +46,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.JpegCompression, Message.Reset); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.JpegCompression, Message.Reset);
compression = new TWJpegCompression(); compression = new TWJpegCompression();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, compression); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, compression);
} }
/// <summary> /// <summary>
@@ -59,7 +59,7 @@ namespace NTwain.Triplets
public ReturnCode Set(TWJpegCompression compression) public ReturnCode Set(TWJpegCompression compression)
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.JpegCompression, Message.Set); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.JpegCompression, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, compression); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, compression);
} }
} }
} }

View File

@@ -20,7 +20,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Palette8, Message.Get); Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Palette8, Message.Get);
palette = new TWPalette8(); palette = new TWPalette8();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, palette); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Get, palette);
} }
/// <summary> /// <summary>
@@ -32,7 +32,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Palette8, Message.GetDefault); Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Palette8, Message.GetDefault);
palette = new TWPalette8(); palette = new TWPalette8();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, palette); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.GetDefault, palette);
} }
/// <summary> /// <summary>
@@ -45,7 +45,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Palette8, Message.Reset); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Palette8, Message.Reset);
palette = new TWPalette8(); palette = new TWPalette8();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, palette); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, palette);
} }
/// <summary> /// <summary>
@@ -59,7 +59,7 @@ namespace NTwain.Triplets
public ReturnCode Set(TWPalette8 palette) public ReturnCode Set(TWPalette8 palette)
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Palette8, Message.Set); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Palette8, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, palette); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, palette);
} }
} }
} }

View File

@@ -22,7 +22,7 @@ namespace NTwain.Triplets
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.RgbResponse, Message.Reset); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.RgbResponse, Message.Reset);
response = new TWRgbResponse(); response = new TWRgbResponse();
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, response); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Reset, response);
} }
/// <summary> /// <summary>
@@ -34,7 +34,7 @@ namespace NTwain.Triplets
public ReturnCode Set(TWRgbResponse response) public ReturnCode Set(TWRgbResponse response)
{ {
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.RgbResponse, Message.Set); Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.RgbResponse, Message.Set);
return PInvoke.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, response); return Dsm.DsmEntry(Session.GetAppId(), Session.SourceId, Message.Set, response);
} }
} }
} }

View File

@@ -5,12 +5,12 @@ using NTwain.Values;
namespace NTwain.Triplets namespace NTwain.Triplets
{ {
static partial class PInvoke static partial class Dsm
{ {
static partial class NativeMethods static partial class NativeMethods
{ {
[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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -19,7 +19,7 @@ namespace NTwain.Triplets
ref IntPtr data); 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -28,7 +28,7 @@ namespace NTwain.Triplets
ref DataGroups data); ref DataGroups 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -37,7 +37,7 @@ namespace NTwain.Triplets
[In, Out]TWAudioInfo 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -46,7 +46,7 @@ namespace NTwain.Triplets
[In, Out]TWCapability 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -55,7 +55,7 @@ namespace NTwain.Triplets
[In, Out]TWCustomDSData 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -64,7 +64,7 @@ namespace NTwain.Triplets
[In, Out]TWDeviceEvent 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -73,7 +73,7 @@ namespace NTwain.Triplets
[In, Out]TWCallback 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -82,7 +82,7 @@ namespace NTwain.Triplets
[In, Out]TWCallback2 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -91,7 +91,7 @@ namespace NTwain.Triplets
[In, Out]TWEntryPoint 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -100,7 +100,7 @@ namespace NTwain.Triplets
[In, Out]TWEvent 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -109,7 +109,7 @@ namespace NTwain.Triplets
[In, Out]TWFileSystem 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
IntPtr zero, IntPtr zero,
DataGroups dg, DataGroups dg,
@@ -118,7 +118,7 @@ namespace NTwain.Triplets
[In, Out]TWIdentity 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -127,7 +127,7 @@ namespace NTwain.Triplets
[In, Out]TWPassThru 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -136,7 +136,7 @@ namespace NTwain.Triplets
[In, Out]TWPendingXfers 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -145,7 +145,7 @@ namespace NTwain.Triplets
[In, Out]TWSetupFileXfer 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -154,7 +154,7 @@ namespace NTwain.Triplets
[In, Out]TWSetupMemXfer 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -163,7 +163,7 @@ namespace NTwain.Triplets
[In, Out]TWStatusUtf8 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -172,7 +172,7 @@ namespace NTwain.Triplets
[In, Out]TWUserInterface 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -181,7 +181,7 @@ namespace NTwain.Triplets
[In, Out]TWCieColor 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -190,7 +190,7 @@ namespace NTwain.Triplets
[In, Out]TWExtImageInfo 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -199,7 +199,7 @@ namespace NTwain.Triplets
[In, Out]TWFilter 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -208,7 +208,7 @@ namespace NTwain.Triplets
[In, Out]TWGrayResponse 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -217,7 +217,7 @@ namespace NTwain.Triplets
[In, Out]TWImageInfo 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -226,7 +226,7 @@ namespace NTwain.Triplets
[In, Out]TWImageLayout 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -235,7 +235,7 @@ namespace NTwain.Triplets
[In, Out]TWImageMemXfer 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -244,7 +244,7 @@ namespace NTwain.Triplets
[In, Out]TWJpegCompression 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -253,7 +253,7 @@ namespace NTwain.Triplets
[In, Out]TWPalette8 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -262,7 +262,7 @@ namespace NTwain.Triplets
[In, Out]TWRgbResponse 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -271,7 +271,7 @@ namespace NTwain.Triplets
[In, Out]TWStatus 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 DsmLinux(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,

View File

@@ -5,12 +5,12 @@ using NTwain.Values;
namespace NTwain.Triplets namespace NTwain.Triplets
{ {
static partial class PInvoke static partial class Dsm
{ {
static partial class NativeMethods static partial class NativeMethods
{ {
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -19,7 +19,7 @@ namespace NTwain.Triplets
ref IntPtr data); ref IntPtr data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -28,7 +28,7 @@ namespace NTwain.Triplets
ref DataGroups data); ref DataGroups data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -37,7 +37,7 @@ namespace NTwain.Triplets
[In, Out]TWAudioInfo data); [In, Out]TWAudioInfo data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -46,7 +46,7 @@ namespace NTwain.Triplets
[In, Out]TWCapability data); [In, Out]TWCapability data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -55,7 +55,7 @@ namespace NTwain.Triplets
[In, Out]TWCustomDSData data); [In, Out]TWCustomDSData data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -64,7 +64,7 @@ namespace NTwain.Triplets
[In, Out]TWDeviceEvent data); [In, Out]TWDeviceEvent data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -73,7 +73,7 @@ namespace NTwain.Triplets
[In, Out]TWCallback data); [In, Out]TWCallback data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -82,7 +82,7 @@ namespace NTwain.Triplets
[In, Out]TWCallback2 data); [In, Out]TWCallback2 data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -91,7 +91,7 @@ namespace NTwain.Triplets
[In, Out]TWEntryPoint data); [In, Out]TWEntryPoint data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -100,7 +100,7 @@ namespace NTwain.Triplets
[In, Out]TWEvent data); [In, Out]TWEvent data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -109,7 +109,7 @@ namespace NTwain.Triplets
[In, Out]TWFileSystem data); [In, Out]TWFileSystem data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
IntPtr zero, IntPtr zero,
DataGroups dg, DataGroups dg,
@@ -118,7 +118,7 @@ namespace NTwain.Triplets
[In, Out]TWIdentity data); [In, Out]TWIdentity data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -127,7 +127,7 @@ namespace NTwain.Triplets
[In, Out]TWPassThru data); [In, Out]TWPassThru data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -136,7 +136,7 @@ namespace NTwain.Triplets
[In, Out]TWPendingXfers data); [In, Out]TWPendingXfers data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -145,7 +145,7 @@ namespace NTwain.Triplets
[In, Out]TWSetupFileXfer data); [In, Out]TWSetupFileXfer data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -154,7 +154,7 @@ namespace NTwain.Triplets
[In, Out]TWSetupMemXfer data); [In, Out]TWSetupMemXfer data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -163,7 +163,7 @@ namespace NTwain.Triplets
[In, Out]TWStatusUtf8 data); [In, Out]TWStatusUtf8 data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -172,7 +172,7 @@ namespace NTwain.Triplets
[In, Out]TWUserInterface data); [In, Out]TWUserInterface data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -181,7 +181,7 @@ namespace NTwain.Triplets
[In, Out]TWCieColor data); [In, Out]TWCieColor data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -190,7 +190,7 @@ namespace NTwain.Triplets
[In, Out]TWExtImageInfo data); [In, Out]TWExtImageInfo data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -199,7 +199,7 @@ namespace NTwain.Triplets
[In, Out]TWFilter data); [In, Out]TWFilter data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -208,7 +208,7 @@ namespace NTwain.Triplets
[In, Out]TWGrayResponse data); [In, Out]TWGrayResponse data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -217,7 +217,7 @@ namespace NTwain.Triplets
[In, Out]TWImageInfo data); [In, Out]TWImageInfo data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -226,7 +226,7 @@ namespace NTwain.Triplets
[In, Out]TWImageLayout data); [In, Out]TWImageLayout data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -235,7 +235,7 @@ namespace NTwain.Triplets
[In, Out]TWImageMemXfer data); [In, Out]TWImageMemXfer data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -244,7 +244,7 @@ namespace NTwain.Triplets
[In, Out]TWJpegCompression data); [In, Out]TWJpegCompression data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -253,7 +253,7 @@ namespace NTwain.Triplets
[In, Out]TWPalette8 data); [In, Out]TWPalette8 data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -262,7 +262,7 @@ namespace NTwain.Triplets
[In, Out]TWRgbResponse data); [In, Out]TWRgbResponse data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -271,7 +271,7 @@ namespace NTwain.Triplets
[In, Out]TWStatus data); [In, Out]TWStatus data);
[DllImport("twaindsm", EntryPoint = "#1")] [DllImport("twaindsm", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry64( public static extern ReturnCode DsmWinNew(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,

View File

@@ -5,12 +5,12 @@ using NTwain.Values;
namespace NTwain.Triplets namespace NTwain.Triplets
{ {
static partial class PInvoke static partial class Dsm
{ {
static partial class NativeMethods static partial class NativeMethods
{ {
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -19,7 +19,7 @@ namespace NTwain.Triplets
ref IntPtr data); ref IntPtr data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -28,7 +28,7 @@ namespace NTwain.Triplets
ref DataGroups data); ref DataGroups data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -37,7 +37,7 @@ namespace NTwain.Triplets
[In, Out]TWAudioInfo data); [In, Out]TWAudioInfo data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -46,7 +46,7 @@ namespace NTwain.Triplets
[In, Out]TWCapability data); [In, Out]TWCapability data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -55,7 +55,7 @@ namespace NTwain.Triplets
[In, Out]TWCustomDSData data); [In, Out]TWCustomDSData data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -64,7 +64,7 @@ namespace NTwain.Triplets
[In, Out]TWDeviceEvent data); [In, Out]TWDeviceEvent data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -73,7 +73,7 @@ namespace NTwain.Triplets
[In, Out]TWCallback data); [In, Out]TWCallback data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -82,7 +82,7 @@ namespace NTwain.Triplets
[In, Out]TWCallback2 data); [In, Out]TWCallback2 data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -91,7 +91,7 @@ namespace NTwain.Triplets
[In, Out]TWEntryPoint data); [In, Out]TWEntryPoint data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -100,7 +100,7 @@ namespace NTwain.Triplets
[In, Out]TWEvent data); [In, Out]TWEvent data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -109,7 +109,7 @@ namespace NTwain.Triplets
[In, Out]TWFileSystem data); [In, Out]TWFileSystem data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
IntPtr zero, IntPtr zero,
DataGroups dg, DataGroups dg,
@@ -118,7 +118,7 @@ namespace NTwain.Triplets
[In, Out]TWIdentity data); [In, Out]TWIdentity data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -127,7 +127,7 @@ namespace NTwain.Triplets
[In, Out]TWPassThru data); [In, Out]TWPassThru data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -136,7 +136,7 @@ namespace NTwain.Triplets
[In, Out]TWPendingXfers data); [In, Out]TWPendingXfers data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -145,7 +145,7 @@ namespace NTwain.Triplets
[In, Out]TWSetupFileXfer data); [In, Out]TWSetupFileXfer data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -154,7 +154,7 @@ namespace NTwain.Triplets
[In, Out]TWSetupMemXfer data); [In, Out]TWSetupMemXfer data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -163,7 +163,7 @@ namespace NTwain.Triplets
[In, Out]TWStatusUtf8 data); [In, Out]TWStatusUtf8 data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -172,7 +172,7 @@ namespace NTwain.Triplets
[In, Out]TWUserInterface data); [In, Out]TWUserInterface data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -181,7 +181,7 @@ namespace NTwain.Triplets
[In, Out]TWCieColor data); [In, Out]TWCieColor data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -190,7 +190,7 @@ namespace NTwain.Triplets
[In, Out]TWExtImageInfo data); [In, Out]TWExtImageInfo data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -199,7 +199,7 @@ namespace NTwain.Triplets
[In, Out]TWFilter data); [In, Out]TWFilter data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -208,7 +208,7 @@ namespace NTwain.Triplets
[In, Out]TWGrayResponse data); [In, Out]TWGrayResponse data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -217,7 +217,7 @@ namespace NTwain.Triplets
[In, Out]TWImageInfo data); [In, Out]TWImageInfo data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -226,7 +226,7 @@ namespace NTwain.Triplets
[In, Out]TWImageLayout data); [In, Out]TWImageLayout data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -235,7 +235,7 @@ namespace NTwain.Triplets
[In, Out]TWImageMemXfer data); [In, Out]TWImageMemXfer data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -244,7 +244,7 @@ namespace NTwain.Triplets
[In, Out]TWJpegCompression data); [In, Out]TWJpegCompression data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -253,7 +253,7 @@ namespace NTwain.Triplets
[In, Out]TWPalette8 data); [In, Out]TWPalette8 data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -262,7 +262,7 @@ namespace NTwain.Triplets
[In, Out]TWRgbResponse data); [In, Out]TWRgbResponse data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,
@@ -271,7 +271,7 @@ namespace NTwain.Triplets
[In, Out]TWStatus data); [In, Out]TWStatus data);
[DllImport("twain_32", EntryPoint = "#1")] [DllImport("twain_32", EntryPoint = "#1")]
public static extern ReturnCode DsmEntry32( public static extern ReturnCode DsmWinOld(
[In, Out]TWIdentity origin, [In, Out]TWIdentity origin,
[In, Out]TWIdentity destination, [In, Out]TWIdentity destination,
DataGroups dg, DataGroups dg,

616
NTwain/Triplets/Dsm.cs Normal file
View File

@@ -0,0 +1,616 @@
using System;
using System.Runtime.InteropServices;
using NTwain.Data;
using NTwain.Values;
using System.IO;
namespace NTwain.Triplets
{
/// <summary>
/// Contains the full TWAIN entry signatures through pinvoke.
/// These are called by all the defined triplets methods in
/// this namespace.
/// </summary>
static partial class Dsm
{
// Change pinvoke base on where running in 64bit mode.
// Theoretically [DllImport("twaindsm", EntryPoint = "#1")]
// works on both 32 and 64 bit
// but it's not installed on either system by default.
// A proper 64 bit twain driver would've installed it so
// in essence it only exists in 64 bit systems and thus
// the 2 sets of identical pinvokes for windows :(
public static readonly bool CanUseNewDSM = CheckIfCanUseNewDSM();
private static bool CheckIfCanUseNewDSM()
{
#if DEBUG
return IntPtr.Size == 8;
#else
var path = Path.Combine(Environment.SystemDirectory, "twaindsm.dll");
// if 64bit or the dll exists use it
return IntPtr.Size == 8 ||
File.Exists(path);
#endif
}
static readonly bool IsWin = Environment.OSVersion.Platform == PlatformID.Win32NT;
static readonly bool IsLinux = Environment.OSVersion.Platform == PlatformID.Unix;
// define sig for each different data type since "object" doesn't work
#region wrapped calls
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
DataGroups dg,
DataArgumentType dat,
Message msg,
ref IntPtr data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, dg, dat, msg, ref data); }
else { return NativeMethods.DsmWinOld(origin, destination, dg, dat, msg, ref data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, dg, dat, msg, ref data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
DataGroups dg,
DataArgumentType dat,
Message msg,
ref DataGroups data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, dg, dat, msg, ref data); }
else { return NativeMethods.DsmWinOld(origin, destination, dg, dat, msg, ref data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, dg, dat, msg, ref data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWAudioInfo data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWCapability data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWCustomDSData data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWDeviceEvent data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWCallback data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWCallback2 data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWEntryPoint data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWEvent data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWFileSystem data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
Message msg,
TWIdentity data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
else { return NativeMethods.DsmWinOld(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWPassThru data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWPendingXfers data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWSetupFileXfer data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWSetupMemXfer data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWStatusUtf8 data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWUserInterface data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWCieColor data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWExtImageInfo data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWFilter data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWGrayResponse data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWImageInfo data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWImageLayout data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWImageMemXfer data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWJpegCompression data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWPalette8 data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWRgbResponse data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWStatus data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
DataArgumentType dat,
Message msg,
ref TWMemory data)
{
if (IsWin)
{
if (CanUseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, dat, msg, ref data); }
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, dat, msg, ref data); }
}
else if (IsLinux)
{
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, dat, msg, ref data);
}
throw new PlatformNotSupportedException();
}
#endregion
}
}

View File

@@ -1,613 +0,0 @@
using System;
using System.Runtime.InteropServices;
using NTwain.Data;
using NTwain.Values;
using System.IO;
namespace NTwain.Triplets
{
/// <summary>
/// Contains the full TWAIN entry signatures through pinvoke.
/// These are called by all the defined triplets methods in
/// this namespace.
/// </summary>
static partial class PInvoke
{
// Change pinvoke base on where running in 64bit mode.
// Theoretically [DllImport("twaindsm", EntryPoint = "#1")]
// works on both 32 and 64 bit
// but it's not installed on either system by default.
// A proper 64 bit twain driver would've installed it so
// in essence it only exists in 64 bit systems and thus
// the 2 sets of identical pinvokes :(
public static readonly bool CanUseNewDSM = 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);
}
static readonly bool IsWin = Environment.OSVersion.Platform == PlatformID.Win32NT;
static readonly bool IsOSX = Environment.OSVersion.Platform == PlatformID.MacOSX;
static readonly bool IsLinux = Environment.OSVersion.Platform == PlatformID.Unix;
// define sig for each different data type since "object" doesn't work
#region wrapped calls
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
DataGroups dg,
DataArgumentType dat,
Message msg,
ref IntPtr 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, dg, dat, msg, ref data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
DataGroups dg,
DataArgumentType dat,
Message msg,
ref DataGroups 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, dg, dat, msg, ref data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWAudioInfo 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWCapability 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWCustomDSData 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWDeviceEvent 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWCallback 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWCallback2 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWEntryPoint 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWEvent 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWFileSystem 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
Message msg,
TWIdentity 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWPassThru 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWPendingXfers 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWSetupFileXfer 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWSetupMemXfer 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWStatusUtf8 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWUserInterface 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWCieColor 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWExtImageInfo 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWFilter 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWGrayResponse 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWImageInfo 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWImageLayout 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWImageMemXfer 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWJpegCompression 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWPalette8 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWRgbResponse 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
Message msg,
TWStatus 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data);
}
throw new PlatformNotSupportedException();
}
public static ReturnCode DsmEntry(
TWIdentity origin,
TWIdentity destination,
DataArgumentType dat,
Message msg,
ref TWMemory 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 if (IsLinux)
{
return NativeMethods.DsmEntryLinux(origin, destination, DataGroups.Control, dat, msg, ref data);
}
throw new PlatformNotSupportedException();
}
#endregion
}
}