From 659c45510795472605177a46c05af9fc71f00cfa Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Wed, 23 Aug 2023 11:04:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=AE=8F=E5=8F=AA=E5=9C=A8sc?= =?UTF-8?q?anner=E6=A8=A1=E5=9D=97=E4=B8=AD=E5=AE=9A=E4=B9=89=EF=BC=8Csane?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=80=9A=E8=BF=87=E6=8E=A5=E5=8F=A3=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgsane/sane_hg_mdw.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hgsane/sane_hg_mdw.cpp b/hgsane/sane_hg_mdw.cpp index b21f76a..538f204 100644 --- a/hgsane/sane_hg_mdw.cpp +++ b/hgsane/sane_hg_mdw.cpp @@ -2630,14 +2630,16 @@ extern "C" { // avoid compiler exporting name in C++ style !!! } SANE_Status inner_sane_ex_get_driver_version(SANE_Int* hh, SANE_Int* hl, SANE_Int* lh, SANE_Int* ll) { + unsigned long long v = hg_scanner_get_version(); + if (hh) - *hh = VERSION_MAJOR; + *hh = (v >> 24) & 0x0ff; if (hl) - *hl = VERSION_MINOR; + *hl = (v >> 16) & 0x0ff; if (lh) - *lh = VERSION_YEAR; + *lh = (v >> 8) & 0x0ff; if (ll) - *ll = GET_BUILD_VER; + *ll = (v >> 0) & 0x0ff; return SANE_STATUS_GOOD; }