Removed unnecessary code in the 16-bit DllEntryPoint function of some

dlls, and also fixed its ordinal in a few places.
This commit is contained in:
Alexandre Julliard 2005-05-23 10:00:26 +00:00
parent b9ecbb6167
commit 0ddd30b0b6
12 changed files with 13 additions and 142 deletions

View File

@ -23,7 +23,6 @@ C_SRCS16 = \
filedlg16.c \
finddlg.c \
fontdlg16.c \
generic.c \
printdlg16.c
SPEC_SRCS16 = commdlg.spec

View File

@ -24,4 +24,3 @@
#29 pascal DWLBSUBCLASS exported, shared data
#30 pascal DWUPARROWHACK exported, shared data
#31 pascal DWOKSUBCLASS exported, shared data
32 pascal DllEntryPoint(long word word word long word) COMMDLG_DllEntryPoint

View File

@ -1,63 +0,0 @@
/*
* COMMDLG/COMDLG32 functions
*
* Copyright 1994 Martin Ayotte
* Copyright 1996 Albrecht Kleine
* Copyright 1998,1999 Bertho Stultiens
* Copyright 1999 Klaas van Gend
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "commdlg.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#include "cdlg.h"
#include "cdlg16.h"
/***********************************************************************
* DllEntryPoint [COMMDLG.32]
*
* Initialization code for the COMMDLG DLL
*
* RETURNS:
*/
BOOL WINAPI COMMDLG_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD HeapSize, DWORD res1, WORD res2)
{
TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2);
return TRUE;
}
/***********************************************************************
* CommDlgExtendedError16 [COMMDLG.26]
*
* Get the last error value if a commdlg function fails.
* RETURNS
* Current error value which might not be valid
* if a previous call succeeded.
*/
DWORD WINAPI CommDlgExtendedError16(void)
{
return CommDlgExtendedError();
}

View File

@ -1,6 +1,7 @@
1 stub WEP
# 1 stub WEP
2 stub DRIVERPROC
3 stub ___EXPORTEDSTUB
3 pascal DllEntryPoint(long word word word long word) MSACM_DllEntryPoint
4 stub ___EXPORTEDSTUB
7 pascal acmGetVersion() acmGetVersion16
8 pascal -ret16 acmMetrics(word word ptr) acmMetrics16
10 pascal -ret16 acmDriverEnum(ptr long long) acmDriverEnum16
@ -37,4 +38,3 @@
201 stub ACMCLOSECONVERSION
202 stub ACMCONVERT
203 stub ACMCHOOSEFORMAT
255 pascal DllEntryPoint(long word word word long word) MSACM_DllEntryPoint

View File

@ -34,7 +34,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(msacm);
/**************************************************************************
* DllEntryPoint (MSACM.255)
* DllEntryPoint (MSACM.3)
*
* MSACM DLL entry point
*
@ -42,25 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msacm);
BOOL WINAPI MSACM_DllEntryPoint(DWORD fdwReason, HINSTANCE16 hinstDLL, WORD ds,
WORD wHeapSize, DWORD dwReserved1, WORD wReserved2)
{
static HANDLE hndl;
TRACE("0x%x 0x%lx\n", hinstDLL, fdwReason);
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
if (!hndl && !(hndl = LoadLibraryA("MSACM32.DLL"))) {
ERR("Could not load sibling MsAcm32.dll\n");
return FALSE;
}
break;
case DLL_PROCESS_DETACH:
FreeLibrary(hndl);
hndl = 0;
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}

View File

@ -1,4 +1,6 @@
#1 pascal WEP(word)
2 pascal VideoForWindowsVersion() VideoForWindowsVersion
3 pascal DllEntryPoint(long word word word long word) VIDEO_LibMain
20 stub VIDEOGETNUMDEVS
21 stub VIDEOGETERRORTEXT
22 pascal VideoCapDriverDescAndVer(word ptr word ptr word) VideoCapDriverDescAndVer16
@ -64,5 +66,3 @@
251 stub _MCIWNDREGISTERCLASS
252 stub GETOPENFILENAMEPREVIEW
253 stub GETSAVEFILENAMEPREVIEW
300 pascal DllEntryPoint(long word word word long word) VIDEO_LibMain

View File

@ -884,7 +884,7 @@ static LRESULT CALLBACK IC_CallTo16(HDRVR hdrv, HIC hic, UINT msg, LPARAM lp1,
}
/**************************************************************************
* DllEntryPoint (MSVIDEO.300)
* DllEntryPoint (MSVIDEO.3)
*
* MSVIDEO DLL entry point
*

View File

@ -50,9 +50,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
HINSTANCE16 COMPOBJ_hInstance = 0;
static int COMPOBJ_Attach = 0;
HTASK16 hETask = 0;
WORD Table_ETask[62];
@ -512,16 +509,5 @@ HRESULT WINAPI CoGetState16(LPDWORD state)
BOOL WINAPI COMPOBJ_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD HeapSize, DWORD res1, WORD res2)
{
TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2);
switch(Reason)
{
case DLL_PROCESS_ATTACH:
if (!COMPOBJ_Attach++) COMPOBJ_hInstance = hInst;
break;
case DLL_PROCESS_DETACH:
if(!--COMPOBJ_Attach)
COMPOBJ_hInstance = 0;
break;
}
return TRUE;
}

View File

@ -305,7 +305,7 @@ RETERR16 WINAPI VcpOpen16(VIFPROC vifproc, LPARAM lparamMsgRef)
VCP_MsgRef = lparamMsgRef;
/* load SETUPAPI needed for dialog resources etc. */
SETUPAPI_hInstance = LoadLibraryA("setupapi.dll");
SETUPAPI_hInstance = GetModuleHandleA("setupapi.dll");
if (!SETUPAPI_hInstance)
{
ERR("Could not load sibling setupapi.dll\n");
@ -555,7 +555,6 @@ RETERR16 WINAPI VcpClose16(WORD fl, LPCSTR lpszBackupDest)
cbres = VCP_Callback(&vcp_status, VCPM_VSTATCLOSEEND, 0, 0, VCP_MsgRef);
TRACE("#6\n");
VCP_Proc = NULL;
FreeLibrary(SETUPAPI_hInstance);
VCP_opened = FALSE;
return OK;
}

