Commit 2a64c6b1 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Move driver support to mmsystem and replace it with stubs in user.exe.

parent dd64dd55
...@@ -8,6 +8,7 @@ IMPORTS = winmm user32 kernel32 ...@@ -8,6 +8,7 @@ IMPORTS = winmm user32 kernel32
EXTRADLLFLAGS = -Wb,--subsystem,win16,--main-module,winmm.dll EXTRADLLFLAGS = -Wb,--subsystem,win16,--main-module,winmm.dll
C_SRCS = \ C_SRCS = \
driver.c \
mci16.c \ mci16.c \
message16.c \ message16.c \
mmio16.c \ mmio16.c \
......
...@@ -41,7 +41,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(driver); ...@@ -41,7 +41,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(driver);
typedef struct tagWINE_DRIVER typedef struct tagWINE_DRIVER
{ {
char szAliasName[128];
/* as usual LPWINE_DRIVER == hDriver32 */ /* as usual LPWINE_DRIVER == hDriver32 */
HDRVR16 hDriver16; HDRVR16 hDriver16;
HMODULE16 hModule16; HMODULE16 hModule16;
...@@ -55,30 +54,6 @@ static LPWINE_DRIVER lpDrvItemList = NULL; ...@@ -55,30 +54,6 @@ static LPWINE_DRIVER lpDrvItemList = NULL;
/************************************************************************** /**************************************************************************
* LoadStartupDrivers [internal]
*/
#if 0
static void DRIVER_LoadStartupDrivers(void)
{
char str[256];
if (GetPrivateProfileStringA("drivers", NULL, "", str, sizeof(str), "SYSTEM.INI") < 2) {
ERR("Can't find drivers section in system.ini\n");
} else {
HDRVR16 hDrv;
LPSTR ptr;
for (ptr = str; *ptr; ptr += strlen(ptr) + 1) {
TRACE("str='%s'\n", ptr);
hDrv = OpenDriver16(ptr, "drivers", 0L);
TRACE("hDrv=%04x\n", hDrv);
}
TRACE("end of list !\n");
}
}
#endif
/**************************************************************************
* DRIVER_GetNumberOfModuleRefs [internal] * DRIVER_GetNumberOfModuleRefs [internal]
* *
* Returns the number of open drivers which share the same module. * Returns the number of open drivers which share the same module.
...@@ -138,10 +113,9 @@ static inline LRESULT DRIVER_SendMessage(LPWINE_DRIVER lpDrv, UINT16 msg, ...@@ -138,10 +113,9 @@ static inline LRESULT DRIVER_SendMessage(LPWINE_DRIVER lpDrv, UINT16 msg,
} }
/************************************************************************** /**************************************************************************
* SendDriverMessage (USER.251) * DrvSendMessage (MMSYSTEM.1102)
*/ */
LRESULT WINAPI SendDriverMessage16(HDRVR16 hDriver, UINT16 msg, LPARAM lParam1, LRESULT WINAPI DrvSendMessage16(HDRVR16 hDriver, UINT16 msg, LPARAM lParam1, LPARAM lParam2)
LPARAM lParam2)
{ {
LPWINE_DRIVER lpDrv; LPWINE_DRIVER lpDrv;
LRESULT retval = 0; LRESULT retval = 0;
...@@ -262,7 +236,6 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam2) ...@@ -262,7 +236,6 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam2)
lpDrv->dwDriverID = 0; lpDrv->dwDriverID = 0;
while (DRIVER_FindFromHDrvr16(++DRIVER_hDrvr16Counter)); while (DRIVER_FindFromHDrvr16(++DRIVER_hDrvr16Counter));
lpDrv->hDriver16 = DRIVER_hDrvr16Counter; lpDrv->hDriver16 = DRIVER_hDrvr16Counter;
lstrcpynA(lpDrv->szAliasName, lpSFN, sizeof(lpDrv->szAliasName));
lpDrv->hModule16 = hModule; lpDrv->hModule16 = hModule;
lpDrv->lpDrvProc = lpProc; lpDrv->lpDrvProc = lpProc;
...@@ -277,9 +250,9 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam2) ...@@ -277,9 +250,9 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam2)
} }
/************************************************************************** /**************************************************************************
* OpenDriver (USER.252) * DrvOpen (MMSYSTEM.1100)
*/ */
HDRVR16 WINAPI OpenDriver16(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam2) HDRVR16 WINAPI DrvOpen16(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam2)
{ {
LPWINE_DRIVER lpDrv = NULL; LPWINE_DRIVER lpDrv = NULL;
char drvName[128]; char drvName[128];
...@@ -310,9 +283,9 @@ HDRVR16 WINAPI OpenDriver16(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lP ...@@ -310,9 +283,9 @@ HDRVR16 WINAPI OpenDriver16(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lP
} }
/************************************************************************** /**************************************************************************
* CloseDriver (USER.253) * DrvClose16 (MMSYSTEM.1101)
*/ */
LRESULT WINAPI CloseDriver16(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2) LRESULT WINAPI DrvClose16(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2)
{ {
LPWINE_DRIVER lpDrv; LPWINE_DRIVER lpDrv;
...@@ -331,9 +304,9 @@ LRESULT WINAPI CloseDriver16(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2) ...@@ -331,9 +304,9 @@ LRESULT WINAPI CloseDriver16(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2)
} }
/************************************************************************** /**************************************************************************
* GetDriverModuleHandle (USER.254) * DrvGetModuleHandle (MMSYSTEM.1103)
*/ */
HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDrvr) HMODULE16 WINAPI DrvGetModuleHandle16(HDRVR16 hDrvr)
{ {
LPWINE_DRIVER lpDrv; LPWINE_DRIVER lpDrv;
HMODULE16 hModule = 0; HMODULE16 hModule = 0;
...@@ -348,10 +321,10 @@ HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDrvr) ...@@ -348,10 +321,10 @@ HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDrvr)
} }
/************************************************************************** /**************************************************************************
* DefDriverProc (USER.255) * DrvDefDriverProc (MMSYSTEM.1104)
*/ */
LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, LRESULT WINAPI DrvDefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg,
LPARAM lParam1, LPARAM lParam2) LPARAM lParam1, LPARAM lParam2)
{ {
TRACE("devID=0x%08x hDrv=0x%04x wMsg=%04x lP1=0x%08lx lP2=0x%08lx\n", TRACE("devID=0x%08x hDrv=0x%04x wMsg=%04x lP1=0x%08lx lP2=0x%08lx\n",
dwDevID, hDriv, wMsg, lParam1, lParam2); dwDevID, hDriv, wMsg, lParam1, lParam2);
...@@ -378,63 +351,10 @@ LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, ...@@ -378,63 +351,10 @@ LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg,
} }
/************************************************************************** /**************************************************************************
* GetDriverInfo (USER.256) * DriverProc (MMSYSTEM.6)
*/ */
BOOL16 WINAPI GetDriverInfo16(HDRVR16 hDrvr, LPDRIVERINFOSTRUCT16 lpDrvInfo) LRESULT WINAPI DriverProc16(DWORD dwDevID, HDRVR16 hDrv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{ {
LPWINE_DRIVER lpDrv; return DrvDefDriverProc16(dwDevID, hDrv, wMsg, dwParam1, dwParam2);
BOOL16 ret = FALSE;
TRACE("(%04x, %p);\n", hDrvr, lpDrvInfo);
if (lpDrvInfo == NULL || lpDrvInfo->length != sizeof(DRIVERINFOSTRUCT16))
return FALSE;
if ((lpDrv = DRIVER_FindFromHDrvr16(hDrvr)) != NULL) {
lpDrvInfo->hDriver = lpDrv->hDriver16;
lpDrvInfo->hModule = lpDrv->hModule16;
lstrcpynA(lpDrvInfo->szAliasName, lpDrv->szAliasName, sizeof(lpDrvInfo->szAliasName));
ret = TRUE;
}
return ret;
}
/**************************************************************************
* GetNextDriver (USER.257)
*/
HDRVR16 WINAPI GetNextDriver16(HDRVR16 hDrvr, DWORD dwFlags)
{
HDRVR16 hRetDrv = 0;
LPWINE_DRIVER lpDrv;
TRACE("(%04x, %08X);\n", hDrvr, dwFlags);
if (hDrvr == 0) {
if (lpDrvItemList == NULL) {
FIXME("drivers list empty !\n");
/* FIXME: code was using DRIVER_LoadStartupDrivers(); before ?
* I (EPP) don't quite understand this
*/
if (lpDrvItemList == NULL)
return 0;
}
lpDrv = lpDrvItemList;
if (dwFlags & GND_REVERSE) {
while (lpDrv->lpNextItem)
lpDrv = lpDrv->lpNextItem;
}
} else {
if ((lpDrv = DRIVER_FindFromHDrvr16(hDrvr)) != NULL) {
if (dwFlags & GND_REVERSE) {
lpDrv = (lpDrv->lpPrevItem) ? lpDrv->lpPrevItem : NULL;
} else {
lpDrv = (lpDrv->lpNextItem) ? lpDrv->lpNextItem : NULL;
}
}
}
hRetDrv = (lpDrv) ? lpDrv->hDriver16 : 0;
TRACE("return %04x !\n", hRetDrv);
return hRetDrv;
} }
...@@ -2221,59 +2221,7 @@ void WINAPI WMMMidiRunOnce16(void) ...@@ -2221,59 +2221,7 @@ void WINAPI WMMMidiRunOnce16(void)
FIXME("(), stub!\n"); FIXME("(), stub!\n");
} }
/**************************************************************************
* DrvOpen [MMSYSTEM.1100]
*/
HDRVR16 WINAPI DrvOpen16(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam)
{
return OpenDriver16(lpDriverName, lpSectionName, lParam);
}
/**************************************************************************
* DrvClose [MMSYSTEM.1101]
*/
LRESULT WINAPI DrvClose16(HDRVR16 hDrv, LPARAM lParam1, LPARAM lParam2)
{
return CloseDriver16(hDrv, lParam1, lParam2);
}
/**************************************************************************
* DrvSendMessage [MMSYSTEM.1102]
*/
LRESULT WINAPI DrvSendMessage16(HDRVR16 hDrv, WORD msg, LPARAM lParam1,
LPARAM lParam2)
{
return SendDriverMessage16(hDrv, msg, lParam1, lParam2);
}
/**************************************************************************
* DrvGetModuleHandle [MMSYSTEM.1103]
*/
HANDLE16 WINAPI DrvGetModuleHandle16(HDRVR16 hDrv)
{
return GetDriverModuleHandle16(hDrv);
}
/**************************************************************************
* DrvDefDriverProc [MMSYSTEM.1104]
*/
LRESULT WINAPI DrvDefDriverProc16(DWORD dwDriverID, HDRVR16 hDrv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
return DefDriverProc16(dwDriverID, hDrv, wMsg, dwParam1, dwParam2);
}
/**************************************************************************
* DriverProc [MMSYSTEM.6]
*/
LRESULT WINAPI DriverProc16(DWORD dwDevID, HDRVR16 hDrv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
TRACE("dwDevID=%08x hDrv=%04x wMsg=%04x dwParam1=%08x dwParam2=%08x\n",
dwDevID, hDrv, wMsg, dwParam1, dwParam2);
return DrvDefDriverProc16(dwDevID, hDrv, wMsg, dwParam1, dwParam2);
}
/* ################################################### /* ###################################################
* # JOYSTICK # * # JOYSTICK #
......
...@@ -27,7 +27,6 @@ C_SRCS = \ ...@@ -27,7 +27,6 @@ C_SRCS = \
dialog.c \ dialog.c \
dialog16.c \ dialog16.c \
driver.c \ driver.c \
driver16.c \
edit.c \ edit.c \
exticon.c \ exticon.c \
focus.c \ focus.c \
......
...@@ -946,6 +946,80 @@ UINT16 WINAPI GetMenuState16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags ) ...@@ -946,6 +946,80 @@ UINT16 WINAPI GetMenuState16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags )
} }
/**************************************************************************
* SendDriverMessage (USER.251)
*/
LRESULT WINAPI SendDriverMessage16(HDRVR16 hDriver, UINT16 msg, LPARAM lParam1,
LPARAM lParam2)
{
FIXME("(%04x, %04x, %08lx, %08lx): stub\n", hDriver, msg, lParam1, lParam2);
return 0;
}
/**************************************************************************
* OpenDriver (USER.252)
*/
HDRVR16 WINAPI OpenDriver16(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam2)
{
FIXME( "(%s, %s, %08lx): stub\n", debugstr_a(lpDriverName), debugstr_a(lpSectionName), lParam2);
return 0;
}
/**************************************************************************
* CloseDriver (USER.253)
*/
LRESULT WINAPI CloseDriver16(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2)
{
FIXME( "(%04x, %08lx, %08lx): stub\n", hDrvr, lParam1, lParam2);
return FALSE;
}
/**************************************************************************
* GetDriverModuleHandle (USER.254)
*/
HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDrvr)
{
FIXME("(%04x): stub\n", hDrvr);
return 0;
}
/**************************************************************************
* DefDriverProc (USER.255)
*/
LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg,
LPARAM lParam1, LPARAM lParam2)
{
FIXME( "devID=0x%08x hDrv=0x%04x wMsg=%04x lP1=0x%08lx lP2=0x%08lx: stub\n",
dwDevID, hDriv, wMsg, lParam1, lParam2);
return 0;
}
/**************************************************************************
* GetDriverInfo (USER.256)
*/
struct DRIVERINFOSTRUCT16;
BOOL16 WINAPI GetDriverInfo16(HDRVR16 hDrvr, struct DRIVERINFOSTRUCT16 *lpDrvInfo)
{
FIXME( "(%04x, %p): stub\n", hDrvr, lpDrvInfo);
return FALSE;
}
/**************************************************************************
* GetNextDriver (USER.257)
*/
HDRVR16 WINAPI GetNextDriver16(HDRVR16 hDrvr, DWORD dwFlags)
{
FIXME( "(%04x, %08x): stub\n", hDrvr, dwFlags);
return 0;
}
/********************************************************************** /**********************************************************************
* GetMenuItemCount (USER.263) * GetMenuItemCount (USER.263)
*/ */
......
...@@ -775,15 +775,10 @@ ...@@ -775,15 +775,10 @@
# Wine extensions: Win16 functions that are needed by other dlls # Wine extensions: Win16 functions that are needed by other dlls
# #
@ stdcall CallWindowProc16(long long long long long) @ stdcall CallWindowProc16(long long long long long)
@ stdcall CloseDriver16(long long long)
@ stdcall CreateDialogIndirectParam16(long ptr long long long) @ stdcall CreateDialogIndirectParam16(long ptr long long long)
@ stdcall DefDriverProc16(long long long long long)
@ stdcall DefWindowProc16(long long long long) @ stdcall DefWindowProc16(long long long long)
@ stdcall DestroyIcon32(long long) @ stdcall DestroyIcon32(long long)
@ stdcall DialogBoxIndirectParam16(long long long long long) @ stdcall DialogBoxIndirectParam16(long long long long long)
@ stdcall GetDriverModuleHandle16(long)
@ stdcall OpenDriver16(str str long)
@ stdcall SendDriverMessage16(long long long long)
################################################################ ################################################################
# Wine dll separation hacks, these will go away, don't use them # Wine dll separation hacks, these will go away, don't use them
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment