ReactOS 0.4.17-dev-966-gf06eace
dsm_ctrl.c
Go to the documentation of this file.
1/*
2 * TWAIN32 Source Manager
3 *
4 * Copyright 2000 Corel Corporation
5 * Copyright 2006 Marcus Meissner
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include <stdlib.h>
23#include <stdarg.h>
24#include <stdio.h>
25
26#include "windef.h"
27#include "winbase.h"
28#include "winuser.h"
29#include "twain.h"
30#include "twain_i.h"
31#include "resource.h"
32#include "wine/debug.h"
33
35
36static TW_UINT16 DSM_initialized; /* whether Source Manager is initialized */
37static TW_UINT32 DSM_sourceId; /* source id generator */
38static TW_UINT16 DSM_currentDevice; /* keep track of device during enumeration */
41
45};
46
47static int nrdevices = 0;
48static struct all_devices *devices = NULL;
49
50static void
51twain_add_onedriver(const WCHAR *dsname) {
53 DSENTRYPROC dsEntry;
54 TW_IDENTITY fakeOrigin;
55 TW_IDENTITY sourceId;
56 struct all_devices *new_devices;
59
60#ifdef __REACTOS__
61 swprintf( path, MAX_PATH, L"c:\\windows\\twain_%u\\%s", (int)(sizeof(void *) * 8), dsname );
62#else
63 swprintf( path, MAX_PATH, L"c:\\windows\\twain_%u\\%s", sizeof(void *) * 8, dsname );
64#endif
66 if (!hmod) {
67 ERR("Failed to load TWAIN Source %s\n", debugstr_w(path));
68 return;
69 }
70 dsEntry = (DSENTRYPROC)GetProcAddress(hmod, "DS_Entry");
71 if (!dsEntry) {
72 ERR("Failed to find DS_Entry() in TWAIN DS %s\n", debugstr_w(path));
73 return;
74 }
75 /* Loop to do multiple detects, mostly for sane.ds and gphoto2.ds */
76 do {
77 int i;
78
79 sourceId.Id = DSM_sourceId;
82 ret = dsEntry (&fakeOrigin, DG_CONTROL, DAT_IDENTITY, MSG_GET, &sourceId);
83 if (ret != TWRC_SUCCESS) {
84 ERR("Source->(DG_CONTROL,DAT_IDENTITY,MSG_GET) failed!\n");
85 break;
86 }
87 TRACE("Manufacturer: %s\n", debugstr_a(sourceId.Manufacturer));
88 TRACE("ProductFamily: %s\n", debugstr_a(sourceId.ProductFamily));
89 TRACE("ProductName: %s\n", debugstr_a(sourceId.ProductName));
90
91 for (i=0;i<nrdevices;i++) {
92 if (!strcmp(sourceId.ProductName,devices[i].identity.ProductName))
93 break;
94 }
95 if (i < nrdevices)
96 break;
97 new_devices = realloc( devices, sizeof(devices[0]) * (nrdevices + 1) );
98 if (!new_devices)
99 break;
100 devices = new_devices;
101 devices[nrdevices].modname = wcsdup( path );
102 devices[nrdevices].identity = sourceId;
103 nrdevices++;
104 DSM_sourceId++;
105 } while (1);
107}
108
110
111static void
113 if (detectionrun) return;
115
116 twain_add_onedriver(L"sane.ds");
117 twain_add_onedriver(L"gphoto2.ds");
118#if 0
119 twain_add_onedriver(L"Largan\\sp503a.ds");
120 twain_add_onedriver(L"vivicam10\\vivicam10.ds");
121 twain_add_onedriver(L"ws30slim\\sp500a.ds");
122#endif
123}
124
125/* DG_CONTROL/DAT_NULL/MSG_CLOSEDSREQ|MSG_DEVICEEVENT|MSG_XFERREADY */
127{
128 struct pending_message *message;
129
130 TRACE ("DG_CONTROL/DAT_NULL MSG=%i\n", MSG);
131
132 if (MSG != MSG_CLOSEDSREQ &&
133 MSG != MSG_DEVICEEVENT &&
135 {
137 return TWRC_FAILURE;
138 }
139
140 message = HeapAlloc(GetProcessHeap(), 0, sizeof(*message));
141 if (!message)
142 {
144 return TWRC_FAILURE;
145 }
146
147 message->msg = MSG;
149
150 /* Delphi twain only sends us messages from one window, and it
151 doesn't even give us the real handle to that window. Other
152 applications might decide to forward messages sent to DSM_parent
153 or to the one supplied to ENABLEDS. So let's try very hard to
154 find a window that will work. */
155 if (DSM_parent)
157 if (pSource->ui_window && pSource->ui_window != DSM_parent)
158 PostMessageW(pSource->ui_window, event_message, 0, 0);
159 if (pSource->event_window && pSource->event_window != pSource->ui_window &&
160 pSource->event_window != DSM_parent)
161 PostMessageW(pSource->event_window, event_message, 0, 0);
162 PostMessageW(0, event_message, 0, 0);
163
164 return TWRC_SUCCESS;
165}
166
167/* Filters MSG_PROCESSEVENT messages before reaching the data source */
169{
170 TW_EVENT *event = (TW_EVENT*)pData;
171 MSG *msg = (MSG*)event->pEvent;
173
174 TRACE("%x,%x\n", msg->message, event_message);
175
176 if (msg->message == event_message)
177 {
178 if (!list_empty (&pSource->pending_messages))
179 {
180 struct list *entry = list_head (&pSource->pending_messages);
182 event->TWMessage = message->msg;
184 TRACE("<-- %x\n", event->TWMessage);
185 }
186 else
187 event->TWMessage = MSG_NULL;
189 }
190
191 if (msg->hwnd)
192 {
193 MSG dummy;
194 pSource->event_window = msg->hwnd;
195 if (!list_empty (&pSource->pending_messages) &&
197 {
198 PostMessageW(msg->hwnd, event_message, 0, 0);
199 }
200 }
201
202 return result;
203}
204
205/* DG_CONTROL/DAT_IDENTITY/MSG_CLOSEDS */
207{
208 TW_UINT16 twRC = TWRC_SUCCESS;
209 pTW_IDENTITY pIdentity = (pTW_IDENTITY) pData;
210 activeDS *currentDS = NULL, *prevDS = NULL;
211
212 TRACE ("DG_CONTROL/DAT_IDENTITY/MSG_CLOSEDS\n");
213
214 for (currentDS = activeSources; currentDS; currentDS = currentDS->next) {
215 if (currentDS->identity.Id == pIdentity->Id)
216 break;
217 prevDS = currentDS;
218 }
219 if (!currentDS) {
221 return TWRC_FAILURE;
222 }
223 twRC = currentDS->dsEntry (pOrigin, DG_CONTROL, DAT_IDENTITY, MSG_CLOSEDS, pData);
224 /* This causes crashes due to still open Windows, so leave out for now.
225 * FreeLibrary (currentDS->hmod);
226 */
227 if (prevDS)
228 prevDS->next = currentDS->next;
229 else
230 activeSources = currentDS->next;
231 HeapFree (GetProcessHeap(), 0, currentDS);
232 if (twRC == TWRC_SUCCESS)
234 else /* FIXME: unclear how to get TWCC */
236 return twRC;
237}
238
239/* DG_CONTROL/DAT_IDENTITY/MSG_GETDEFAULT */
241{
242 pTW_IDENTITY pSourceIdentity = (pTW_IDENTITY) pData;
243
244 TRACE("DG_CONTROL/DAT_IDENTITY/MSG_GETDEFAULT\n");
247 if (!nrdevices)
248 return TWRC_FAILURE;
249 *pSourceIdentity = devices[0].identity;
251 return TWRC_SUCCESS;
252}
253
254/* DG_CONTROL/DAT_IDENTITY/MSG_GETFIRST */
256{
257 pTW_IDENTITY pSourceIdentity = (pTW_IDENTITY) pData;
258
259 TRACE ("DG_CONTROL/DAT_IDENTITY/MSG_GETFIRST\n");
261 if (!nrdevices) {
262 TRACE ("no entries found.\n");
264 return TWRC_FAILURE;
265 }
267 *pSourceIdentity = devices[DSM_currentDevice++].identity;
268 return TWRC_SUCCESS;
269}
270
271/* DG_CONTROL/DAT_IDENTITY/MSG_GETNEXT */
273{
274 pTW_IDENTITY pSourceIdentity = (pTW_IDENTITY) pData;
275
276 TRACE("DG_CONTROL/DAT_IDENTITY/MSG_GETNEXT\n");
279 return TWRC_ENDOFLIST;
280 }
281 *pSourceIdentity = devices[DSM_currentDevice++].identity;
282 return TWRC_SUCCESS;
283}
284
285/* DG_CONTROL/DAT_IDENTITY/MSG_OPENDS */
287{
288 TW_UINT16 i = 0;
289 pTW_IDENTITY pIdentity = (pTW_IDENTITY) pData;
290 activeDS *newSource;
292
293 TRACE("DG_CONTROL/DAT_IDENTITY/MSG_OPENDS\n");
294 TRACE("pIdentity is %s\n", pIdentity->ProductName);
295 if (!DSM_initialized) {
296 FIXME("seq error\n");
298 return TWRC_FAILURE;
299 }
301 if (!nrdevices) {
302 FIXME("no devs.\n");
304 return TWRC_FAILURE;
305 }
306
307 if (pIdentity->ProductName[0] != '\0') {
308 /* Make sure the source to be opened exists in the device list */
309 for (i = 0; i<nrdevices; i++)
310 if (!strcmp (devices[i].identity.ProductName, pIdentity->ProductName))
311 break;
312 if (i == nrdevices)
313 i = 0;
314 } /* else use the first device */
315
316 /* the source is found in the device list */
317 newSource = HeapAlloc (GetProcessHeap(), 0, sizeof (activeDS));
318 if (!newSource) {
320 FIXME("Out of memory.\n");
321 return TWRC_FAILURE;
322 }
323 hmod = LoadLibraryW(devices[i].modname);
324 if (!hmod) {
325 ERR("Failed to load TWAIN Source %s\n", debugstr_w(devices[i].modname));
327 HeapFree(GetProcessHeap(), 0, newSource);
328 return TWRC_FAILURE;
329 }
330 newSource->hmod = hmod;
331 newSource->dsEntry = (DSENTRYPROC)GetProcAddress(hmod, "DS_Entry");
332 /* Assign id for the opened data source */
333 pIdentity->Id = DSM_sourceId ++;
334 if (TWRC_SUCCESS != newSource->dsEntry (pOrigin, DG_CONTROL, DAT_IDENTITY, MSG_OPENDS, pIdentity)) {
336 HeapFree(GetProcessHeap(), 0, newSource);
337 DSM_sourceId--;
338 return TWRC_FAILURE;
339 }
340 /* add the data source to an internal active source list */
341 newSource->next = activeSources;
342 newSource->identity.Id = pIdentity->Id;
343 strcpy (newSource->identity.ProductName, pIdentity->ProductName);
344 list_init(&newSource->pending_messages);
345 newSource->ui_window = NULL;
346 newSource->event_window = NULL;
347 activeSources = newSource;
349 return TWRC_SUCCESS;
350}
351
352typedef struct {
356
358{
359 switch (msg)
360 {
361 case WM_INITDIALOG:
362 {
364 int i;
365 HWND sourcelist;
366 BOOL any_devices = FALSE;
367
369
370 sourcelist = GetDlgItem(hwnd, IDC_LISTSOURCE);
371
372 for (i=0; i<nrdevices; i++)
373 {
374 TW_IDENTITY *id = &devices[i].identity;
376
377 if ((id->SupportedGroups & data->origin->SupportedGroups) == 0)
378 continue;
379
380 index = SendMessageA(sourcelist, LB_ADDSTRING, 0, (LPARAM)id->ProductName);
382 any_devices = TRUE;
383 }
384
385 if (any_devices)
386 {
388
389 /* FIXME: Select the supplied product name or default source. */
390 SendMessageW(sourcelist, LB_SETCURSEL, 0, 0);
391 }
392
393 return TRUE;
394 }
395 case WM_CLOSE:
396 EndDialog(hwnd, 0);
397 return TRUE;
398 case WM_COMMAND:
400 {
401 EndDialog(hwnd, 0);
402 return TRUE;
403 }
404 else if (wparam == MAKEWPARAM(IDOK, BN_CLICKED) ||
406 {
408 HWND sourcelist;
410
411 sourcelist = GetDlgItem(hwnd, IDC_LISTSOURCE);
412
413 index = SendMessageW(sourcelist, LB_GETCURSEL, 0, 0);
414
415 if (index == LB_ERR)
416 return TRUE;
417
418 index = SendMessageW(sourcelist, LB_GETITEMDATA, (WPARAM)index, 0);
419
420 *data->result = devices[index].identity;
421
422 /* FIXME: Save this as the default source */
423
424 EndDialog(hwnd, 1);
425 return TRUE;
426 }
427 break;
428 }
429 return FALSE;
430}
431
432/* DG_CONTROL/DAT_IDENTITY/MSG_USERSELECT */
434{
435 userselect_data param = {pOrigin, pData};
437
438 TRACE("DG_CONTROL/DAT_IDENTITY/MSG_USERSELECT SupportedGroups=0x%lx ProductName=%s\n",
439 pOrigin->SupportedGroups, wine_dbgstr_a(param.result->ProductName));
440
442
443 if (!IsWindow(parent))
444 parent = NULL;
445
448 {
449 TRACE("canceled\n");
451 return TWRC_CANCEL;
452 }
453
454 TRACE("<-- %s\n", wine_dbgstr_a(param.result->ProductName));
456 return TWRC_SUCCESS;
457}
458
459/* DG_CONTROL/DAT_PARENT/MSG_CLOSEDSM */
461{
462 activeDS *currentDS = activeSources, *nextDS;
463
464 TRACE("DG_CONTROL/DAT_PARENT/MSG_CLOSEDSM\n");
465
466 if (DSM_initialized)
467 {
469
470 /* If there are data sources still open, close them now. */
471 while (currentDS != NULL)
472 {
473 nextDS = currentDS->next;
474 currentDS->dsEntry (pOrigin, DG_CONTROL, DAT_IDENTITY, MSG_CLOSEDS, pData);
475 HeapFree (GetProcessHeap(), 0, currentDS);
476 currentDS = nextDS;
477 }
481 return TWRC_SUCCESS;
482 } else {
484 return TWRC_FAILURE;
485 }
486}
487
488/* DG_CONTROL/DAT_PARENT/MSG_OPENDSM */
490{
491 TW_UINT16 twRC = TWRC_SUCCESS;
492
493 TRACE("DG_CONTROL/DAT_PARENT/MSG_OPENDSM\n");
494 if (!DSM_initialized) {
495 event_message = RegisterWindowMessageA("WINE TWAIN_32 EVENT");
499 twRC = TWRC_SUCCESS;
500 } else {
501 /* operation invoked in invalid state */
503 twRC = TWRC_FAILURE;
504 }
506 return twRC;
507}
508
509/* DG_CONTROL/DAT_STATUS/MSG_GET */
511{
512 pTW_STATUS pSourceStatus = (pTW_STATUS) pData;
513
514 TRACE ("DG_CONTROL/DAT_STATUS/MSG_GET\n");
515
516 pSourceStatus->ConditionCode = DSM_twCC;
517 DSM_twCC = TWCC_SUCCESS; /* clear the condition code */
518 return TWRC_SUCCESS;
519}
#define MSG
Definition: Mailslot.c:11
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
Definition: list.h:39
#define realloc
Definition: debug_ros.c:6
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
HANDLE HWND
Definition: compat.h:19
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define LoadLibraryW(x)
Definition: compat.h:747
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
#define DLG_USERSELECT
Definition: resource.h:22
#define IDC_LISTSOURCE
Definition: resource.h:24
#define swprintf
Definition: precomp.h:40
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
r parent
Definition: btrfs.c:3010
static INT_PTR CALLBACK userselect_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dsm_ctrl.c:357
static BOOL detectionrun
Definition: dsm_ctrl.c:109
static void twain_add_onedriver(const WCHAR *dsname)
Definition: dsm_ctrl.c:51
static TW_UINT16 DSM_initialized
Definition: dsm_ctrl.c:36
TW_UINT16 TWAIN_CloseDS(pTW_IDENTITY pOrigin, TW_MEMREF pData)
Definition: dsm_ctrl.c:206
TW_UINT16 TWAIN_IdentityGetDefault(pTW_IDENTITY pOrigin, TW_MEMREF pData)
Definition: dsm_ctrl.c:240
TW_UINT16 TWAIN_IdentityGetFirst(pTW_IDENTITY pOrigin, TW_MEMREF pData)
Definition: dsm_ctrl.c:255
TW_UINT16 TWAIN_UserSelect(pTW_IDENTITY pOrigin, TW_MEMREF pData)
Definition: dsm_ctrl.c:433
static TW_UINT16 DSM_currentDevice
Definition: dsm_ctrl.c:38
static struct all_devices * devices
Definition: dsm_ctrl.c:48
static UINT event_message
Definition: dsm_ctrl.c:40
TW_UINT16 TWAIN_GetDSMStatus(pTW_IDENTITY pOrigin, TW_MEMREF pData)
Definition: dsm_ctrl.c:510
TW_UINT16 TWAIN_IdentityGetNext(pTW_IDENTITY pOrigin, TW_MEMREF pData)
Definition: dsm_ctrl.c:272
TW_UINT16 TWAIN_ProcessEvent(pTW_IDENTITY pOrigin, activeDS *pSource, TW_MEMREF pData)
Definition: dsm_ctrl.c:168
static int nrdevices
Definition: dsm_ctrl.c:47
TW_UINT16 TWAIN_OpenDS(pTW_IDENTITY pOrigin, TW_MEMREF pData)
Definition: dsm_ctrl.c:286
TW_UINT16 TWAIN_CloseDSM(pTW_IDENTITY pOrigin, TW_MEMREF pData)
Definition: dsm_ctrl.c:460
static HWND DSM_parent
Definition: dsm_ctrl.c:39
static void twain_autodetect(void)
Definition: dsm_ctrl.c:112
static TW_UINT32 DSM_sourceId
Definition: dsm_ctrl.c:37
TW_UINT16 TWAIN_ControlNull(pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, activeDS *pSource, TW_UINT16 MSG, TW_MEMREF pData)
Definition: dsm_ctrl.c:126
TW_UINT16 TWAIN_OpenDSM(pTW_IDENTITY pOrigin, TW_MEMREF pData)
Definition: dsm_ctrl.c:489
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint index
Definition: glext.h:6031
GLuint64EXT * result
Definition: glext.h:11304
GLfloat param
Definition: glext.h:5796
GLuint id
Definition: glext.h:5910
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
Definition: glfuncs.h:248
unsigned int UINT
Definition: sysinfo.c:13
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
static NTSTATUS *static PWSTR CURDIR *static HMODULE hmod
Definition: security.c:104
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
short WCHAR
Definition: pedump.c:58
#define LB_ERR
Definition: winuser.h:2468
#define MAKEWPARAM(l, h)
Definition: winuser.h:4117
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WM_CLOSE
Definition: winuser.h:1649
#define LB_GETITEMDATA
Definition: winuser.h:2070
UINT WINAPI RegisterWindowMessageA(_In_ LPCSTR)
#define DWLP_USER
Definition: winuser.h:883
#define GetWindowLongPtrW
Definition: winuser.h:4983
#define IDCANCEL
Definition: winuser.h:842
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LBN_DBLCLK
Definition: winuser.h:2107
#define WM_COMMAND
Definition: winuser.h:1768
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_INITDIALOG
Definition: winuser.h:1767
#define LB_ADDSTRING
Definition: winuser.h:2060
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define LB_SETITEMDATA
Definition: winuser.h:2101
#define BN_CLICKED
Definition: winuser.h:1954
#define LB_SETCURSEL
Definition: winuser.h:2099
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define LB_GETCURSEL
Definition: winuser.h:2068
#define SetWindowLongPtrW
Definition: winuser.h:5512
#define PM_NOREMOVE
Definition: winuser.h:1206
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
strcpy
Definition: string.h:131
int int static __inline const char * wine_dbgstr_a(const char *s)
Definition: debug.h:160
#define TRACE(s)
Definition: solgame.cpp:4
TW_STR32 Manufacturer
Definition: twain.h:262
TW_STR32 ProductName
Definition: twain.h:264
TW_STR32 ProductFamily
Definition: twain.h:263
TW_UINT32 SupportedGroups
Definition: twain.h:261
TW_UINT16 ProtocolMinor
Definition: twain.h:260
TW_UINT16 ProtocolMajor
Definition: twain.h:259
TW_UINT32 Id
Definition: twain.h:257
TW_UINT16 ConditionCode
Definition: twain.h:352
WCHAR * modname
Definition: dsm_ctrl.c:43
TW_IDENTITY identity
Definition: dsm_ctrl.c:44
Definition: filter.c:185
Definition: list.h:15
Definition: tftpd.h:60
struct list entry
Definition: performance.c:91
DMUS_PMSG msg
Definition: performance.c:92
HWND ui_window
Definition: twain_i.h:44
DSENTRYPROC dsEntry
Definition: twain_i.h:42
struct tagActiveDS * next
Definition: twain_i.h:39
TW_IDENTITY identity
Definition: twain_i.h:40
struct list pending_messages
Definition: twain_i.h:43
HMODULE hmod
Definition: twain_i.h:41
HWND event_window
Definition: twain_i.h:45
pTW_IDENTITY result
Definition: dsm_ctrl.c:354
pTW_IDENTITY origin
Definition: dsm_ctrl.c:353
#define LIST_ENTRY(type)
Definition: queue.h:175
TW_UINT16 DSM_twCC
Definition: twain32_main.c:32
HINSTANCE DSM_hinstance
Definition: twain32_main.c:34
activeDS * activeSources
Definition: twain32_main.c:33
#define TWRC_FAILURE
Definition: twain.h:1665
#define TWCC_OPERATIONERROR
Definition: twain.h:1683
#define DAT_IDENTITY
Definition: twain.h:1337
#define TWCC_SEQERROR
Definition: twain.h:1687
#define MSG_OPENDS
Definition: twain.h:1409
#define TWON_PROTOCOLMINOR
Definition: twain.h:69
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
#define MSG_XFERREADY
Definition: twain.h:1395
struct TW_STATUS * pTW_STATUS
#define MSG_CLOSEDS
Definition: twain.h:1410
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define TWRC_DSEVENT
Definition: twain.h:1668
unsigned short TW_UINT16
Definition: twain.h:119
#define TWCC_NODS
Definition: twain.h:1681
#define TWRC_ENDOFLIST
Definition: twain.h:1671
#define TWRC_CANCEL
Definition: twain.h:1667
ULONG TW_UINT32
Definition: twain.h:120
#define TWRC_SUCCESS
Definition: twain.h:1664
#define MSG_NULL
Definition: twain.h:1381
#define MSG_DEVICEEVENT
Definition: twain.h:1399
#define TWRC_NOTDSEVENT
Definition: twain.h:1669
struct TW_IDENTITY * pTW_IDENTITY
Definition: twain.h:1762
#define MSG_GET
Definition: twain.h:1385
#define TWCC_BADPROTOCOL
Definition: twain.h:1685
#define MSG_CLOSEDSREQ
Definition: twain.h:1396
#define DG_CONTROL
Definition: twain.h:1311
#define TWCC_SUCCESS
Definition: twain.h:1678
#define TWCC_LOWMEMORY
Definition: twain.h:1680
#define TWON_PROTOCOLMAJOR
Definition: twain.h:70
int32_t INT_PTR
Definition: typedefs.h:64
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023