Commit 240f0939 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Keep on moving 16 bit code out of winmm.

parent fe6c281b
......@@ -565,48 +565,6 @@ HMODULE WINAPI GetDriverModuleHandle(HDRVR hDrvr)
}
/**************************************************************************
* 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);
}
/**************************************************************************
* DefDriverProc [WINMM.@]
* DrvDefDriverProc [WINMM.@]
*/
......@@ -626,15 +584,3 @@ LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR hDrv,
return 0;
}
}
/**************************************************************************
* DriverProc [MMSYSTEM.6]
*/
LRESULT WINAPI DriverProc16(DWORD dwDevID, HDRVR16 hDrv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
TRACE("dwDevID=%08lx hDrv=%04x wMsg=%04x dwParam1=%08lx dwParam2=%08lx\n",
dwDevID, hDrv, wMsg, dwParam1, dwParam2);
return DrvDefDriverProc16(dwDevID, hDrv, wMsg, dwParam1, dwParam2);
}
......@@ -1085,15 +1085,6 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpwstrCommand, LPSTR lpstrRet,
}
/**************************************************************************
* mciSendString [MMSYSTEM.702]
*/
DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrRet,
UINT16 uRetLen, HWND16 hwndCallback)
{
return mciSendStringA(lpstrCommand, lpstrRet, uRetLen, HWND_32(hwndCallback));
}
/**************************************************************************
* mciExecute [WINMM.@]
* mciExecute [MMSYSTEM.712]
*/
......@@ -1116,52 +1107,6 @@ DWORD WINAPI mciExecute(LPCSTR lpstrCommand)
}
/**************************************************************************
* mciLoadCommandResource [MMSYSTEM.705]
*/
UINT16 WINAPI mciLoadCommandResource16(HANDLE16 hInst, LPCSTR resname, UINT16 type)
{
HRSRC hRsrc = 0;
HGLOBAL hMem;
UINT16 ret = MCI_NO_COMMAND_TABLE;
LPWINE_MM_IDATA iData = MULTIMEDIA_GetIData();
TRACE("(%04x, %s, %d)!\n", hInst, resname, type);
/* if file exists "resname.mci", then load resource "resname" from it
* otherwise directly from driver
* We don't support it (who uses this feature ?), but we check anyway
*/
if (!type) {
char buf[128];
OFSTRUCT ofs;
strcat(strcpy(buf, resname), ".mci");
if (OpenFile(buf, &ofs, OF_EXIST) != HFILE_ERROR) {
FIXME("NIY: command table to be loaded from '%s'\n", ofs.szPathName);
}
}
if (!(hRsrc = FindResourceA(hInst, resname, (LPCSTR)RT_RCDATAA))) {
WARN("No command table found in resource\n");
} else if ((hMem = LoadResource(hInst, hRsrc))) {
ret = MCI_SetCommandTable(iData, hMem, type);
} else {
WARN("Couldn't load resource.\n");
}
TRACE("=> %04x\n", ret);
return ret;
}
/**************************************************************************
* mciFreeCommandResource [MMSYSTEM.713]
*/
BOOL16 WINAPI mciFreeCommandResource16(UINT16 uTable)
{
TRACE("(%04x)!\n", uTable);
return MCI_DeleteCommandTable(uTable);
}
/**************************************************************************
* mciLoadCommandResource [WINMM.@]
*
* Strangely, this function only exists as an UNICODE one.
......@@ -1175,12 +1120,15 @@ UINT WINAPI mciLoadCommandResource(HINSTANCE hInst, LPCWSTR resNameW, UINT type)
TRACE("(%04x, %s, %d)!\n", hInst, debugstr_w(resNameW), type);
#if 0
/* if file exists "resname.mci", then load resource "resname" from it
/* if a file named "resname.mci" exits, then load resource "resname" from it
* otherwise directly from driver
* We don't support it (who uses this feature ?), but we check anyway
*/
if (!type) {
#if 0
/* FIXME: we should put this back into order, but I never found a program
* actually using this feature, so we not need it
*/
char buf[128];
OFSTRUCT ofs;
......@@ -1188,8 +1136,8 @@ UINT WINAPI mciLoadCommandResource(HINSTANCE hInst, LPCWSTR resNameW, UINT type)
if (OpenFile(buf, &ofs, OF_EXIST) != HFILE_ERROR) {
FIXME("NIY: command table to be loaded from '%s'\n", ofs.szPathName);
}
}
#endif
}
if (!(hRsrc = FindResourceW(hInst, resNameW, (LPCWSTR)RT_RCDATAA))) {
WARN("No command table found in resource\n");
} else if ((hMem = LoadResource(hInst, hRsrc))) {
......@@ -1201,18 +1149,6 @@ UINT WINAPI mciLoadCommandResource(HINSTANCE hInst, LPCWSTR resNameW, UINT type)
return ret;
}
#if 0
LPSTR resNameA;
UINT ret;
TRACE("(%04x, %s, %d)!\n", hinst, debugstr_w(resNameW), type);
resNameA = HEAP_strdupWtoA(GetProcessHeap(), 0, resNameW);
ret = mciLoadCommandResource16(hinst, resNameA, type);
HeapFree(GetProcessHeap(), 0, resNameA);
return ret;
#endif
/**************************************************************************
* mciFreeCommandResource [WINMM.@]
*/
......
......@@ -38,6 +38,7 @@
#include "wine/mmsystem16.h"
#include "wine/winuser16.h"
#include "winemm.h"
#include "heap.h"
#include "wine/debug.h"
......@@ -2117,3 +2118,161 @@ void WINAPI OutputDebugStr16(
{
OutputDebugStringA( str );
}
/**************************************************************************
* 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=%08lx hDrv=%04x wMsg=%04x dwParam1=%08lx dwParam2=%08lx\n",
dwDevID, hDrv, wMsg, dwParam1, dwParam2);
return DrvDefDriverProc16(dwDevID, hDrv, wMsg, dwParam1, dwParam2);
}
/**************************************************************************
* timeGetSystemTime [MMSYSTEM.601]
*/
MMRESULT16 WINAPI timeGetSystemTime16(LPMMTIME16 lpTime, UINT16 wSize)
{
TRACE("(%p, %u);\n", lpTime, wSize);
if (wSize >= sizeof(*lpTime)) {
lpTime->wType = TIME_MS;
lpTime->u.ms = TIME_MMTimeStart()->mmSysTimeMS;
TRACE("=> %lu\n", lpTime->u.ms);
}
return 0;
}
/**************************************************************************
* timeSetEvent [MMSYSTEM.602]
*/
MMRESULT16 WINAPI timeSetEvent16(UINT16 wDelay, UINT16 wResol, LPTIMECALLBACK16 lpFunc,
DWORD dwUser, UINT16 wFlags)
{
if (wFlags & WINE_TIMER_IS32)
WARN("Unknown windows flag... wine internally used.. ooch\n");
return timeSetEventInternal(wDelay, wResol, (FARPROC16)lpFunc,
dwUser, wFlags & ~WINE_TIMER_IS32);
}
/**************************************************************************
* timeKillEvent [MMSYSTEM.603]
*/
MMRESULT16 WINAPI timeKillEvent16(UINT16 wID)
{
return timeKillEvent(wID);
}
/**************************************************************************
* timeGetDevCaps [MMSYSTEM.604]
*/
MMRESULT16 WINAPI timeGetDevCaps16(LPTIMECAPS16 lpCaps, UINT16 wSize)
{
TIMECAPS caps;
MMRESULT ret;
TRACE("(%p, %u) !\n", lpCaps, wSize);
ret = timeGetDevCaps(&caps, sizeof(caps));
lpCaps->wPeriodMin = caps.wPeriodMin;
lpCaps->wPeriodMax = caps.wPeriodMax;
return 0;
}
/**************************************************************************
* timeBeginPeriod [MMSYSTEM.605]
*/
MMRESULT16 WINAPI timeBeginPeriod16(UINT16 wPeriod)
{
TRACE("(%u) !\n", wPeriod);
return timeBeginPeriod(wPeriod);
}
/**************************************************************************
* timeEndPeriod [MMSYSTEM.606]
*/
MMRESULT16 WINAPI timeEndPeriod16(UINT16 wPeriod)
{
TRACE("(%u) !\n", wPeriod);
return timeEndPeriod(wPeriod);
}
/**************************************************************************
* mciSendString [MMSYSTEM.702]
*/
DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrRet,
UINT16 uRetLen, HWND16 hwndCallback)
{
return mciSendStringA(lpstrCommand, lpstrRet, uRetLen, HWND_32(hwndCallback));
}
/**************************************************************************
* mciLoadCommandResource [MMSYSTEM.705]
*/
UINT16 WINAPI mciLoadCommandResource16(HANDLE16 hInst, LPCSTR resname, UINT16 type)
{
LPCWSTR ptr = HEAP_strdupAtoW(GetProcessHeap(), 0, resname);
UINT ret = mciLoadCommandResource(hInst, ptr, type);
HeapFree(GetProcessHeap(), 0, (LPWSTR)ptr);
return ret;
}
/**************************************************************************
* mciFreeCommandResource [MMSYSTEM.713]
*/
BOOL16 WINAPI mciFreeCommandResource16(UINT16 uTable)
{
TRACE("(%04x)!\n", uTable);
return mciFreeCommandResource(uTable);
}
......@@ -34,10 +34,7 @@
#include "mmsystem.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/mmsystem16.h"
#include "winemm.h"
#include "wine/debug.h"
......@@ -237,27 +234,10 @@ MMRESULT WINAPI timeGetSystemTime(LPMMTIME lpTime, UINT wSize)
}
/**************************************************************************
* timeGetSystemTime [MMSYSTEM.601]
*/
MMRESULT16 WINAPI timeGetSystemTime16(LPMMTIME16 lpTime, UINT16 wSize)
{
TRACE("(%p, %u);\n", lpTime, wSize);
if (wSize >= sizeof(*lpTime)) {
lpTime->wType = TIME_MS;
lpTime->u.ms = TIME_MMTimeStart()->mmSysTimeMS;
TRACE("=> %lu\n", lpTime->u.ms);
}
return 0;
}
/**************************************************************************
* timeSetEventInternal [internal]
*/
static WORD timeSetEventInternal(UINT wDelay, UINT wResol,
FARPROC16 lpFunc, DWORD dwUser, UINT wFlags)
WORD timeSetEventInternal(UINT wDelay, UINT wResol,
FARPROC16 lpFunc, DWORD dwUser, UINT wFlags)
{
WORD wNewID = 0;
LPWINE_TIMERENTRY lpNewTimer;
......@@ -313,19 +293,6 @@ MMRESULT WINAPI timeSetEvent(UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc,
}
/**************************************************************************
* timeSetEvent [MMSYSTEM.602]
*/
MMRESULT16 WINAPI timeSetEvent16(UINT16 wDelay, UINT16 wResol, LPTIMECALLBACK16 lpFunc,
DWORD dwUser, UINT16 wFlags)
{
if (wFlags & WINE_TIMER_IS32)
WARN("Unknown windows flag... wine internally used.. ooch\n");
return timeSetEventInternal(wDelay, wResol, (FARPROC16)lpFunc,
dwUser, wFlags & ~WINE_TIMER_IS32);
}
/**************************************************************************
* timeKillEvent [WINMM.@]
*/
MMRESULT WINAPI timeKillEvent(UINT wID)
......@@ -359,14 +326,6 @@ MMRESULT WINAPI timeKillEvent(UINT wID)
}
/**************************************************************************
* timeKillEvent [MMSYSTEM.603]
*/
MMRESULT16 WINAPI timeKillEvent16(UINT16 wID)
{
return timeKillEvent(wID);
}
/**************************************************************************
* timeGetDevCaps [WINMM.@]
*/
MMRESULT WINAPI timeGetDevCaps(LPTIMECAPS lpCaps, UINT wSize)
......@@ -379,18 +338,6 @@ MMRESULT WINAPI timeGetDevCaps(LPTIMECAPS lpCaps, UINT wSize)
}
/**************************************************************************
* timeGetDevCaps [MMSYSTEM.604]
*/
MMRESULT16 WINAPI timeGetDevCaps16(LPTIMECAPS16 lpCaps, UINT16 wSize)
{
TRACE("(%p, %u) !\n", lpCaps, wSize);
lpCaps->wPeriodMin = MMSYSTIME_MININTERVAL;
lpCaps->wPeriodMax = MMSYSTIME_MAXINTERVAL;
return 0;
}
/**************************************************************************
* timeBeginPeriod [WINMM.@]
*/
MMRESULT WINAPI timeBeginPeriod(UINT wPeriod)
......@@ -403,18 +350,6 @@ MMRESULT WINAPI timeBeginPeriod(UINT wPeriod)
}
/**************************************************************************
* timeBeginPeriod [MMSYSTEM.605]
*/
MMRESULT16 WINAPI timeBeginPeriod16(UINT16 wPeriod)
{
TRACE("(%u) !\n", wPeriod);
if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL)
return TIMERR_NOCANDO;
return 0;
}
/**************************************************************************
* timeEndPeriod [WINMM.@]
*/
MMRESULT WINAPI timeEndPeriod(UINT wPeriod)
......@@ -427,18 +362,6 @@ MMRESULT WINAPI timeEndPeriod(UINT wPeriod)
}
/**************************************************************************
* timeEndPeriod [MMSYSTEM.606]
*/
MMRESULT16 WINAPI timeEndPeriod16(UINT16 wPeriod)
{
TRACE("(%u) !\n", wPeriod);
if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL)
return TIMERR_NOCANDO;
return 0;
}
/**************************************************************************
* timeGetTime [MMSYSTEM.607]
* timeGetTime [WINMM.@]
*/
......
......@@ -230,6 +230,8 @@ MMRESULT MMSYSTEM_MidiStream_Open(HMIDISTRM* lphMidiStrm,
UINT MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType,
const LPWAVEFORMATEX lpFormat, DWORD dwCallback,
DWORD dwInstance, DWORD dwFlags, BOOL bFrom32);
WORD timeSetEventInternal(UINT wDelay, UINT wResol,
FARPROC16 lpFunc, DWORD dwUser, UINT wFlags);
BOOL MULTIMEDIA_MciInit(void);
LPWINE_MM_IDATA MULTIMEDIA_GetIData(void);
......
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