Application

The Source will allocate the memory for the necessary container structure but the application must
free it when the operation is complete and the application no longer needs to maintain the
information.
Use MSG_QUERYSUPPORT:

To check the whether the Source supports a particular operation on the capability.
This operation may fail for a low memory condition. Either recover from a TWCC_LOWMEMORY
failure by freeing memory for the Source to use so it can continue, or terminating the acquisition
and notifying the user of the low memory problem.

Item = Bit pattern representing the set of operation that are supported by the Data Source on
this capability (TWQC_GET, TWQC_SET, TWQC_GETCURRENT, TWQC_GETDEFAULT,
TWQC_RESET, TWQC_SETCONSTRAINT, TWQC_CONSTRAINABLE);

TWAIN 2.2 Specification 7-25

Moreover, in the CAP_SUPPORTEDCAPS description specified that the MSG_QUERYSUPPORT operation must return the TW_ONEVALUE.

CAP_SUPPORTEDCAPS

Description

Returns a list of all the capabilities for which the Source will answer inquiries. Does not indicate
which capabilities the Source will allow to be set by the application. Some capabilities can only be
set if certain setup work has been done so the Source cannot globally answer which capabilities
are “set-able.”

Hello, jruizaranguren.
I think you mistaken, because a DG_CONTROL / DAT_CAPABILITY / MSG_QUERYSUPPORT operation must return a bit flags value of a TWQC_xxxx.
Bellow you can see result of DG_CONTROL / DAT_CAPABILITY / MSG_QUERYSUPPORT (for CAP_SUPPORTEDCAPS) operation for a "TWAIN FreeImage Software Scanner" (from a Twacker).

ItemType=TWTY_INT32
Item=TWQC_GET |TWQC_GETDEFAULT |TWQC_GETCURRENT

DG_CONTROL / DAT_CAPABILITY / MSG_QUERYSUPPORT

Description

Returns the Source’s support status of this capability.

Application

The Source will allocate the memory for the necessary container structure but the application
must free it when the operation is complete and the application no longer needs to maintain the
information.
Use MSG_QUERYSUPPORT:

To check the whether the Source supports a particular operation on the capability.

This operation may fail for a low memory condition. Either recover from a
TWCC_LOWMEMORY failure by freeing memory for the Source to use so it can continue, or
terminating the acquisition and notifying the user of the low memory problem.