Alexandre Julliard : twain_32: Remove an unnecessary DllMain entry point.
Alexandre Julliard
julliard at winehq.org
Thu Feb 14 15:01:33 CST 2013
Module: wine
Branch: master
Commit: 731a3fea91c13082d0d051274f34acc2a9df7c34
URL: http://source.winehq.org/git/wine.git/?a=commit;h=731a3fea91c13082d0d051274f34acc2a9df7c34
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Feb 14 21:35:40 2013 +0100
twain_32: Remove an unnecessary DllMain entry point.
---
dlls/twain_32/dsm_ctrl.c | 14 +++++---------
dlls/twain_32/twain32_main.c | 19 -------------------
dlls/twain_32/twain_i.h | 1 -
3 files changed, 5 insertions(+), 29 deletions(-)
diff --git a/dlls/twain_32/dsm_ctrl.c b/dlls/twain_32/dsm_ctrl.c
index b50dbc5..db57d08 100644
--- a/dlls/twain_32/dsm_ctrl.c
+++ b/dlls/twain_32/dsm_ctrl.c
@@ -207,7 +207,7 @@ TW_UINT16 TWAIN_OpenDS (pTW_IDENTITY pOrigin, TW_MEMREF pData)
TRACE("DG_CONTROL/DAT_IDENTITY/MSG_OPENDS\n");
TRACE("pIdentity is %s\n", pIdentity->ProductName);
- if (DSM_currentState != 3) {
+ if (!DSM_initialized) {
FIXME("seq error\n");
DSM_twCC = TWCC_SEQERROR;
return TWRC_FAILURE;
@@ -281,10 +281,9 @@ TW_UINT16 TWAIN_CloseDSM (pTW_IDENTITY pOrigin, TW_MEMREF pData)
TRACE("DG_CONTROL/DAT_PARENT/MSG_CLOSEDSM\n");
- if (DSM_currentState == 3)
+ if (DSM_initialized)
{
DSM_initialized = FALSE;
- DSM_currentState = 2;
/* If there are data sources still open, close them now. */
while (currentDS != NULL)
@@ -309,12 +308,9 @@ TW_UINT16 TWAIN_OpenDSM (pTW_IDENTITY pOrigin, TW_MEMREF pData)
TW_UINT16 twRC = TWRC_SUCCESS;
TRACE("DG_CONTROL/DAT_PARENT/MSG_OPENDSM\n");
- if (DSM_currentState == 2) {
- if (!DSM_initialized) {
- DSM_currentDevice = 0;
- DSM_initialized = TRUE;
- }
- DSM_currentState = 3;
+ if (!DSM_initialized) {
+ DSM_currentDevice = 0;
+ DSM_initialized = TRUE;
DSM_twCC = TWCC_SUCCESS;
twRC = TWRC_SUCCESS;
} else {
diff --git a/dlls/twain_32/twain32_main.c b/dlls/twain_32/twain32_main.c
index 9eb2754..f7b8f58 100644
--- a/dlls/twain_32/twain32_main.c
+++ b/dlls/twain_32/twain32_main.c
@@ -43,25 +43,6 @@ static activeDS *TWAIN_LookupSource (const TW_IDENTITY *pDest)
return pSource;
}
-BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
-{
- TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- DisableThreadLibraryCalls(hinstDLL);
- DSM_currentState = 2;
- break;
-
- case DLL_PROCESS_DETACH:
- DSM_currentState = 1;
- break;
- }
-
- return TRUE;
-}
-
static TW_UINT16 TWAIN_SourceManagerHandler (
pTW_IDENTITY pOrigin,
TW_UINT16 DAT,
diff --git a/dlls/twain_32/twain_i.h b/dlls/twain_32/twain_i.h
index ffe6bd9..a8fa2fb 100644
--- a/dlls/twain_32/twain_i.h
+++ b/dlls/twain_32/twain_i.h
@@ -39,7 +39,6 @@ typedef struct tagActiveDS
DSENTRYPROC dsEntry;
} activeDS;
-TW_UINT16 DSM_currentState DECLSPEC_HIDDEN; /* current state of Source Manager */
TW_UINT16 DSM_twCC DECLSPEC_HIDDEN; /* current condition code of Source Manager */
activeDS *activeSources DECLSPEC_HIDDEN; /* list of active data sources */
More information about the wine-cvs
mailing list