twain_32: Notify data sources of their assigned Id.

Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Vincent Povirk 2017-10-20 14:16:25 -05:00 committed by Alexandre Julliard
parent a6ad46dc94
commit 8a118c2e0f
1 changed files with 3 additions and 2 deletions

View File

@ -242,13 +242,14 @@ TW_UINT16 TWAIN_OpenDS (pTW_IDENTITY pOrigin, TW_MEMREF pData)
}
newSource->hmod = hmod;
newSource->dsEntry = (DSENTRYPROC)GetProcAddress(hmod, "DS_Entry");
/* Assign id for the opened data source */
pIdentity->Id = DSM_sourceId ++;
if (TWRC_SUCCESS != newSource->dsEntry (pOrigin, DG_CONTROL, DAT_IDENTITY, MSG_OPENDS, pIdentity)) {
DSM_twCC = TWCC_OPERATIONERROR;
HeapFree(GetProcessHeap(), 0, newSource);
DSM_sourceId--;
return TWRC_FAILURE;
}
/* Assign name and id for the opened data source */
pIdentity->Id = DSM_sourceId ++;
/* add the data source to an internal active source list */
newSource->next = activeSources;
newSource->identity.Id = pIdentity->Id;