public static extern ReturnCode DsmWin32( [In, Out] TW_IDENTITY origin, [In, Out] TW_IDENTITY destination, DataGroups dg, DataArgumentType dat, Message msg, ref TW_TWAINDIRECT data);
/// <summary> /// Sends a TWAIN Direct task from the application to the driver. /// </summary> /// <param name="task"></param> /// <returns></returns> public ReturnCode SetTask(ref TW_TWAINDIRECT task) { if (Is32Bit) { if (IsWin) { return(NativeMethods.DsmWin32(Session.Config.App32, Session.CurrentSource.Identity32, DataGroups.Control, DataArgumentType.TwainDirect, Message.SetTask, ref task)); } if (IsLinux) { return(NativeMethods.DsmLinux32(Session.Config.App32, Session.CurrentSource.Identity32, DataGroups.Control, DataArgumentType.TwainDirect, Message.SetTask, ref task)); } if (IsMac) { return(NativeMethods.DsmMac32(Session.Config.App32, Session.CurrentSource.Identity32, DataGroups.Control, DataArgumentType.TwainDirect, Message.SetTask, ref task)); } } if (IsWin) { return(NativeMethods.DsmWin64(Session.Config.App32, Session.CurrentSource.Identity32, DataGroups.Control, DataArgumentType.TwainDirect, Message.SetTask, ref task)); } if (IsLinux) { return(NativeMethods.DsmLinux64(Session.Config.App32, Session.CurrentSource.Identity32, DataGroups.Control, DataArgumentType.TwainDirect, Message.SetTask, ref task)); } if (IsMac) { return(NativeMethods.DsmMac64(Session.Config.App32, Session.CurrentSource.Identity32, DataGroups.Control, DataArgumentType.TwainDirect, Message.SetTask, ref task)); } return(ReturnCode.Failure); }