Renamed win32 to generic 32.

This commit is contained in:
Eugene Wang
2018-11-15 19:46:18 -05:00
parent e627615e1d
commit 546b885a0f
14 changed files with 77 additions and 73 deletions

View File

@@ -1,12 +1,13 @@
# TWAIN Application-Side Library # TWAIN Application-Library
## Info ## Info
This is a library created to make working with [TWAIN](http://twain.org/) interface possible in dotnet. This is a library created to make working with
[TWAIN](http://twain.org/) easier in dotnet.
This project has these features/goals: This project has these features/goals:
* Targets latest TWAIN version (2.4 as of this writing) * Targets latest TWAIN version (2.4 as of this writing)
* Supports all the TWAIN functions in the spec. * Supports all the TWAIN functions in the spec (may never happen but will be close).
## Using the lib ## Using the lib

View File

@@ -9,7 +9,7 @@ namespace NTwain.Triplets.Control
public ReturnCode RegisterCallback(ref TW_CALLBACK callback) public ReturnCode RegisterCallback(ref TW_CALLBACK callback)
{ {
return NativeMethods.DsmWin32(Session.Config.AppWin32, Session.CurrentSource.Identity, return NativeMethods.Dsm32(Session.Config.App32, Session.CurrentSource.Identity,
DataGroups.Control, DataArgumentType.Callback, Message.RegisterCallback, ref callback); DataGroups.Control, DataArgumentType.Callback, Message.RegisterCallback, ref callback);
} }
} }

View File

@@ -9,7 +9,7 @@ namespace NTwain.Triplets.Control
public ReturnCode RegisterCallback(ref TW_CALLBACK2 callback) public ReturnCode RegisterCallback(ref TW_CALLBACK2 callback)
{ {
return NativeMethods.DsmWin32(Session.Config.AppWin32, Session.CurrentSource.Identity, return NativeMethods.Dsm32(Session.Config.App32, Session.CurrentSource.Identity,
DataGroups.Control, DataArgumentType.Callback2, Message.RegisterCallback, ref callback); DataGroups.Control, DataArgumentType.Callback2, Message.RegisterCallback, ref callback);
} }
} }

View File

@@ -9,7 +9,7 @@ namespace NTwain.Triplets.Control
public ReturnCode Get(ref TW_DEVICEEVENT sourceDeviceEvent) public ReturnCode Get(ref TW_DEVICEEVENT sourceDeviceEvent)
{ {
return NativeMethods.DsmWin32(Session.Config.AppWin32, Session.CurrentSource.Identity, return NativeMethods.Dsm32(Session.Config.App32, Session.CurrentSource.Identity,
DataGroups.Control, DataArgumentType.DeviceEvent, Message.Get, ref sourceDeviceEvent); DataGroups.Control, DataArgumentType.DeviceEvent, Message.Get, ref sourceDeviceEvent);
} }
} }

View File

@@ -13,7 +13,7 @@ namespace NTwain.Triplets.Control
public ReturnCode Get(out TW_ENTRYPOINT entryPoint) public ReturnCode Get(out TW_ENTRYPOINT entryPoint)
{ {
entryPoint = new TW_ENTRYPOINT(); entryPoint = new TW_ENTRYPOINT();
return NativeMethods.DsmWin32(Session.Config.AppWin32, null, return NativeMethods.Dsm32(Session.Config.App32, null,
DataGroups.Control, DataArgumentType.EntryPoint, Message.Get, entryPoint); DataGroups.Control, DataArgumentType.EntryPoint, Message.Get, entryPoint);
} }
} }

View File

