diff --git a/NTwain/Internals/TransferLogic.cs b/NTwain/Internals/TransferLogic.cs
index 54a5069..3595a99 100644
--- a/NTwain/Internals/TransferLogic.cs
+++ b/NTwain/Internals/TransferLogic.cs
@@ -20,8 +20,8 @@ namespace NTwain.Internals
public static void DoTransferRoutine(ITwainSessionInternal session)
{
var pending = new TWPendingXfers();
- var rc = ReturnCode.Success;
-
+ //var rc = ReturnCode.Success;
+ var rc = session.DGControl.PendingXfers.Get(pending);
do
{
#region build and raise xfer ready
diff --git a/NTwain/TwainSessionInternal.cs b/NTwain/TwainSessionInternal.cs
index 91ba38e..36fcd59 100644
--- a/NTwain/TwainSessionInternal.cs
+++ b/NTwain/TwainSessionInternal.cs
@@ -210,7 +210,7 @@ namespace NTwain
#region IWinMessageFilter Members
///
- /// Checks and handle the message if it's a TWAIN message.
+ /// Checks and handles the message if it's a TWAIN message.
///
/// The window handle.
/// The message.
@@ -265,6 +265,8 @@ namespace NTwain
// spec says we must handle this on the thread that enabled the DS.
// by using the internal dispatcher this will be the case.
+ // In any event the trick to get this thing working is to return from the callback first
+ // before trying to process the msg or there will be unpredictable errors.
_msgLoopHook.BeginInvoke(() =>
{
HandleSourceMsg(msg);