From c39a5f0dbae4964f6a796fab467bed20ba4bbc85 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 21 Mar 2006 16:18:24 +0100 Subject: [PATCH] Added DLL_WINE_PREATTACH handling in a number of stub-only dlls. --- dlls/activeds/activeds_main.c | 10 +++++++++- dlls/cfgmgr32/main.c | 16 ++++++++++++++++ dlls/cryptdll/cryptdll.c | 2 ++ dlls/{snmpapi/main.c => d3dim/d3dim_main.c} | 29 ++++++++--------------------- dlls/d3drm/d3drm_main.c | 22 +++++++++++++++++++--- dlls/msnet32/msnet_main.c | 21 +++++++++++++++++++++ dlls/snmpapi/main.c | 2 ++ dlls/{snmpapi/main.c => url/url_main.c} | 29 ++++++++--------------------- dlls/{snmpapi/main.c => vdmdbg/vdmdbg.c} | 29 ++++++++--------------------- dlls/winnls32/winnls.c | 16 ++++++++++++++++ dlls/wintrust/wintrust_main.c | 17 +++++++++++++++++ 11 files changed, 126 insertions(+), 67 deletions(-) copy dlls/{snmpapi/main.c => d3dim/d3dim_main.c} (68%) copy dlls/{snmpapi/main.c => url/url_main.c} (68%) copy dlls/{snmpapi/main.c => vdmdbg/vdmdbg.c} (68%) diff --git a/dlls/activeds/activeds_main.c b/dlls/activeds/activeds_main.c index d010a766dfa..b29674236ed 100644 --- a/dlls/activeds/activeds_main.c +++ b/dlls/activeds/activeds_main.c @@ -48,7 +48,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(activeds); BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { TRACE("(%p, %ld, %p)\n",hinstDLL, fdwReason, lpvReserved); - /* For the moment, do nothing here. */ + + switch(fdwReason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( hinstDLL ); + break; + } return TRUE; } diff --git a/dlls/cfgmgr32/main.c b/dlls/cfgmgr32/main.c index 10757d6fa2e..03129005ec4 100644 --- a/dlls/cfgmgr32/main.c +++ b/dlls/cfgmgr32/main.c @@ -29,6 +29,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(cfgmgr32); +/*********************************************************************** + * DllMain (CFGMGR32.@) + */ +BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) +{ + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( inst ); + break; + } + return TRUE; +} + CONFIGRET WINAPI CM_Get_Device_ID_ListA( PCSTR pszFilter, PCHAR Buffer, ULONG BufferLen, ULONG ulFlags ) { diff --git a/dlls/cryptdll/cryptdll.c b/dlls/cryptdll/cryptdll.c index fcb8589c753..9c9b6d7efdf 100644 --- a/dlls/cryptdll/cryptdll.c +++ b/dlls/cryptdll/cryptdll.c @@ -32,6 +32,8 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) TRACE("%p,%lx,%p\n", hinstDLL, fdwReason, lpvReserved); switch (fdwReason) { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: { DisableThreadLibraryCalls(hinstDLL); diff --git a/dlls/snmpapi/main.c b/dlls/d3dim/d3dim_main.c similarity index 68% copy from dlls/snmpapi/main.c copy to dlls/d3dim/d3dim_main.c index 326e6bc37bf..0c0f022619e 100644 --- a/dlls/snmpapi/main.c +++ b/dlls/d3dim/d3dim_main.c @@ -1,7 +1,5 @@ /* - * Stub implementation of SNMPAPI.DLL - * - * Copyright 2002 Patrik Stridvall + * Copyright 2006 Alexandre Julliard * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,33 +16,22 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "config.h" - #include - #include "windef.h" #include "winbase.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(snmpapi); /*********************************************************************** - * DllMain for SNMPAPI + * DllMain (D3DIM.@) */ -BOOL WINAPI DllMain( - HINSTANCE hInstDLL, - DWORD fdwReason, - LPVOID lpvReserved) +BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) { - TRACE("(%p,%ld,%p)\n", hInstDLL, fdwReason, lpvReserved); - - switch(fdwReason) { + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hInstDLL); - break; - case DLL_PROCESS_DETACH: + DisableThreadLibraryCalls( inst ); break; } - return TRUE; } diff --git a/dlls/d3drm/d3drm_main.c b/dlls/d3drm/d3drm_main.c index ecb71916e1d..caa0f901b4f 100644 --- a/dlls/d3drm/d3drm_main.c +++ b/dlls/d3drm/d3drm_main.c @@ -16,6 +16,22 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(d3drm); +#include +#include "windef.h" +#include "winbase.h" + +/*********************************************************************** + * DllMain (D3DRM.@) + */ +BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) +{ + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( inst ); + break; + } + return TRUE; +} diff --git a/dlls/msnet32/msnet_main.c b/dlls/msnet32/msnet_main.c index 40e9dc4ee61..bc92f453b3b 100644 --- a/dlls/msnet32/msnet_main.c +++ b/dlls/msnet32/msnet_main.c @@ -16,10 +16,31 @@ #include "config.h" +#include + +#include "windef.h" +#include "winbase.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msnet); + +/*********************************************************************** + * DllMain (MSNET32.@) + */ +BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) +{ + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( inst ); + break; + } + return TRUE; +} + /*********************************************************************** * @ (MSNET32.57) */ diff --git a/dlls/snmpapi/main.c b/dlls/snmpapi/main.c index 326e6bc37bf..fda8f354aab 100644 --- a/dlls/snmpapi/main.c +++ b/dlls/snmpapi/main.c @@ -39,6 +39,8 @@ BOOL WINAPI DllMain( TRACE("(%p,%ld,%p)\n", hInstDLL, fdwReason, lpvReserved); switch(fdwReason) { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hInstDLL); break; diff --git a/dlls/snmpapi/main.c b/dlls/url/url_main.c similarity index 68% copy from dlls/snmpapi/main.c copy to dlls/url/url_main.c index 326e6bc37bf..b85e204c12f 100644 --- a/dlls/snmpapi/main.c +++ b/dlls/url/url_main.c @@ -1,7 +1,5 @@ /* - * Stub implementation of SNMPAPI.DLL - * - * Copyright 2002 Patrik Stridvall + * Copyright 2006 Alexandre Julliard * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,33 +16,22 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "config.h" - #include - #include "windef.h" #include "winbase.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(snmpapi); /*********************************************************************** - * DllMain for SNMPAPI + * DllMain (URL.@) */ -BOOL WINAPI DllMain( - HINSTANCE hInstDLL, - DWORD fdwReason, - LPVOID lpvReserved) +BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) { - TRACE("(%p,%ld,%p)\n", hInstDLL, fdwReason, lpvReserved); - - switch(fdwReason) { + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hInstDLL); - break; - case DLL_PROCESS_DETACH: + DisableThreadLibraryCalls( inst ); break; } - return TRUE; } diff --git a/dlls/snmpapi/main.c b/dlls/vdmdbg/vdmdbg.c similarity index 68% copy from dlls/snmpapi/main.c copy to dlls/vdmdbg/vdmdbg.c index 326e6bc37bf..3d272c0eb45 100644 --- a/dlls/snmpapi/main.c +++ b/dlls/vdmdbg/vdmdbg.c @@ -1,7 +1,5 @@ /* - * Stub implementation of SNMPAPI.DLL - * - * Copyright 2002 Patrik Stridvall + * Copyright 2006 Alexandre Julliard * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,33 +16,22 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "config.h" - #include - #include "windef.h" #include "winbase.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(snmpapi); /*********************************************************************** - * DllMain for SNMPAPI + * DllMain (VDMDBG.@) */ -BOOL WINAPI DllMain( - HINSTANCE hInstDLL, - DWORD fdwReason, - LPVOID lpvReserved) +BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) { - TRACE("(%p,%ld,%p)\n", hInstDLL, fdwReason, lpvReserved); - - switch(fdwReason) { + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hInstDLL); - break; - case DLL_PROCESS_DETACH: + DisableThreadLibraryCalls( inst ); break; } - return TRUE; } diff --git a/dlls/winnls32/winnls.c b/dlls/winnls32/winnls.c index 4172fc2f915..892ec1c5ef2 100644 --- a/dlls/winnls32/winnls.c +++ b/dlls/winnls32/winnls.c @@ -23,6 +23,22 @@ #include "wine/winuser16.h" /*********************************************************************** + * DllMain (WINNLS.@) + */ +BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) +{ + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( inst ); + break; + } + return TRUE; +} + +/*********************************************************************** * WINNLSEnableIME (WINNLS.16) */ BOOL WINAPI WINNLSEnableIME16(HWND16 hWnd, BOOL fEnable) diff --git a/dlls/wintrust/wintrust_main.c b/dlls/wintrust/wintrust_main.c index 3d7ac5c2508..09ddfedfdfb 100644 --- a/dlls/wintrust/wintrust_main.c +++ b/dlls/wintrust/wintrust_main.c @@ -32,6 +32,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(wintrust); + +/*********************************************************************** + * DllMain (WINTRUST.@) + */ +BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) +{ + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( inst ); + break; + } + return TRUE; +} + /*********************************************************************** * CryptCATAdminAcquireContext (WINTRUST.@) */ -- 2.11.4.GIT