Modified: trunk/reactos/lib/mmdrv/Makefile
Modified: trunk/reactos/lib/mmdrv/auxil.c
Modified: trunk/reactos/lib/mmdrv/entry.c
Modified: trunk/reactos/lib/mmdrv/midi.c
Modified: trunk/reactos/lib/mmdrv/mmdrv.h
Modified: trunk/reactos/lib/mmdrv/utils.c
Modified: trunk/reactos/lib/mmdrv/wave.c
--- trunk/reactos/lib/mmdrv/Makefile 2005-02-05 08:44:49 UTC (rev 13418)
+++ trunk/reactos/lib/mmdrv/Makefile 2005-02-05 10:17:33 UTC (rev 13419)
@@ -14,7 +14,7 @@
TARGET_LFLAGS =
-TARGET_SDKLIBS = winmm.a
+TARGET_SDKLIBS = winmm.a ntdll.a
TARGET_BASE = $(TARGET_BASE_LIB_MMDRV)
--- trunk/reactos/lib/mmdrv/auxil.c 2005-02-05 08:44:49 UTC (rev 13418)
+++ trunk/reactos/lib/mmdrv/auxil.c 2005-02-05 10:17:33 UTC (rev 13419)
@@ -12,6 +12,8 @@
#include "mmdrv.h"
+#define NDEBUG
+#include <debug.h>
APIENTRY DWORD auxMessage(UINT uDevice,
UINT uMessage,
@@ -20,7 +22,7 @@
DWORD dwParam2)
{
- printf("auxMessage\n");
+ DPRINT("auxMessage\n");
// the following cases are documented by DDK
switch (uMessage)
--- trunk/reactos/lib/mmdrv/entry.c 2005-02-05 08:44:49 UTC (rev 13418)
+++ trunk/reactos/lib/mmdrv/entry.c 2005-02-05 10:17:33 UTC (rev 13419)
@@ -14,6 +14,8 @@
#include "mmdrv.h"
+#define NDEBUG
+#include <debug.h>
#define EXPORT __declspec(dllexport)
@@ -22,14 +24,14 @@
APIENTRY LONG DriverProc(DWORD DriverID, HANDLE DriverHandle, UINT Message,
LONG Param1, LONG Param2)
{
- printf("DriverProc\n");
+ DPRINT("DriverProc\n");
// HINSTANCE Module;
switch(Message)
{
case DRV_LOAD :
- printf("DRV_LOAD\n");
+ DPRINT("DRV_LOAD\n");
return TRUE; // dont need to do any more
/*
Module = GetDriverModuleHandle(DriverHandle);
@@ -56,7 +58,7 @@
// return 1L;
case DRV_FREE :
- printf("DRV_FREE\n");
+ DPRINT("DRV_FREE\n");
// TerminateMidi();
// TerminateWave();
@@ -65,35 +67,35 @@
return 1L;
case DRV_OPEN :
- printf("DRV_OPEN\n");
+ DPRINT("DRV_OPEN\n");
return 1L;
case DRV_CLOSE :
- printf("DRV_CLOSE\n");
+ DPRINT("DRV_CLOSE\n");
return 1L;
case DRV_ENABLE :
- printf("DRV_ENABLE\n");
+ DPRINT("DRV_ENABLE\n");
return 1L;
case DRV_DISABLE :
- printf("DRV_DISABLE\n");
+ DPRINT("DRV_DISABLE\n");
return 1L;
case DRV_QUERYCONFIGURE :
- printf("DRV_QUERYCONFIGURE\n");
+ DPRINT("DRV_QUERYCONFIGURE\n");
return 0L;
case DRV_CONFIGURE :
- printf("DRV_CONFIGURE\n");
+ DPRINT("DRV_CONFIGURE\n");
return 0L;
case DRV_INSTALL :
- printf("DRV_INSTALL\n");
+ DPRINT("DRV_INSTALL\n");
return DRVCNF_RESTART;
default :
- printf("?\n");
+ DPRINT("?\n");
return DefDriverProc(DriverID, DriverHandle, Message, Param1, Param2);
};
}
@@ -101,7 +103,7 @@
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
{
- printf("DllMain called!\n");
+ DPRINT("DllMain called!\n");
if (Reason == DLL_PROCESS_ATTACH)
{
--- trunk/reactos/lib/mmdrv/midi.c 2005-02-05 08:44:49 UTC (rev 13418)
+++ trunk/reactos/lib/mmdrv/midi.c 2005-02-05 10:17:33 UTC (rev 13419)
@@ -11,6 +11,8 @@
#include "mmdrv.h"
+#define NDEBUG
+#include <debug.h>
// MIDI device instance information
//
@@ -66,7 +68,7 @@
MMRESULT Result = MMSYSERR_NOERROR;
// Check ID?
- printf("OpenMidiDevice()\n");
+ DPRINT("OpenMidiDevice()\n");
switch(DeviceType)
{
@@ -119,7 +121,7 @@
{
DWORD BytesReturned;
- printf("IOCTL_MIDI_PLAY == %d [%x]\n", IOCTL_MIDI_PLAY, IOCTL_MIDI_PLAY);
+ DPRINT("IOCTL_MIDI_PLAY == %d [%x]\n", IOCTL_MIDI_PLAY, IOCTL_MIDI_PLAY);
if ( !DeviceIoControl(pClient->DeviceHandle, IOCTL_MIDI_PLAY, (PVOID)pData,
Length, NULL, 0, &BytesReturned, NULL))
@@ -174,40 +176,40 @@
APIENTRY DWORD midMessage(DWORD dwId, DWORD dwMessage, DWORD dwUser, DWORD dwParam1, DWORD dwParam2)
{
- printf("midMessage\n");
+ DPRINT("midMessage\n");
return MMSYSERR_NOERROR;
switch (dwMessage) {
case MIDM_GETNUMDEVS:
- printf("MIDM_GETNUMDEVS");
+ DPRINT("MIDM_GETNUMDEVS");
return 0;
case MIDM_GETDEVCAPS:
- printf("MIDM_GETDEVCAPS");
+ DPRINT("MIDM_GETDEVCAPS");
return MMSYSERR_NOERROR;
case MIDM_OPEN:
- printf("MIDM_OPEN");
+ DPRINT("MIDM_OPEN");
return MMSYSERR_NOERROR;
case MIDM_CLOSE:
- printf("MIDM_CLOSE");
+ DPRINT("MIDM_CLOSE");
return MMSYSERR_NOERROR;
case MIDM_ADDBUFFER:
- printf("MIDM_ADDBUFFER");
+ DPRINT("MIDM_ADDBUFFER");
return MMSYSERR_NOERROR;
case MIDM_STOP:
- printf("MIDM_PAUSE");
+ DPRINT("MIDM_PAUSE");
return MMSYSERR_NOERROR;
case MIDM_START:
- printf("MIDM_RESTART");
+ DPRINT("MIDM_RESTART");
return MMSYSERR_NOERROR;
case MIDM_RESET:
- printf("MIDM_RESET");
+ DPRINT("MIDM_RESET");
return MMSYSERR_NOERROR;
default:
@@ -221,27 +223,27 @@
APIENTRY DWORD modMessage(DWORD ID, DWORD Message, DWORD User, DWORD Param1, DWORD Param2)
{
- printf("modMessage\n");
+ DPRINT("modMessage\n");
switch(Message)
{
case MODM_GETNUMDEVS:
- printf("MODM_GETNUMDEVS == %d\n", (int)GetDeviceCount(MidiOutDevice));
+ DPRINT("MODM_GETNUMDEVS == %d\n", (int)GetDeviceCount(MidiOutDevice));
return GetDeviceCount(MidiOutDevice);
case MODM_GETDEVCAPS:
- printf("MODM_GETDEVCAPS");
+ DPRINT("MODM_GETDEVCAPS");
return MMSYSERR_NOTSUPPORTED;
case MODM_OPEN :
return OpenMidiDevice(MidiOutDevice, ID, User, Param1, Param2);
case MODM_CLOSE:
- printf("MODM_CLOSE");
+ DPRINT("MODM_CLOSE");
return MMSYSERR_NOTSUPPORTED;
case MODM_DATA:
- printf("MODM_DATA");
+ DPRINT("MODM_DATA");
int i;
BYTE b[4];
@@ -253,27 +255,27 @@
(PMIDIALLOC)User);
case MODM_LONGDATA:
- printf("MODM_LONGDATA");
+ DPRINT("MODM_LONGDATA");
return MMSYSERR_NOTSUPPORTED;
case MODM_RESET:
- printf("MODM_RESET");
+ DPRINT("MODM_RESET");
return MMSYSERR_NOTSUPPORTED;
case MODM_SETVOLUME:
- printf("MODM_SETVOLUME");
+ DPRINT("MODM_SETVOLUME");
return MMSYSERR_NOTSUPPORTED;
case MODM_GETVOLUME:
- printf("MODM_GETVOLUME");
+ DPRINT("MODM_GETVOLUME");
return MMSYSERR_NOTSUPPORTED;
case MODM_CACHEPATCHES:
- printf("MODM_CACHEPATCHES");
+ DPRINT("MODM_CACHEPATCHES");
return MMSYSERR_NOTSUPPORTED;
case MODM_CACHEDRUMPATCHES:
- printf("MODM_CACHEDRUMPATCHES");
+ DPRINT("MODM_CACHEDRUMPATCHES");
return MMSYSERR_NOTSUPPORTED;
};
--- trunk/reactos/lib/mmdrv/mmdrv.h 2005-02-05 08:44:49 UTC (rev 13418)
+++ trunk/reactos/lib/mmdrv/mmdrv.h 2005-02-05 10:17:33 UTC (rev 13419)
@@ -31,6 +31,8 @@
#include "mmdef.h"
+ULONG DbgPrint(PCH Format, ...);
+
/*
#define SOUND_MAX_DEVICE_NAME 1024 // GUESSWORK
#define SOUND_MAX_DEVICES 256 // GUESSWORK
--- trunk/reactos/lib/mmdrv/utils.c 2005-02-05 08:44:49 UTC (rev 13418)
+++ trunk/reactos/lib/mmdrv/utils.c 2005-02-05 10:17:33 UTC (rev 13419)
@@ -11,6 +11,8 @@
#include "mmdrv.h"
+#define NDEBUG
+#include <debug.h>
typedef struct _DEVICE_LIST
{
@@ -59,7 +61,7 @@
MMRESULT OpenDevice(UINT DeviceType, DWORD ID, PHANDLE pDeviceHandle,
DWORD Access)
{
- printf("OpenDevice()\n");
+ DPRINT("OpenDevice()\n");
WCHAR DeviceName[SOUND_MAX_DEVICE_NAME];
*pDeviceHandle = INVALID_HANDLE_VALUE;
@@ -84,13 +86,13 @@
wsprintf(DeviceName, L"\\\\.%ls%d", AUX_DEVICE_NAME_U + strlen("\\Device"), ID);
};
- printf("Attempting to open %S\n", DeviceName);
+ DPRINT("Attempting to open %S\n", DeviceName);
*pDeviceHandle = CreateFile(DeviceName, Access, FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, Access != GENERIC_READ ? FILE_FLAG_OVERLAPPED : 0,
NULL);
- printf("DeviceHandle == 0x%x\n", (int)*pDeviceHandle);
+ DPRINT("DeviceHandle == 0x%x\n", (int)*pDeviceHandle);
if (pDeviceHandle == INVALID_HANDLE_VALUE)
return TranslateStatus();
@@ -107,7 +109,7 @@
{
PDEVICE_LIST pNewDevice;
- printf("AddDeviceToList()\n");
+ DPRINT("AddDeviceToList()\n");
pNewDevice = (PDEVICE_LIST) HeapAlloc(Heap, 0,
sizeof(DEVICE_LIST) + lstrlen(Name) * sizeof(WCHAR));
@@ -125,7 +127,7 @@
pNewDevice->Next = *pList;
*pList = pNewDevice;
- printf("Success!\n");
+ DPRINT("Success!\n");
return TRUE;
}
@@ -135,7 +137,7 @@
{
PDEVICE_LIST pDevice;
- printf("FreeDeviceList()\n");
+ DPRINT("FreeDeviceList()\n");
while (DeviceList)
{
@@ -155,7 +157,7 @@
// DWORD Index;
// HKEY DriverKey;
- printf("Finding devices\n");
+ DPRINT("Finding devices\n");
// DriverKey = OpenParametersKey();
// see drvutil.c of MS DDK for how this SHOULD be done...
--- trunk/reactos/lib/mmdrv/wave.c 2005-02-05 08:44:49 UTC (rev 13418)
+++ trunk/reactos/lib/mmdrv/wave.c 2005-02-05 10:17:33 UTC (rev 13419)
@@ -14,6 +14,9 @@
#include "mmdrv.h"
#include "wave.h"
+#define NDEBUG
+#include <debug.h>
+
/* ============================
* INTERNAL
* functions start here
@@ -144,23 +147,23 @@
{
switch (dwMessage) {
case WODM_GETNUMDEVS:
- printf("WODM_GETNUMDEVS");
+ DPRINT("WODM_GETNUMDEVS");
return GetDeviceCount(WaveOutDevice);
case WODM_GETDEVCAPS:
- printf("WODM_GETDEVCAPS");
+ DPRINT("WODM_GETDEVCAPS");
return GetDeviceCapabilities(dwId, WaveOutDevice, (LPBYTE)dwParam1,
(DWORD)dwParam2);
case WODM_OPEN:
- printf("WODM_OPEN");
+ DPRINT("WODM_OPEN");
return OpenWaveDevice(WaveOutDevice, dwId, dwUser, dwParam1, dwParam2);
case WODM_CLOSE:
{
MMRESULT Result;
PWAVEALLOC pTask = (PWAVEALLOC)dwUser;
- printf("WODM_CLOSE");
+ DPRINT("WODM_CLOSE");
// 1. Check if the task is ready to complete
Result = ThreadCallWaveDevice(WaveThreadClose, pTask);
@@ -186,7 +189,7 @@
{
LPWAVEHDR pWaveHdr = (LPWAVEHDR)dwParam1;
- printf("WODM_WRITE");
+ DPRINT("WODM_WRITE");
if (dwParam1 != 0)
return MMSYSERR_INVALPARAM;
@@ -215,37 +218,37 @@
case WODM_PAUSE:
- printf("WODM_PAUSE");
+ DPRINT("WODM_PAUSE");
((PWAVEALLOC)dwUser)->AuxParam.State = WAVE_DD_STOP;
return ThreadCallWaveDevice(WaveThreadSetState, (PWAVEALLOC)dwUser);
case WODM_RESTART:
- printf("WODM_RESTART");
+ DPRINT("WODM_RESTART");
((PWAVEALLOC)dwUser)->AuxParam.State = WAVE_DD_PLAY;
return ThreadCallWaveDevice(WaveThreadSetState, (PWAVEALLOC)dwUser);
case WODM_RESET:
- printf("WODM_RESET");
+ DPRINT("WODM_RESET");
((PWAVEALLOC)dwUser)->AuxParam.State = WAVE_DD_RESET;
return ThreadCallWaveDevice(WaveThreadSetState, (PWAVEALLOC)dwUser);
case WODM_BREAKLOOP:
- printf("WODM_BREAKLOOP");
+ DPRINT("WODM_BREAKLOOP");
return ThreadCallWaveDevice(WaveThreadBreakLoop, (PWAVEALLOC)dwUser);
case WODM_GETPOS:
- printf("WODM_GETPOS");
+ DPRINT("WODM_GETPOS");
return GetPositionWaveDevice(((PWAVEALLOC)dwUser), (LPMMTIME)dwParam1, dwParam2);
case WODM_SETPITCH:
- printf("WODM_SETPITCH");
+ DPRINT("WODM_SETPITCH");
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.pData = (PBYTE)&dwParam1;
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.DataLen = sizeof(DWORD);
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.Function = IOCTL_WAVE_SET_PITCH;
return ThreadCallWaveDevice(WaveThreadSetData, ((PWAVEALLOC)dwUser));
case WODM_SETVOLUME:
- printf("WODM_SETVOLUME");
+ DPRINT("WODM_SETVOLUME");
{
WAVE_DD_VOLUME Vol;
Vol.Left = LOWORD(dwParam1) << 16;
@@ -256,21 +259,21 @@
}
case WODM_SETPLAYBACKRATE:
- printf("WODM_SETPLAYBACKRATE");
+ DPRINT("WODM_SETPLAYBACKRATE");
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.pData = (PBYTE)&dwParam1;
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.DataLen = sizeof(DWORD);
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.Function = IOCTL_WAVE_SET_PLAYBACK_RATE;
return ThreadCallWaveDevice(WaveThreadSetData, (PWAVEALLOC)dwUser);
case WODM_GETPITCH:
- printf("WODM_GETPITCH");
+ DPRINT("WODM_GETPITCH");
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.pData = (PBYTE)dwParam1;
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.DataLen = sizeof(DWORD);
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.Function = IOCTL_WAVE_GET_PITCH;
return ThreadCallWaveDevice(WaveThreadGetData, (PWAVEALLOC)dwUser);
case WODM_GETVOLUME:
- printf("WODM_GETVOLUME");
+ DPRINT("WODM_GETVOLUME");
{
WAVE_DD_VOLUME Vol;
DWORD res;
@@ -285,7 +288,7 @@
}
case WODM_GETPLAYBACKRATE:
- printf("WODM_GETPLAYBACKRATE");
+ DPRINT("WODM_GETPLAYBACKRATE");
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.pData = (PBYTE)dwParam1;
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.DataLen = sizeof(DWORD);
((PWAVEALLOC)dwUser)->AuxParam.GetSetData.Function = IOCTL_WAVE_GET_PLAYBACK_RATE;
@@ -305,7 +308,7 @@
*/
APIENTRY DWORD widMessage(DWORD dwId, DWORD dwMessage, DWORD dwUser, DWORD dwParam1, DWORD dwParam2)
{
- printf("widMessage\n");
+ DPRINT("widMessage\n");
switch (dwMessage) {
case WIDM_GETNUMDEVS: