Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
e577d45b
Commit
e577d45b
authored
Mar 06, 2009
by
Jeremy White
Committed by
Alexandre Julliard
Mar 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane.ds: Make sure that the condition code is set correctly when we handle an unexpected request.
parent
81b28887
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
6 deletions
+53
-6
sane_main.c
dlls/sane.ds/sane_main.c
+53
-6
No files found.
dlls/sane.ds/sane_main.c
View file @
e577d45b
...
...
@@ -141,6 +141,9 @@ static TW_UINT16 SANE_SourceControlHandler (
case
MSG_CLOSEDS
:
#ifdef SONAME_LIBSANE
psane_close
(
activeDS
.
deviceHandle
);
#else
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_CAPUNSUPPORTED
;
#endif
break
;
case
MSG_OPENDS
:
...
...
@@ -148,6 +151,7 @@ static TW_UINT16 SANE_SourceControlHandler (
twRC
=
SANE_OpenDS
(
pOrigin
,
(
pTW_IDENTITY
)
pData
);
#else
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_CAPUNSUPPORTED
;
#endif
break
;
case
MSG_GET
:
...
...
@@ -155,6 +159,7 @@ static TW_UINT16 SANE_SourceControlHandler (
twRC
=
SANE_GetIdentity
(
pOrigin
,
(
pTW_IDENTITY
)
pData
);
#else
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_CAPUNSUPPORTED
;
#endif
break
;
}
...
...
@@ -182,6 +187,7 @@ static TW_UINT16 SANE_SourceControlHandler (
break
;
default:
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
FIXME
(
"unrecognized opertion triplet
\n
"
);
}
break
;
...
...
@@ -196,6 +202,8 @@ static TW_UINT16 SANE_SourceControlHandler (
twRC
=
SANE_CustomDSDataSet
(
pOrigin
,
pData
);
break
;
default:
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
break
;
}
break
;
...
...
@@ -238,6 +246,7 @@ static TW_UINT16 SANE_SourceControlHandler (
twRC
=
SANE_FileSystemRename
(
pOrigin
,
pData
);
break
;
default:
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
break
;
}
...
...
@@ -247,14 +256,20 @@ static TW_UINT16 SANE_SourceControlHandler (
if
(
MSG
==
MSG_PROCESSEVENT
)
twRC
=
SANE_ProcessEvent
(
pOrigin
,
pData
);
else
{
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
case
DAT_PASSTHRU
:
if
(
MSG
==
MSG_PASSTHRU
)
twRC
=
SANE_PassThrough
(
pOrigin
,
pData
);
else
{
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
case
DAT_PENDINGXFERS
:
...
...
@@ -273,6 +288,7 @@ static TW_UINT16 SANE_SourceControlHandler (
twRC = SANE_PendingXfersStopFeeder (pOrigin, pData);
break;*/
default:
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
...
...
@@ -293,6 +309,7 @@ static TW_UINT16 SANE_SourceControlHandler (
twRC
=
SANE_SetupFileXferSet
(
pOrigin
,
pData
);
break
;
default:
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
break
;
}
...
...
@@ -319,14 +336,20 @@ static TW_UINT16 SANE_SourceControlHandler (
if
(
MSG
==
MSG_GET
)
twRC
=
SANE_SetupMemXferGet
(
pOrigin
,
pData
);
else
{
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
case
DAT_STATUS
:
if
(
MSG
==
MSG_GET
)
twRC
=
SANE_GetDSStatus
(
pOrigin
,
pData
);
else
{
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
case
DAT_USERINTERFACE
:
...
...
@@ -342,6 +365,7 @@ static TW_UINT16 SANE_SourceControlHandler (
twRC
=
SANE_EnableDSUIOnly
(
pOrigin
,
pData
);
break
;
default:
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
break
;
}
...
...
@@ -357,6 +381,7 @@ static TW_UINT16 SANE_SourceControlHandler (
twRC
=
SANE_XferGroupSet
(
pOrigin
,
pData
);
break
;
default:
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
break
;
}
...
...
@@ -364,6 +389,7 @@ static TW_UINT16 SANE_SourceControlHandler (
default:
FIXME
(
"code unknown: %d
\n
"
,
DAT
);
activeDS
.
twCC
=
TWCC_CAPUNSUPPORTED
;
twRC
=
TWRC_FAILURE
;
break
;
}
...
...
@@ -386,14 +412,20 @@ static TW_UINT16 SANE_ImageGroupHandler (
if
(
MSG
==
MSG_GET
)
twRC
=
SANE_CIEColorGet
(
pOrigin
,
pData
);
else
{
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
case
DAT_EXTIMAGEINFO
:
if
(
MSG
==
MSG_GET
)
twRC
=
SANE_ExtImageInfoGet
(
pOrigin
,
pData
);
else
{
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
case
DAT_GRAYRESPONSE
:
...
...
@@ -407,7 +439,7 @@ static TW_UINT16 SANE_ImageGroupHandler (
break
;
default:
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_
BADPROTOCOL
;
activeDS
.
twCC
=
TWCC_
CAPBADOPERATION
;
FIXME
(
"unrecognized operation triplet
\n
"
);
break
;
}
...
...
@@ -416,14 +448,20 @@ static TW_UINT16 SANE_ImageGroupHandler (
if
(
MSG
==
MSG_GET
)
twRC
=
SANE_ImageFileXferGet
(
pOrigin
,
pData
);
else
{
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
case
DAT_IMAGEINFO
:
if
(
MSG
==
MSG_GET
)
twRC
=
SANE_ImageInfoGet
(
pOrigin
,
pData
);
else
{
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
case
DAT_IMAGELAYOUT
:
...
...
@@ -443,7 +481,7 @@ static TW_UINT16 SANE_ImageGroupHandler (
break
;
default:
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_
BADPROTOCOL
;
activeDS
.
twCC
=
TWCC_
CAPBADOPERATION
;
ERR
(
"unrecognized operation triplet
\n
"
);
break
;
}
...
...
@@ -453,14 +491,20 @@ static TW_UINT16 SANE_ImageGroupHandler (
if
(
MSG
==
MSG_GET
)
twRC
=
SANE_ImageMemXferGet
(
pOrigin
,
pData
);
else
{
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
case
DAT_IMAGENATIVEXFER
:
if
(
MSG
==
MSG_GET
)
twRC
=
SANE_ImageNativeXferGet
(
pOrigin
,
pData
);
else
{
activeDS
.
twCC
=
TWCC_CAPBADOPERATION
;
twRC
=
TWRC_FAILURE
;
}
break
;
case
DAT_JPEGCOMPRESSION
:
...
...
@@ -480,7 +524,7 @@ static TW_UINT16 SANE_ImageGroupHandler (
break
;
default:
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_
BADPROTOCOL
;
activeDS
.
twCC
=
TWCC_
CAPBADOPERATION
;
WARN
(
"unrecognized operation triplet
\n
"
);
break
;
}
...
...
@@ -503,7 +547,7 @@ static TW_UINT16 SANE_ImageGroupHandler (
break
;
default:
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_
BADPROTOCOL
;
activeDS
.
twCC
=
TWCC_
CAPBADOPERATION
;
WARN
(
"unrecognized operation triplet
\n
"
);
}
break
;
...
...
@@ -519,7 +563,7 @@ static TW_UINT16 SANE_ImageGroupHandler (
break
;
default:
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_
BADPROTOCOL
;
activeDS
.
twCC
=
TWCC_
CAPBADOPERATION
;
WARN
(
"unrecognized operation triplet
\n
"
);
break
;
}
...
...
@@ -527,7 +571,7 @@ static TW_UINT16 SANE_ImageGroupHandler (
default:
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_
BADPROTOCOL
;
activeDS
.
twCC
=
TWCC_
CAPUNSUPPORTED
;
FIXME
(
"unrecognized DG type %d
\n
"
,
DAT
);
}
return
twRC
;
...
...
@@ -555,6 +599,9 @@ DS_Entry ( pTW_IDENTITY pOrigin,
break
;
case
DG_AUDIO
:
FIXME
(
"Audio group of controls not implemented yet.
\n
"
);
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_CAPUNSUPPORTED
;
break
;
default:
activeDS
.
twCC
=
TWCC_BADPROTOCOL
;
twRC
=
TWRC_FAILURE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment