59 ok(rc ==
TWRC_SUCCESS,
"Condition code not available, rc %d\n", rc);
106 if (suggested_set_value)
107 *suggested_set_value = orig_value + 1;
114 ok(onev->
Item == orig_value || !(actual_support &
TWQC_GETCURRENT),
"MSG_GET of 0x%x returned 0x%x, expecting 0x%x\n",
117 if (suggested_set_value)
118 *suggested_set_value = onev->
Item;
134 trace(
" %d: 0x%x\n",
i, p8[
i]);
136 trace(
" %d: 0x%x\n",
i, p16[
i]);
138 trace(
" %d: 0x%x\n",
i, p32[
i]);
143 "Type 0x%x, values from MSG_GET (0x%x) and MSG_GETCURRENT (0x%x) do not match.\n",
146 "Type 0x%x, values from MSG_GET (0x%x) and MSG_GETDEFAULT (0x%x) do not match.\n",
148 if (suggested_set_value)
154 "Type 0x%x, values from MSG_GET (0x%x) and MSG_GETCURRENT (0x%x) do not match.\n",
157 "Type 0x%x, values from MSG_GET (0x%x) and MSG_GETDEFAULT (0x%x) do not match.\n",
159 if (suggested_set_value)
187 "Error [rc %d|cc %d] doing MSG_QUERYSUPPORT for type 0x%x\n", rc,
status.ConditionCode, captype);
190 ok(
get_onevalue(
cap.hContainer, (
TW_UINT32 *) &actual_support,
NULL),
"Returned cap.hContainer invalid for QuerySupport on type 0x%x\n", captype);
191 ok((actual_support & minimum_support) == minimum_support,
192 "Error: minimum support 0x%x for type 0x%x, got 0x%x\n", minimum_support,
193 captype, actual_support);
205 "Error [rc %d|cc %d] doing MSG_GETCURRENT for type 0x%x\n", rc,
status.ConditionCode, captype);
208 ok(
get_onevalue(
cap.hContainer, &orig_value, &rtype),
"Returned cap.hContainer invalid for GETCURRENT on type 0x%x\n", captype);
209 ok(rtype ==
type,
"Returned GETCURRENT type 0x%x for cap 0x%x is not expected 0x%x\n", rtype, captype,
type);
223 "Error [rc %d|cc %d] doing MSG_GETDEFAULT for type 0x%x\n", rc,
status.ConditionCode, captype);
226 ok(
get_onevalue(
cap.hContainer, &default_value, &rtype),
"Returned cap.hContainer invalid for GETDEFAULT on type 0x%x\n", captype);
227 ok(rtype ==
type,
"Returned GETDEFAULT type 0x%x for cap 0x%x is not expected 0x%x\n", rtype, captype,
type);
232 new_value = orig_value;
242 "Error [rc %d|cc %d] doing MSG_GET for type 0x%x\n", rc,
status.ConditionCode, captype);
243 check_get(&
cap, actual_support, orig_value, default_value, &new_value);
258 "Error [rc %d|cc %d] doing MSG_SET for type 0x%x\n", rc,
status.ConditionCode, captype);
271 "Error [rc %d|cc %d] doing MSG_RESET for type 0x%x\n", rc,
status.ConditionCode, captype);
296 "Error [rc %d|cc %d] doing MSG_QUERYSUPPORT for type 0x%x\n", rc,
status.ConditionCode, captype);
299 ok(
get_onevalue(
cap.hContainer, (
TW_UINT32 *) &actual_support,
NULL),
"Returned cap.hContainer invalid for QuerySupport on type 0x%x\n", captype);
300 ok((actual_support & minimum_support) == minimum_support,
301 "Error: minimum support 0x%x for type 0x%x, got 0x%x\n", minimum_support,
302 captype, actual_support);
314 "Error [rc %d|cc %d] doing MSG_GETCURRENT for type 0x%x\n", rc,
status.ConditionCode, captype);
319 memcpy(&orig_value, &
val,
sizeof(orig_value));
333 "Error [rc %d|cc %d] doing MSG_GETDEFAULT for type 0x%x\n", rc,
status.ConditionCode, captype);
338 memcpy(&default_value, &
val,
sizeof(default_value));
352 "Error [rc %d|cc %d] doing MSG_GET for type 0x%x\n", rc,
status.ConditionCode, captype);
356 ok(
cap.ConType ==
TWON_RANGE,
"MSG_GET for ICAP_[XY]RESOLUTION did not return TWON_RANGE, but %d\n",
cap.ConType);
358 trace(
"MSG_GET of 0x%x returned [ItemType %d|MinValue %d|MaxValue %d|StepSize %d|DefaultValue %d|CurrentValue %d]:\n",
361 for (new_value =
range->MinValue; new_value < range->MaxValue; new_value +=
range->StepSize)
362 if (new_value !=
range->CurrentValue)
379 "Error [rc %d|cc %d] doing MSG_SET for type 0x%x\n", rc,
status.ConditionCode, captype);
393 "Error [rc %d|cc %d] doing MSG_RESET for type 0x%x\n", rc,
status.ConditionCode, captype);
415 "Error [rc %d|cc %d] doing MSG_QUERYSUPPORT for type 0x%x\n", rc,
status.ConditionCode, captype);
418 ok(
get_onevalue(
cap.hContainer, (
TW_UINT32 *) &actual_support,
NULL),
"Returned cap.hContainer invalid for QuerySupport on type 0x%x\n", captype);
419 ok((actual_support & minimum_support) == minimum_support,
420 "Error: minimum support 0x%x for type 0x%x, got 0x%x\n", minimum_support,
421 captype, actual_support);
433 "Error [rc %d|cc %d] doing MSG_GETCURRENT for type 0x%x\n", rc,
status.ConditionCode, captype);
451 "Error [rc %d|cc %d] doing MSG_GETDEFAULT for type 0x%x\n", rc,
status.ConditionCode, captype);
469 "Error [rc %d|cc %d] doing MSG_GET for type 0x%x\n", rc,
status.ConditionCode, captype);
474 trace(
"GET for Physical type 0x%x returns 0x%x\n", captype,
val);
501 "Error [rc %d|cc %d] doing MSG_QUERYSUPPORT for ICAP_SUPPORTEDSIZES\n", rc,
status.ConditionCode);
504 ok(
get_onevalue(
cap.hContainer, (
TW_UINT32 *) &actual_support,
NULL),
"Returned cap.hContainer invalid for QuerySupport on ICAP_SUPPORTEDSIZES\n");
505 ok((actual_support & minimum_support) == minimum_support,
506 "Error: minimum support 0x%x for ICAP_SUPPORTEDSIZES, got 0x%x\n", minimum_support, actual_support);
517 "Error [rc %d|cc %d] doing MSG_GETCURRENT for ICAP_SUPPORTEDSIZES\n", rc,
status.ConditionCode);
521 ok(
type ==
TWTY_UINT16,
"GETCURRENT for ICAP_SUPPORTEDSIZES is not type UINT16, is type %d\n",
type);
537 "Error [rc %d|cc %d] doing MSG_GETDEFAULT for ICAP_SUPPORTEDSIZES\n", rc,
status.ConditionCode);
557 "Error [rc %d|cc %d] doing MSG_GET for ICAP_SUPPORTEDSIZES\n", rc,
status.ConditionCode);
558 check_get(&
cap, actual_support, orig_value, default_value, &new_value);
571 "Error [rc %d|cc %d] doing MSG_SET for ICAP_SUPPORTEDSIZES\n", rc,
status.ConditionCode);
585 "Error [rc %d|cc %d] doing MSG_RESET for ICAP_SUPPORTEDSIZES\n", rc,
status.ConditionCode);
600 "Error [rc %d|cc %d] doing MSG_GET for DG_IMAGE/DAT_IMAGELAYOUT\n", rc,
status.ConditionCode);
603 trace(
"ImageLayout [Left %x.%x|Top %x.%x|Right %x.%x|Bottom %x.%x|Document %d|Page %d|Frame %d]\n",
611 layout.Frame.Left.Whole = 1;
612 layout.Frame.Right.Whole = 2;
613 layout.Frame.Top.Whole = 1;
614 layout.Frame.Bottom.Whole = 2;
618 "Error [rc %d|cc %d] doing MSG_SET for DG_IMAGE/DAT_IMAGELAYOUT\n", rc,
status.ConditionCode);
625 "Error [rc %d|cc %d] doing MSG_GET for DG_IMAGE/DAT_IMAGELAYOUT\n", rc,
status.ConditionCode);
628 trace(
"ImageLayout after set [Left %x.%x|Top %x.%x|Right %x.%x|Bottom %x.%x|Document %d|Page %d|Frame %d]\n",
651 "Error obtaining CAP_SUPPORTEDCAPS\n");
653 memset(capabilities, 0,
sizeof(capabilities));
664 trace(
"%d Capabilities:\n",
a->NumItems);
665 for (
i = 0;
i <
a->NumItems;
i++)
668 capabilities[
u[
i]] = 1;
725 ok(capabilities[
ICAP_UNITS],
"ICAP_UNITS not supported\n");
764 int scannercount = 0;
771 "Get first invalid condition code, rc %d, cc %d\n", rc,
status.ConditionCode);
776 trace(
"[Scanner %d|Version %d.%d(%s)|Protocol %d.%d|SupportedGroups 0x%x|Manufacturer %s|Family %s|ProductName %s]\n",
792 "Get default invalid condition code, rc %d, cc %d\n", rc,
status.ConditionCode);
810 trace(
"Interactive, so trying userselect\n");
841 skip(
"Could not register the test class, skipping tests\n");
848 win_skip(
"twain_32.dll not available, skipping tests\n");
855 win_skip(
"DSM_Entry not available, skipping tests\n");
#define GetProcAddress(x, y)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
static void check_get(TW_CAPABILITY *pCapability, TW_INT32 actual_support, TW_UINT32 orig_value, TW_UINT32 default_value, TW_UINT32 *suggested_set_value)
static void test_onevalue_cap(TW_IDENTITY *appid, TW_IDENTITY *source, TW_UINT16 captype, TW_UINT16 type, TW_INT32 minimum_support)
static DSMENTRYPROC pDSM_Entry
static void get_condition_code(TW_IDENTITY *appid, TW_IDENTITY *source, TW_STATUS *status)
static BOOL dsm_RegisterWindowClasses(void)
static TW_HANDLE alloc_and_set_onevalue(TW_UINT32 val, TW_UINT16 type)
static void test_physical(TW_IDENTITY *appid, TW_IDENTITY *source, TW_UINT16 captype, TW_INT32 minimum_support)
static BOOL get_onevalue(TW_HANDLE hcontainer, TW_UINT32 *ret, TW_UINT16 *type)
static void test_imagelayout(TW_IDENTITY *appid, TW_IDENTITY *source)
static void test_single_source(TW_IDENTITY *appid, TW_IDENTITY *source)
static void test_supported_sizes(TW_IDENTITY *appid, TW_IDENTITY *source, TW_INT32 minimum_support)
static void test_sources(TW_IDENTITY *appid)
GLuint GLuint GLsizei GLenum type
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
#define memcpy(s1, s2, n)
static void test_resolution(void)
#define CAP_FEEDERENABLED
#define ICAP_PHYSICALHEIGHT
#define TWON_PROTOCOLMINOR
#define ICAP_PHYSICALWIDTH
#define ICAP_SUPPORTEDSIZES
#define CAP_UICONTROLLABLE
#define ICAP_PLANARCHUNKY
#define CAP_SUPPORTEDCAPS
#define TWON_PROTOCOLMAJOR
DWORD WINAPI GetLastError(void)
_Check_return_ _Out_ PDWORD pCapability
HGDIOBJ WINAPI GetStockObject(_In_ int)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
BOOL WINAPI DestroyWindow(_In_ HWND)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)