mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 23:14:53 +00:00
[INCLUDE/REACTOS] Move the debug macros from mmebuddy.h to mmebuddy_debug.h. [SNDBLST][MMENT4][MMEBUDDY] Use mmebuddy_debug.h where needed. [WDMAUD.DRV] Enable PCH again and use mmebuddy_debug.h where needed.
svn path=/trunk/; revision=69888
This commit is contained in:
parent
94a73db543
commit
9086f2a059
|
@ -26,6 +26,7 @@
|
||||||
#include <mmddk.h>
|
#include <mmddk.h>
|
||||||
#include <mmebuddy.h>
|
#include <mmebuddy.h>
|
||||||
#include <mment4.h>
|
#include <mment4.h>
|
||||||
|
#include <mmebuddy_debug.h>
|
||||||
//#include <debug.h>
|
//#include <debug.h>
|
||||||
|
|
||||||
/* TODO: Give individual device names if someone has > 1 card */
|
/* TODO: Give individual device names if someone has > 1 card */
|
||||||
|
|
|
@ -28,6 +28,5 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_importlibs(wdmaud.drv user32 winmm advapi32 msvcrt setupapi ksuser kernel32 ntdll)
|
add_importlibs(wdmaud.drv user32 winmm advapi32 msvcrt setupapi ksuser kernel32 ntdll)
|
||||||
# FIXME: Address mmebuddy.h reliance on NDEBUG
|
add_pch(wdmaud.drv wdmaud.h SOURCE)
|
||||||
#add_pch(wdmaud.drv wdmaud.h SOURCE)
|
|
||||||
add_cd_file(TARGET wdmaud.drv DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET wdmaud.drv DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -13,9 +13,11 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
|
||||||
#include "wdmaud.h"
|
#include "wdmaud.h"
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include <mmebuddy_debug.h>
|
||||||
|
|
||||||
#define KERNEL_DEVICE_NAME L"\\\\.\\wdmaud"
|
#define KERNEL_DEVICE_NAME L"\\\\.\\wdmaud"
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,14 @@
|
||||||
* PROGRAMMERS: Johannes Anderwald
|
* PROGRAMMERS: Johannes Anderwald
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
|
||||||
#include "wdmaud.h"
|
#include "wdmaud.h"
|
||||||
|
|
||||||
#include <samplerate.h>
|
#include <samplerate.h>
|
||||||
#include <float_cast.h>
|
#include <float_cast.h>
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include <mmebuddy_debug.h>
|
||||||
|
|
||||||
extern HANDLE KernelHandle;
|
extern HANDLE KernelHandle;
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,15 @@
|
||||||
* PROGRAMMERS: Johannes Anderwald
|
* PROGRAMMERS: Johannes Anderwald
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
|
||||||
#include "wdmaud.h"
|
#include "wdmaud.h"
|
||||||
|
|
||||||
#include <winreg.h>
|
#include <winreg.h>
|
||||||
#include <setupapi.h>
|
#include <setupapi.h>
|
||||||
#include <mmixer.h>
|
#include <mmixer.h>
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include <mmebuddy_debug.h>
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,10 +12,11 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
|
||||||
#include "wdmaud.h"
|
#include "wdmaud.h"
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include <mmebuddy_debug.h>
|
||||||
|
|
||||||
#ifndef USE_MMIXER_LIB
|
#ifndef USE_MMIXER_LIB
|
||||||
#define FUNC_NAME(x) x##ByLegacy
|
#define FUNC_NAME(x) x##ByLegacy
|
||||||
|
|
|
@ -20,69 +20,6 @@
|
||||||
#ifndef ROS_AUDIO_MMEBUDDY_H
|
#ifndef ROS_AUDIO_MMEBUDDY_H
|
||||||
#define ROS_AUDIO_MMEBUDDY_H
|
#define ROS_AUDIO_MMEBUDDY_H
|
||||||
|
|
||||||
/*
|
|
||||||
Hacky debug macro
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define POPUP(...) \
|
|
||||||
{ \
|
|
||||||
WCHAR dbg_popup_msg[1024], dbg_popup_title[256]; \
|
|
||||||
wsprintf(dbg_popup_title, L"%hS(%d)", __FILE__, __LINE__); \
|
|
||||||
wsprintf(dbg_popup_msg, __VA_ARGS__); \
|
|
||||||
MessageBox(0, dbg_popup_msg, dbg_popup_title, MB_OK | MB_TASKMODAL); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
#define SND_ERR(...) \
|
|
||||||
{ \
|
|
||||||
WCHAR dbg_popup_msg[1024]; \
|
|
||||||
wsprintf(dbg_popup_msg, __VA_ARGS__); \
|
|
||||||
OutputDebugString(dbg_popup_msg); \
|
|
||||||
}
|
|
||||||
#define SND_WARN(...) \
|
|
||||||
{ \
|
|
||||||
WCHAR dbg_popup_msg[1024]; \
|
|
||||||
wsprintf(dbg_popup_msg, __VA_ARGS__); \
|
|
||||||
OutputDebugString(dbg_popup_msg); \
|
|
||||||
}
|
|
||||||
#define SND_TRACE(...) \
|
|
||||||
{ \
|
|
||||||
WCHAR dbg_popup_msg[1024]; \
|
|
||||||
wsprintf(dbg_popup_msg, __VA_ARGS__); \
|
|
||||||
OutputDebugString(dbg_popup_msg); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define SND_ASSERT(condition) \
|
|
||||||
{ \
|
|
||||||
if ( ! ( condition ) ) \
|
|
||||||
{ \
|
|
||||||
SND_ERR(L"ASSERT FAILED: %hS File %hS Line %u\n", #condition, __FILE__, __LINE__); \
|
|
||||||
POPUP(L"ASSERT FAILED: %hS\n", #condition); \
|
|
||||||
ExitProcess(1); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define DUMP_WAVEHDR_QUEUE(sound_device_instance) \
|
|
||||||
{ \
|
|
||||||
PWAVEHDR CurrDumpHdr = sound_device_instance->HeadWaveHeader; \
|
|
||||||
SND_TRACE(L"-- Current wave header list --\n"); \
|
|
||||||
while ( CurrDumpHdr ) \
|
|
||||||
{ \
|
|
||||||
SND_TRACE(L"%x | %d bytes | flags: %x\n", CurrDumpHdr, \
|
|
||||||
CurrDumpHdr->dwBufferLength, \
|
|
||||||
CurrDumpHdr->dwFlags); \
|
|
||||||
CurrDumpHdr = CurrDumpHdr->lpNext; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define SND_ERR(...) do {} while ( 0 )
|
|
||||||
#define SND_WARN(...) do {} while ( 0 )
|
|
||||||
#define SND_TRACE(...) do {} while ( 0 )
|
|
||||||
#define SND_ASSERT(condition) do {(void)(condition);} while ( 0 )
|
|
||||||
#define DUMP_WAVEHDR_QUEUE(condition) do {} while ( 0 )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Some memory allocation helper macros
|
Some memory allocation helper macros
|
||||||
*/
|
*/
|
||||||
|
|
67
reactos/include/reactos/libs/sound/mmebuddy_debug.h
Normal file
67
reactos/include/reactos/libs/sound/mmebuddy_debug.h
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
#ifndef ROS_AUDIO_MMEBUDDY_DEBUG_H
|
||||||
|
#define ROS_AUDIO_MMEBUDDY_DEBUG_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
Hacky debug macro
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define POPUP(...) \
|
||||||
|
{ \
|
||||||
|
WCHAR dbg_popup_msg[1024], dbg_popup_title[256]; \
|
||||||
|
wsprintf(dbg_popup_title, L"%hS(%d)", __FILE__, __LINE__); \
|
||||||
|
wsprintf(dbg_popup_msg, __VA_ARGS__); \
|
||||||
|
MessageBox(0, dbg_popup_msg, dbg_popup_title, MB_OK | MB_TASKMODAL); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
#define SND_ERR(...) \
|
||||||
|
{ \
|
||||||
|
WCHAR dbg_popup_msg[1024]; \
|
||||||
|
wsprintf(dbg_popup_msg, __VA_ARGS__); \
|
||||||
|
OutputDebugString(dbg_popup_msg); \
|
||||||
|
}
|
||||||
|
#define SND_WARN(...) \
|
||||||
|
{ \
|
||||||
|
WCHAR dbg_popup_msg[1024]; \
|
||||||
|
wsprintf(dbg_popup_msg, __VA_ARGS__); \
|
||||||
|
OutputDebugString(dbg_popup_msg); \
|
||||||
|
}
|
||||||
|
#define SND_TRACE(...) \
|
||||||
|
{ \
|
||||||
|
WCHAR dbg_popup_msg[1024]; \
|
||||||
|
wsprintf(dbg_popup_msg, __VA_ARGS__); \
|
||||||
|
OutputDebugString(dbg_popup_msg); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define SND_ASSERT(condition) \
|
||||||
|
{ \
|
||||||
|
if ( ! ( condition ) ) \
|
||||||
|
{ \
|
||||||
|
SND_ERR(L"ASSERT FAILED: %hS File %hS Line %u\n", #condition, __FILE__, __LINE__); \
|
||||||
|
POPUP(L"ASSERT FAILED: %hS\n", #condition); \
|
||||||
|
ExitProcess(1); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define DUMP_WAVEHDR_QUEUE(sound_device_instance) \
|
||||||
|
{ \
|
||||||
|
PWAVEHDR CurrDumpHdr = sound_device_instance->HeadWaveHeader; \
|
||||||
|
SND_TRACE(L"-- Current wave header list --\n"); \
|
||||||
|
while ( CurrDumpHdr ) \
|
||||||
|
{ \
|
||||||
|
SND_TRACE(L"%x | %d bytes | flags: %x\n", CurrDumpHdr, \
|
||||||
|
CurrDumpHdr->dwBufferLength, \
|
||||||
|
CurrDumpHdr->dwFlags); \
|
||||||
|
CurrDumpHdr = CurrDumpHdr->lpNext; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
#define SND_ERR(...) do {} while ( 0 )
|
||||||
|
#define SND_WARN(...) do {} while ( 0 )
|
||||||
|
#define SND_TRACE(...) do {} while ( 0 )
|
||||||
|
#define SND_ASSERT(condition) do {(void)(condition);} while ( 0 )
|
||||||
|
#define DUMP_WAVEHDR_QUEUE(condition) do {} while ( 0 )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* ROS_AUDIO_MMEBUDDY_DEBUG_H */
|
|
@ -6,5 +6,6 @@
|
||||||
#include <mmddk.h>
|
#include <mmddk.h>
|
||||||
#include <sndtypes.h>
|
#include <sndtypes.h>
|
||||||
#include <mmebuddy.h>
|
#include <mmebuddy.h>
|
||||||
|
#include <mmebuddy_debug.h>
|
||||||
|
|
||||||
#endif /* _MMEBUDDY_PCH_ */
|
#endif /* _MMEBUDDY_PCH_ */
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
#include <winioctl.h>
|
#include <winioctl.h>
|
||||||
#include <ntddsnd.h>
|
#include <ntddsnd.h>
|
||||||
|
|
||||||
|
#include <mmebuddy_debug.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Convenience routine for getting the path of a device and opening it.
|
Convenience routine for getting the path of a device and opening it.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
#include <mment4.h>
|
#include <mment4.h>
|
||||||
|
#include <mmebuddy_debug.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This is the "nice" way to discover audio devices in NT4 - go into the
|
This is the "nice" way to discover audio devices in NT4 - go into the
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
|
#include <mmebuddy_debug.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Open the parameters key of a sound driver.
|
Open the parameters key of a sound driver.
|
||||||
NT4 only.
|
NT4 only.
|
||||||
|
|
Loading…
Reference in a new issue