From d355b0467ff58ba6cb0e2a05cd57fccb25423a08 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Tue, 16 May 2023 16:41:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=BF=87=E5=A4=A7BUG=EF=BC=9B=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=8E=E5=A6=82=E6=9E=9CEndXfer=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=EF=BC=8C=E5=88=99=E8=AE=BE=E7=BD=AE=E4=B8=BA=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sane/scanner.cpp | 2 +- twain/twain/huagaods.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sane/scanner.cpp b/sane/scanner.cpp index b63ddbb..1553002 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -3412,7 +3412,7 @@ void log(const wchar_t* info) { fclose(g_file_); remove(g_path_file_.c_str()); - g_file_ = fopen(g_path_file_.c_str(), "a+b"); + g_file_ = fopen(g_path_file_.c_str(), "wb"); if (g_file_) { unsigned short bom = 0x0feff; diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp index ee8fb74..55007da 100644 --- a/twain/twain/huagaods.cpp +++ b/twain/twain/huagaods.cpp @@ -1626,6 +1626,8 @@ Result huagao_ds::call(const Identity& origin, DataGroup dg, Dat dat, Msg msg, v swprintf_s(buf, _countof(buf) - 1, L"[%x - %s]DSEntry(%s, %s, %s) = {%s, %s}\r\n", GetCurrentThreadId(), desc_state(state(), ss), desc_data_group(dg, dgs), desc_data(dat, dts), desc_msg(msg, ms), desc_return_code(rt, rcs), desc_condition_code((ConditionCode)(Status)rt, cs)); load_sane_util::log_info(buf, 0); + if (Msg::EndXfer == msg && scanner_status_ == SCANNER_STATUS_STOPPED) // PurvarScannerForHomework.exe + rt = success(); } in_calling = calling;