diff --git a/dlls/mmsystem.dll16/Makefile.in b/dlls/mmsystem.dll16/Makefile.in index eb6c6f62764..8e20cac52b4 100644 --- a/dlls/mmsystem.dll16/Makefile.in +++ b/dlls/mmsystem.dll16/Makefile.in @@ -8,6 +8,7 @@ IMPORTS = winmm user32 kernel32 EXTRADLLFLAGS = -Wb,--subsystem,win16,--main-module,winmm.dll C_SRCS = \ + driver.c \ mci16.c \ message16.c \ mmio16.c \ diff --git a/dlls/user32/driver16.c b/dlls/mmsystem.dll16/driver.c similarity index 77% rename from dlls/user32/driver16.c rename to dlls/mmsystem.dll16/driver.c index 439fd3c6b25..d3d98827f1c 100644 --- a/dlls/user32/driver16.c +++ b/dlls/mmsystem.dll16/driver.c @@ -41,7 +41,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(driver); typedef struct tagWINE_DRIVER { - char szAliasName[128]; /* as usual LPWINE_DRIVER == hDriver32 */ HDRVR16 hDriver16; HMODULE16 hModule16; @@ -54,30 +53,6 @@ typedef struct tagWINE_DRIVER 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] * @@ -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, - LPARAM lParam2) +LRESULT WINAPI DrvSendMessage16(HDRVR16 hDriver, UINT16 msg, LPARAM lParam1, LPARAM lParam2) { LPWINE_DRIVER lpDrv; LRESULT retval = 0; @@ -262,7 +236,6 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam2) lpDrv->dwDriverID = 0; while (DRIVER_FindFromHDrvr16(++DRIVER_hDrvr16Counter)); lpDrv->hDriver16 = DRIVER_hDrvr16Counter; - lstrcpynA(lpDrv->szAliasName, lpSFN, sizeof(lpDrv->szAliasName)); lpDrv->hModule16 = hModule; lpDrv->lpDrvProc = lpProc; @@ -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; char drvName[128]; @@ -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; @@ -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; HMODULE16 hModule = 0; @@ -348,10 +321,10 @@ HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDrvr) } /************************************************************************** - * DefDriverProc (USER.255) + * DrvDefDriverProc (MMSYSTEM.1104) */ -LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, - LPARAM lParam1, LPARAM lParam2) +LRESULT WINAPI DrvDefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, + LPARAM lParam1, LPARAM lParam2) { TRACE("devID=0x%08x hDrv=0x%04x wMsg=%04x lP1=0x%08lx lP2=0x%08lx\n", dwDevID, hDriv, wMsg, lParam1, lParam2); @@ -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; - 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; + return DrvDefDriverProc16(dwDevID, hDrv, wMsg, dwParam1, dwParam2); } diff --git a/dlls/mmsystem.dll16/mmsystem.c b/dlls/mmsystem.dll16/mmsystem.c index 5f193e7c5e6..37db0eb74bc 100644 --- a/dlls/mmsystem.dll16/mmsystem.c +++ b/dlls/mmsystem.dll16/mmsystem.c @@ -2221,59 +2221,7 @@ void WINAPI WMMMidiRunOnce16(void) 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 # diff --git a/dlls/user32/Makefile.in b/dlls/user32/Makefile.in index c6947f1691b..953f6eb4229 100644 --- a/dlls/user32/Makefile.in +++ b/dlls/user32/Makefile.in @@ -27,7 +27,6 @@ C_SRCS = \ dialog.c \ dialog16.c \ driver.c \ - driver16.c \ edit.c \ exticon.c \ focus.c \ diff --git a/dlls/user32/user16.c b/dlls/user32/user16.c index f34ae578417..6060a509bc2 100644 --- a/dlls/user32/user16.c +++ b/dlls/user32/user16.c @@ -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) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index d500f8db579..acd95dcfd11 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -775,15 +775,10 @@ # Wine extensions: Win16 functions that are needed by other dlls # @ stdcall CallWindowProc16(long long long long long) -@ stdcall CloseDriver16(long long long) @ stdcall CreateDialogIndirectParam16(long ptr long long long) -@ stdcall DefDriverProc16(long long long long long) @ stdcall DefWindowProc16(long long long long) @ stdcall DestroyIcon32(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