View File

@ -70,9 +70,6 @@ static HHOOK SHELL_hHook = 0;
static UINT uMsgWndCreated = 0;
static UINT uMsgWndDestroyed = 0;
static UINT uMsgShellActivate = 0;
HINSTANCE16 SHELL_hInstance = 0;
HINSTANCE SHELL_hInstance32;
static int SHELL_Attach = 0;
/***********************************************************************
* DllEntryPoint [SHELL.101]
@ -87,33 +84,6 @@ static int SHELL_Attach = 0;
BOOL WINAPI SHELL_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst,
WORD ds, WORD HeapSize, DWORD res1, WORD res2)
{
TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n",
Reason, hInst, ds, HeapSize, res1, res2);
switch(Reason)
{
case DLL_PROCESS_ATTACH:
if (SHELL_Attach++) break;
SHELL_hInstance = hInst;
if(!SHELL_hInstance32)
{
if(!(SHELL_hInstance32 = LoadLibraryA("shell32.dll")))
{
ERR("Could not load sibling shell32.dll\n");
return FALSE;
}
}
break;
case DLL_PROCESS_DETACH:
if(!--SHELL_Attach)
{
SHELL_hInstance = 0;
if(SHELL_hInstance32)
FreeLibrary(SHELL_hInstance32);
}
break;
}
return TRUE;
}

View File

@ -59,7 +59,7 @@ static LRESULT MMIO_Callback16(SEGPTR, LPMMIOINFO, UINT, LPARAM, LPARAM
*/
/**************************************************************************
* DllEntryPoint (MMSYSTEM.2046)
* DllEntryPoint (MMSYSTEM.4)
*
* MMSYSTEM DLL entry point
*
@ -74,7 +74,7 @@ BOOL WINAPI MMSYSTEM_LibMain(DWORD fdwReason, HINSTANCE hinstDLL, WORD ds,
/* need to load WinMM in order to:
* - initiate correctly shared variables (WINMM_Init())
*/
if (!GetModuleHandleA("WINMM.DLL") && !LoadLibraryA("WINMM.DLL"))
if (!GetModuleHandleA("WINMM.DLL"))
{
ERR("Could not load sibling WinMM.dll\n");
return FALSE;
@ -114,7 +114,7 @@ BOOL WINAPI MMSYSTEM_LibMain(DWORD fdwReason, HINSTANCE hinstDLL, WORD ds,
int WINAPI MMSYSTEM_WEP(HINSTANCE16 hInstance, WORD wDataSeg,
WORD cbHeapSize, LPSTR lpCmdLine)
{
FIXME("STUB: Unloading MMSystem DLL ... hInst=%04X \n", hInstance);
TRACE("STUB: Unloading MMSystem DLL ... hInst=%04X \n", hInstance);
return TRUE;
}

View File

@ -1,6 +1,7 @@
#1 pascal MMSYSTEM_WEP(word word word ptr) MMSYSTEM_WEP
1 pascal WEP(word word word ptr) MMSYSTEM_WEP
2 pascal sndPlaySound(ptr word) sndPlaySound16
3 pascal PlaySound(ptr word long) PlaySound16
4 pascal DllEntryPoint(long word word word long word) MMSYSTEM_LibMain
5 pascal mmsystemGetVersion() mmsystemGetVersion16
6 pascal DriverProc(long word word long long) DriverProc16
8 pascal WMMMidiRunOnce() WMMMidiRunOnce16
@ -171,6 +172,5 @@
#2005 stub MCIGETTHUNKTABLE
#2006 stub WINMMSL_THUNKDATA16
2046 pascal DllEntryPoint(long word word word long word) MMSYSTEM_LibMain
# these are Wine only exported functions. Is there another way to do it ?
2047 pascal __wine_mmThreadEntryPoint(long) WINE_mmThreadEntryPoint