@@ -10,7 +10,7 @@ namespace NTwain.Triplets.Control
public ReturnCode CloseDS(TW_IDENTITY source) public ReturnCode CloseDS(TW_IDENTITY source)
{ {
var rc = NativeMethods.DsmWin32(Session.Config.AppWin32, IntPtr.Zero, var rc = NativeMethods.Dsm32(Session.Config.App32, IntPtr.Zero,
DataGroups.Control, DataArgumentType.Identity, Message.CloseDS, source); DataGroups.Control, DataArgumentType.Identity, Message.CloseDS, source);
if (rc == ReturnCode.Success) if (rc == ReturnCode.Success)
{ {
@@ -23,7 +23,7 @@ namespace NTwain.Triplets.Control
public ReturnCode GetDefault(out TW_IDENTITY source) public ReturnCode GetDefault(out TW_IDENTITY source)
{ {
source = new TW_IDENTITY(); source = new TW_IDENTITY();
return NativeMethods.DsmWin32(Session.Config.AppWin32, IntPtr.Zero, return NativeMethods.Dsm32(Session.Config.App32, IntPtr.Zero,
DataGroups.Control, DataArgumentType.Identity, Message.GetDefault, source); DataGroups.Control, DataArgumentType.Identity, Message.GetDefault, source);
} }
@@ -31,14 +31,14 @@ namespace NTwain.Triplets.Control
public ReturnCode GetFirst(out TW_IDENTITY source) public ReturnCode GetFirst(out TW_IDENTITY source)
{ {
source = new TW_IDENTITY(); source = new TW_IDENTITY();
return NativeMethods.DsmWin32(Session.Config.AppWin32, IntPtr.Zero, return NativeMethods.Dsm32(Session.Config.App32, IntPtr.Zero,
DataGroups.Control, DataArgumentType.Identity, Message.GetFirst, source); DataGroups.Control, DataArgumentType.Identity, Message.GetFirst, source);
} }
public ReturnCode GetNext(out TW_IDENTITY source) public ReturnCode GetNext(out TW_IDENTITY source)
{ {
source = new TW_IDENTITY(); source = new TW_IDENTITY();
return NativeMethods.DsmWin32(Session.Config.AppWin32, IntPtr.Zero, return NativeMethods.Dsm32(Session.Config.App32, IntPtr.Zero,
DataGroups.Control, DataArgumentType.Identity, Message.GetNext, source); DataGroups.Control, DataArgumentType.Identity, Message.GetNext, source);
} }
@@ -46,7 +46,7 @@ namespace NTwain.Triplets.Control
{ {
Session.StepDown(TwainState.DsmOpened); Session.StepDown(TwainState.DsmOpened);
var rc = NativeMethods.DsmWin32(Session.Config.AppWin32, IntPtr.Zero, var rc = NativeMethods.Dsm32(Session.Config.App32, IntPtr.Zero,
DataGroups.Control, DataArgumentType.Identity, Message.OpenDS, source); DataGroups.Control, DataArgumentType.Identity, Message.OpenDS, source);
if (rc == ReturnCode.Success) if (rc == ReturnCode.Success)
{ {
@@ -59,14 +59,14 @@ namespace NTwain.Triplets.Control
public ReturnCode Set(DataSource source) public ReturnCode Set(DataSource source)
{ {
return NativeMethods.DsmWin32(Session.Config.AppWin32, IntPtr.Zero, return NativeMethods.Dsm32(Session.Config.App32, IntPtr.Zero,
DataGroups.Control, DataArgumentType.Identity, Message.Set, source?.Identity); DataGroups.Control, DataArgumentType.Identity, Message.Set, source?.Identity);
} }
public ReturnCode UserSelect(out TW_IDENTITY source) public ReturnCode UserSelect(out TW_IDENTITY source)
{ {
source = new TW_IDENTITY(); source = new TW_IDENTITY();
return NativeMethods.DsmWin32(Session.Config.AppWin32, IntPtr.Zero, return NativeMethods.Dsm32(Session.Config.App32, IntPtr.Zero,
DataGroups.Control, DataArgumentType.Identity, Message.UserSelect, source); DataGroups.Control, DataArgumentType.Identity, Message.UserSelect, source);
} }
} }

View File

@@ -12,14 +12,14 @@ namespace NTwain.Triplets.Control
public ReturnCode OpenDSM(IntPtr hWnd) public ReturnCode OpenDSM(IntPtr hWnd)
{ {
var rc = NativeMethods.DsmWin32(Session.Config.AppWin32, null, var rc = NativeMethods.Dsm32(Session.Config.App32, null,
DataGroups.Control, DataArgumentType.Parent, Message.OpenDSM, ref hWnd); DataGroups.Control, DataArgumentType.Parent, Message.OpenDSM, ref hWnd);
if (rc == ReturnCode.Success) if (rc == ReturnCode.Success)
{ {
Session.State = TwainState.DsmOpened; Session.State = TwainState.DsmOpened;
// if twain2 then get memory management functions // if twain2 then get memory management functions
if ((Session.Config.AppWin32.DataFunctionalities & DataFunctionalities.Dsm2) == DataFunctionalities.Dsm2) if ((Session.Config.App32.DataFunctionalities & DataFunctionalities.Dsm2) == DataFunctionalities.Dsm2)
{ {
rc = Session.DGControl.EntryPoint.Get(out TW_ENTRYPOINT entry); rc = Session.DGControl.EntryPoint.Get(out TW_ENTRYPOINT entry);
if (rc == ReturnCode.Success) if (rc == ReturnCode.Success)
@@ -37,7 +37,7 @@ namespace NTwain.Triplets.Control
public ReturnCode CloseDSM(IntPtr hWnd) public ReturnCode CloseDSM(IntPtr hWnd)
{ {
var rc = NativeMethods.DsmWin32(Session.Config.AppWin32, null, DataGroups.Control, var rc = NativeMethods.Dsm32(Session.Config.App32, null, DataGroups.Control,
DataArgumentType.Parent, Message.CloseDSM, ref hWnd); DataArgumentType.Parent, Message.CloseDSM, ref hWnd);
if (rc == ReturnCode.Success) Session.State = TwainState.DsmLoaded; if (rc == ReturnCode.Success) Session.State = TwainState.DsmLoaded;
return rc; return rc;

View File

@@ -9,13 +9,13 @@ namespace NTwain.Triplets.Control
public ReturnCode GetManagerStatus(ref TW_STATUS status) public ReturnCode GetManagerStatus(ref TW_STATUS status)
{ {
return NativeMethods.DsmWin32(Session.Config.AppWin32, null, return NativeMethods.Dsm32(Session.Config.App32, null,
DataGroups.Control, DataArgumentType.Status, Message.Get, ref status); DataGroups.Control, DataArgumentType.Status, Message.Get, ref status);
} }
public ReturnCode GetSourceStatus(ref TW_STATUS status) public ReturnCode GetSourceStatus(ref TW_STATUS status)
{ {
return NativeMethods.DsmWin32(Session.Config.AppWin32, Session.CurrentSource.Identity, return NativeMethods.Dsm32(Session.Config.App32, Session.CurrentSource.Identity,
DataGroups.Control, DataArgumentType.Status, Message.Get, ref status); DataGroups.Control, DataArgumentType.Status, Message.Get, ref status);
} }
} }

View File

@@ -1,16 +1,16 @@
using System; //using System;
using System.Collections.Generic; //using System.Collections.Generic;
using System.Linq; //using System.Linq;
using System.Text; //using System.Text;
namespace NTwain.Triplets //namespace NTwain.Triplets
{ //{
/// <summary> // /// <summary>
/// Provides direct access to the triplet call. // /// Provides direct access to the triplet call.
/// </summary> // /// </summary>
public partial class DGCustom : BaseTriplet // public partial class DGCustom : BaseTriplet
{ // {
internal DGCustom(TwainSession session) : base(session) { } // internal DGCustom(TwainSession session) : base(session) { }
} // }
} //}

View File

@@ -10,7 +10,7 @@ namespace NTwain.Triplets
static partial class NativeMethods static partial class NativeMethods
{ {
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -19,7 +19,7 @@ namespace NTwain.Triplets
ref IntPtr data); ref IntPtr data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -28,7 +28,7 @@ namespace NTwain.Triplets
ref DataGroups data); ref DataGroups data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -37,7 +37,7 @@ namespace NTwain.Triplets
ref TW_AUDIOINFO data); ref TW_AUDIOINFO data);
//[DllImport(DSM.WinDsmDll, EntryPoint = DSM.EntryName)] //[DllImport(DSM.WinDsmDll, EntryPoint = DSM.EntryName)]
//public static extern ReturnCode DsmWin32( //public static extern ReturnCode Dsm32(
// [In, Out]TW_IDENTITY origin, // [In, Out]TW_IDENTITY origin,
// [In, Out]TW_IDENTITY destination, // [In, Out]TW_IDENTITY destination,
// DataGroups dg, // DataGroups dg,
@@ -46,7 +46,7 @@ namespace NTwain.Triplets
// ref TWCapability data); // ref TWCapability data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -55,7 +55,7 @@ namespace NTwain.Triplets
ref TW_CUSTOMDSDATA data); ref TW_CUSTOMDSDATA data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -64,7 +64,7 @@ namespace NTwain.Triplets
ref TW_DEVICEEVENT data); ref TW_DEVICEEVENT data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -73,7 +73,7 @@ namespace NTwain.Triplets
ref TW_CALLBACK data); ref TW_CALLBACK data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -82,7 +82,7 @@ namespace NTwain.Triplets
ref TW_CALLBACK2 data); ref TW_CALLBACK2 data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -91,7 +91,7 @@ namespace NTwain.Triplets
[In, Out]TW_ENTRYPOINT data); [In, Out]TW_ENTRYPOINT data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -100,7 +100,7 @@ namespace NTwain.Triplets
ref TW_EVENT data); ref TW_EVENT data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -109,7 +109,7 @@ namespace NTwain.Triplets
ref TW_FILESYSTEM data); ref TW_FILESYSTEM data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
IntPtr zero, IntPtr zero,
DataGroups dg, DataGroups dg,
@@ -118,7 +118,7 @@ namespace NTwain.Triplets
[In, Out]TW_IDENTITY data); [In, Out]TW_IDENTITY data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -127,7 +127,7 @@ namespace NTwain.Triplets
ref TW_PASSTHRU data); ref TW_PASSTHRU data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -136,7 +136,7 @@ namespace NTwain.Triplets
ref TW_PENDINGXFERS data); ref TW_PENDINGXFERS data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -145,7 +145,7 @@ namespace NTwain.Triplets
ref TW_SETUPFILEXFER data); ref TW_SETUPFILEXFER data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -154,7 +154,7 @@ namespace NTwain.Triplets
ref TW_SETUPMEMXFER data); ref TW_SETUPMEMXFER data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -163,7 +163,7 @@ namespace NTwain.Triplets
ref TW_STATUSUTF8 data); ref TW_STATUSUTF8 data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -172,7 +172,7 @@ namespace NTwain.Triplets
ref TW_USERINTERFACE data); ref TW_USERINTERFACE data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -181,7 +181,7 @@ namespace NTwain.Triplets
ref TW_CIECOLOR data); ref TW_CIECOLOR data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -190,7 +190,7 @@ namespace NTwain.Triplets
ref TW_EXTIMAGEINFO data); ref TW_EXTIMAGEINFO data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -199,7 +199,7 @@ namespace NTwain.Triplets
ref TW_FILTER data); ref TW_FILTER data);
//[DllImport(DSM.WinDsmDll, EntryPoint = DSM.EntryName)] //[DllImport(DSM.WinDsmDll, EntryPoint = DSM.EntryName)]
//public static extern ReturnCode DsmWin32( //public static extern ReturnCode Dsm32(
// [In, Out]TW_IDENTITY origin, // [In, Out]TW_IDENTITY origin,
// [In, Out]TW_IDENTITY destination, // [In, Out]TW_IDENTITY destination,
// DataGroups dg, // DataGroups dg,
@@ -208,7 +208,7 @@ namespace NTwain.Triplets
// ref TWGrayResponse data); // ref TWGrayResponse data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -217,7 +217,7 @@ namespace NTwain.Triplets
ref TW_IMAGEINFO data); ref TW_IMAGEINFO data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -226,7 +226,7 @@ namespace NTwain.Triplets
ref TW_IMAGELAYOUT data); ref TW_IMAGELAYOUT data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -235,7 +235,7 @@ namespace NTwain.Triplets
ref TW_IMAGEMEMXFER data); ref TW_IMAGEMEMXFER data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -244,7 +244,7 @@ namespace NTwain.Triplets
ref TW_JPEGCOMPRESSION data); ref TW_JPEGCOMPRESSION data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -253,7 +253,7 @@ namespace NTwain.Triplets
ref TW_PALETTE8 data); ref TW_PALETTE8 data);
//[DllImport(DSM.WinDsmDll, EntryPoint = DSM.EntryName)] //[DllImport(DSM.WinDsmDll, EntryPoint = DSM.EntryName)]
//public static extern ReturnCode DsmWin32( //public static extern ReturnCode Dsm32(
// [In, Out]TW_IDENTITY origin, // [In, Out]TW_IDENTITY origin,
// [In, Out]TW_IDENTITY destination, // [In, Out]TW_IDENTITY destination,
// DataGroups dg, // DataGroups dg,
@@ -262,7 +262,7 @@ namespace NTwain.Triplets
// ref TWRgbResponse data); // ref TWRgbResponse data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,
@@ -271,7 +271,7 @@ namespace NTwain.Triplets
ref TW_STATUS data); ref TW_STATUS data);
[DllImport(WinDsmDll, EntryPoint = EntryName)] [DllImport(WinDsmDll, EntryPoint = EntryName)]
public static extern ReturnCode DsmWin32( public static extern ReturnCode Dsm32(
[In, Out]TW_IDENTITY origin, [In, Out]TW_IDENTITY origin,
[In, Out]TW_IDENTITY destination, [In, Out]TW_IDENTITY destination,
DataGroups dg, DataGroups dg,

View File

@@ -28,9 +28,12 @@ namespace NTwain
//public bool PreferLegacyDsm { get; internal set; } //public bool PreferLegacyDsm { get; internal set; }
internal TW_IDENTITY AppWin32 { get; set; } /// <summary>
/// 32bit version of the app identity.
/// </summary>
internal TW_IDENTITY App32 { get; set; }
internal TW_IDENTITY SrcWin32 { get; set; } //internal TW_IDENTITY Src32 { get; set; }
/// <summary> /// <summary>
/// Gets memory manager associated with a <see cref="TwainSession"/>. /// Gets memory manager associated with a <see cref="TwainSession"/>.

View File

@@ -116,7 +116,7 @@ namespace NTwain
{ {
case PlatformID.Win32NT: case PlatformID.Win32NT:
config.MemoryManager = new WinMemoryManager(); // initial default config.MemoryManager = new WinMemoryManager(); // initial default
config.AppWin32 = new TW_IDENTITY config.App32 = new TW_IDENTITY
{ {
DataFunctionalities = DataFunctionalities.App2, DataFunctionalities = DataFunctionalities.App2,
DataGroup = DataGroups.Control | _dg, DataGroup = DataGroups.Control | _dg,

View File

@@ -42,10 +42,10 @@ namespace NTwain
/// </summary> /// </summary>
public DGAudio DGAudio => dgAudio ?? (dgAudio = new DGAudio(this)); public DGAudio DGAudio => dgAudio ?? (dgAudio = new DGAudio(this));
/// <summary> ///// <summary>
/// Gets/sets the direct triplet operation entry for custom values. ///// Gets/sets the direct triplet operation entry for custom values.
/// </summary> ///// </summary>
public DGCustom DGCustom { get; set; } //public DGCustom DGCustom { get; set; }
/// <summary> /// <summary>

View File

@@ -41,7 +41,7 @@ namespace NTwain
case PlatformID.MacOSX: case PlatformID.MacOSX:
case PlatformID.Unix: case PlatformID.Unix:
default: default:
_callbackDelegate = new CallbackDelegate(HandleWin32Callback); _callbackDelegate = new CallbackDelegate(Handle32BitCallback);
break; break;
} }
} }
@@ -214,10 +214,10 @@ namespace NTwain
return source; return source;
} }
ReturnCode HandleWin32Callback(TW_IDENTITY origin, TW_IDENTITY destination, ReturnCode Handle32BitCallback(TW_IDENTITY origin, TW_IDENTITY destination,
DataGroups dg, DataArgumentType dat, Message msg, IntPtr data) DataGroups dg, DataArgumentType dat, Message msg, IntPtr data)
{ {
Debug.WriteLine($"Thread {Thread.CurrentThread.ManagedThreadId}: {nameof(HandleWin32Callback)}({dg}, {dat}, {msg}, {data})"); Debug.WriteLine($"Thread {Thread.CurrentThread.ManagedThreadId}: {nameof(Handle32BitCallback)}({dg}, {dat}, {msg}, {data})");
HandleSourceMsg(msg); HandleSourceMsg(msg);
return ReturnCode.Success; return ReturnCode.Success;
} }