From 22d694e0a9d260c879b3d4480b3ac0522ca596d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Thu, 2 Oct 2014 22:55:36 +0200 Subject: [PATCH] 2014-10-02 22:55 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbwin/win_prn2.c + save LastError value in win_PrintDataRaw() and win_PrintFileRaw() so user can access it using wapi_GetLastError() --- ChangeLog.txt | 5 +++++ contrib/hbwin/win_prn2.c | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8adb718c70..fa402d48fd 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,11 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2014-10-02 22:55 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbwin/win_prn2.c + + save LastError value in win_PrintDataRaw() and win_PrintFileRaw() + so user can access it using wapi_GetLastError() + 2014-10-02 22:37 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/sddsqlt3/core.c * decalre default size for numeric, blob and any fields diff --git a/contrib/hbwin/win_prn2.c b/contrib/hbwin/win_prn2.c index c35e7d3a6e..4e104bd07b 100644 --- a/contrib/hbwin/win_prn2.c +++ b/contrib/hbwin/win_prn2.c @@ -427,25 +427,38 @@ HB_FUNC( WIN_PRINTFILERAW ) if( nWritten < nRead ) break; } + hbwapi_SetLastError( GetLastError() ); hb_fsClose( fhnd ); hb_xfree( pbyBuffer ); } else + { + hbwapi_SetLastError( hb_fsOsError() ); nResult = -6; + } EndPagePrinter( hPrinter ); } else + { + hbwapi_SetLastError( GetLastError() ); nResult = -4; + } EndDocPrinter( hPrinter ); } else + { + hbwapi_SetLastError( GetLastError() ); nResult = -3; + } ClosePrinter( hPrinter ); hb_strfree( hDocName ); } else + { + hbwapi_SetLastError( GetLastError() ); nResult = -2; + } hb_strfree( hDeviceName ); } #endif @@ -492,19 +505,29 @@ HB_FUNC( WIN_PRINTDATARAW ) break; nResult += dwWritten; } + hbwapi_SetLastError( GetLastError() ); EndPagePrinter( hPrinter ); } else + { + hbwapi_SetLastError( GetLastError() ); nResult = -4; + } EndDocPrinter( hPrinter ); } else + { + hbwapi_SetLastError( GetLastError() ); nResult = -3; + } ClosePrinter( hPrinter ); hb_strfree( hDocName ); } else + { + hbwapi_SetLastError( GetLastError() ); nResult = -2; + } hb_strfree( hDeviceName ); } #endif