From ab22ea74a41b36787e544cda076efa70e5d7d169 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 26 May 2015 15:09:31 -0500 Subject: [PATCH] msacm32: Make ACM driver details match native more closely. --- dlls/imaadp32.acm/imaadp32.c | 4 ++-- dlls/msacm32/pcmconverter.c | 6 +++--- dlls/msacm32/tests/msacm.c | 24 ++++++++++++++++++++++++ dlls/msadp32.acm/msadp32.c | 4 ++-- dlls/msg711.acm/msg711.c | 6 +++--- dlls/msgsm32.acm/msgsm32.c | 4 ++-- dlls/winemp3.acm/mpegl3.c | 6 +++--- include/mmreg.h | 12 ++++++++++++ include/mmsystem.h | 3 ++- 9 files changed, 53 insertions(+), 16 deletions(-) diff --git a/dlls/imaadp32.acm/imaadp32.c b/dlls/imaadp32.acm/imaadp32.c index 19c2ae28d27..c5c65f6b43c 100644 --- a/dlls/imaadp32.acm/imaadp32.c +++ b/dlls/imaadp32.acm/imaadp32.c @@ -507,8 +507,8 @@ static LRESULT ADPCM_DriverDetails(PACMDRIVERDETAILSW add) { add->fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC; add->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED; - add->wMid = 0x1; - add->wPid = 0x22; + add->wMid = MM_MICROSOFT; + add->wPid = MM_MSFT_ACM_IMAADPCM; add->vdwACM = 0x3320000; add->vdwDriver = 0x04000000; add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; diff --git a/dlls/msacm32/pcmconverter.c b/dlls/msacm32/pcmconverter.c index 9bfed206067..cf92d932cd6 100644 --- a/dlls/msacm32/pcmconverter.c +++ b/dlls/msacm32/pcmconverter.c @@ -723,15 +723,15 @@ static LRESULT PCM_DriverDetails(PACMDRIVERDETAILSW add) add->fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC; add->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED; - add->wMid = 0xFF; - add->wPid = 0x00; + add->wMid = MM_MICROSOFT; + add->wPid = MM_MSFT_ACM_PCM; add->vdwACM = 0x01000000; add->vdwDriver = 0x01000000; add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CONVERTER; add->cFormatTags = 1; add->cFilterTags = 0; add->hicon = NULL; - MultiByteToWideChar( CP_ACP, 0, "WINE-PCM", -1, + MultiByteToWideChar( CP_ACP, 0, "MS-PCM", -1, add->szShortName, sizeof(add->szShortName)/sizeof(WCHAR) ); MultiByteToWideChar( CP_ACP, 0, "Wine PCM converter", -1, add->szLongName, sizeof(add->szLongName)/sizeof(WCHAR) ); diff --git a/dlls/msacm32/tests/msacm.c b/dlls/msacm32/tests/msacm.c index c36bdbf6898..747c5fe634d 100644 --- a/dlls/msacm32/tests/msacm.c +++ b/dlls/msacm32/tests/msacm.c @@ -127,8 +127,30 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid, TODO: should it be *exactly* sizeof(dd), as tested here? */ if (rc == MMSYSERR_NOERROR) { + struct { + const char *shortname; + const WORD mid; + const WORD pid; + } *iter, expected_ids[] = { + { "Microsoft IMA ADPCM", MM_MICROSOFT, MM_MSFT_ACM_IMAADPCM }, + { "MS-ADPCM", MM_MICROSOFT, MM_MSFT_ACM_MSADPCM }, + { "Microsoft CCITT G.711", MM_MICROSOFT, MM_MSFT_ACM_G711}, + { "MPEG Layer-3 Codec", MM_FRAUNHOFER_IIS, MM_FHGIIS_MPEGLAYER3_DECODE }, + { "MS-PCM", MM_MICROSOFT, MM_MSFT_ACM_PCM }, + { 0 } + }; + ok(dd.cbStruct == sizeof(dd), "acmDriverDetailsA(): cbStruct = %08x\n", dd.cbStruct); + + for (iter = expected_ids; iter->shortname; ++iter) { + if (dd.szShortName && !strcmp(iter->shortname, dd.szShortName)) { + ok(iter->mid == dd.wMid && iter->pid == dd.wPid, + "Got wrong manufacturer (0x%x vs 0x%x) or product (0x%x vs 0x%x)\n", + dd.wMid, iter->mid, + dd.wPid, iter->pid); + } + } } if (rc == MMSYSERR_NOERROR && winetest_interactive) { @@ -139,6 +161,8 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid, trace(" Features: %s\n", dd.szFeatures); trace(" Supports %u formats\n", dd.cFormatTags); trace(" Supports %u filter formats\n", dd.cFilterTags); + trace(" Mid: 0x%x\n", dd.wMid); + trace(" Pid: 0x%x\n", dd.wPid); } /* try bad pointer */ diff --git a/dlls/msadp32.acm/msadp32.c b/dlls/msadp32.acm/msadp32.c index 59f71b51d4e..83d1b464964 100644 --- a/dlls/msadp32.acm/msadp32.c +++ b/dlls/msadp32.acm/msadp32.c @@ -372,8 +372,8 @@ static LRESULT ADPCM_DriverDetails(PACMDRIVERDETAILSW add) { add->fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC; add->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED; - add->wMid = 0xFF; - add->wPid = 0x00; + add->wMid = MM_MICROSOFT; + add->wPid = MM_MSFT_ACM_MSADPCM; add->vdwACM = 0x01000000; add->vdwDriver = 0x01000000; add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; diff --git a/dlls/msg711.acm/msg711.c b/dlls/msg711.acm/msg711.c index f6f2ae63407..e74d3290333 100644 --- a/dlls/msg711.acm/msg711.c +++ b/dlls/msg711.acm/msg711.c @@ -653,15 +653,15 @@ static LRESULT G711_DriverDetails(PACMDRIVERDETAILSW add) { add->fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC; add->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED; - add->wMid = 0xFF; - add->wPid = 0x00; + add->wMid = MM_MICROSOFT; + add->wPid = MM_MSFT_ACM_G711; add->vdwACM = 0x01000000; add->vdwDriver = 0x01000000; add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; add->cFormatTags = 3; /* PCM, G711 A-LAW & MU-LAW */ add->cFilterTags = 0; add->hicon = NULL; - MultiByteToWideChar( CP_ACP, 0, "WINE-G711", -1, + MultiByteToWideChar( CP_ACP, 0, "Microsoft CCITT G.711", -1, add->szShortName, sizeof(add->szShortName)/sizeof(WCHAR) ); MultiByteToWideChar( CP_ACP, 0, "Wine G711 converter", -1, add->szLongName, sizeof(add->szLongName)/sizeof(WCHAR) ); diff --git a/dlls/msgsm32.acm/msgsm32.c b/dlls/msgsm32.acm/msgsm32.c index c32c6564832..cce1303455a 100644 --- a/dlls/msgsm32.acm/msgsm32.c +++ b/dlls/msgsm32.acm/msgsm32.c @@ -117,14 +117,14 @@ static LRESULT GSM_DriverDetails(PACMDRIVERDETAILSW add) add->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED; /* Details found from probing native msgsm32.acm */ add->wMid = MM_MICROSOFT; - add->wPid = 36; + add->wPid = MM_MSFT_ACM_GSM610; add->vdwACM = 0x3320000; add->vdwDriver = 0x4000000; add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; add->cFormatTags = 2; add->cFilterTags = 0; add->hicon = NULL; - MultiByteToWideChar( CP_ACP, 0, "Wine GSM 6.10", -1, + MultiByteToWideChar( CP_ACP, 0, "Microsoft GSM 6.10", -1, add->szShortName, sizeof(add->szShortName)/sizeof(WCHAR) ); MultiByteToWideChar( CP_ACP, 0, "Wine GSM 6.10 libgsm codec", -1, add->szLongName, sizeof(add->szLongName)/sizeof(WCHAR) ); diff --git a/dlls/winemp3.acm/mpegl3.c b/dlls/winemp3.acm/mpegl3.c index 57193b3d6f7..37993b4b20a 100644 --- a/dlls/winemp3.acm/mpegl3.c +++ b/dlls/winemp3.acm/mpegl3.c @@ -658,15 +658,15 @@ static LRESULT MPEG3_DriverDetails(PACMDRIVERDETAILSW add) { add->fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC; add->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED; - add->wMid = 0xFF; - add->wPid = 0x00; + add->wMid = MM_FRAUNHOFER_IIS; + add->wPid = MM_FHGIIS_MPEGLAYER3_DECODE; add->vdwACM = 0x01000000; add->vdwDriver = 0x01000000; add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; add->cFormatTags = 3; /* PCM, MPEG3 */ add->cFilterTags = 0; add->hicon = NULL; - MultiByteToWideChar( CP_ACP, 0, "WINE-MPEG3", -1, + MultiByteToWideChar( CP_ACP, 0, "MPEG Layer-3 Codec", -1, add->szShortName, sizeof(add->szShortName)/sizeof(WCHAR) ); MultiByteToWideChar( CP_ACP, 0, "Wine MPEG3 decoder", -1, add->szLongName, sizeof(add->szLongName)/sizeof(WCHAR) ); diff --git a/include/mmreg.h b/include/mmreg.h index 64a3991e60e..08517a86046 100644 --- a/include/mmreg.h +++ b/include/mmreg.h @@ -115,6 +115,18 @@ typedef struct _WAVEFORMATEX { #define WAVE_FORMAT_OLISBC 0x1003 /* Ing C. Olivetti & C., S.p.A. */ #define WAVE_FORMAT_OLIOPR 0x1004 /* Ing C. Olivetti & C., S.p.A. */ +#ifndef MM_MICROSOFT +#define MM_MICROSOFT 0x01 +#endif +#define MM_MSFT_ACM_MSADPCM 0x21 +#define MM_MSFT_ACM_IMAADPCM 0x22 +#define MM_MSFT_ACM_GSM610 0x24 +#define MM_MSFT_ACM_G711 0x25 +#define MM_MSFT_ACM_PCM 0x26 + +#define MM_FRAUNHOFER_IIS 0xAC +#define MM_FHGIIS_MPEGLAYER3_DECODE 0x09 + #if !defined(WAVE_FORMAT_EXTENSIBLE) #define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */ #endif diff --git a/include/mmsystem.h b/include/mmsystem.h index 60d93e3c762..f53f11da143 100644 --- a/include/mmsystem.h +++ b/include/mmsystem.h @@ -243,8 +243,9 @@ DWORD WINAPI GetDriverFlags(HDRVR hDriver); typedef void (CALLBACK *LPDRVCALLBACK)(HDRVR,UINT,DWORD_PTR,DWORD_PTR,DWORD_PTR); +#ifndef MM_MICROSOFT #define MM_MICROSOFT 1 /* Microsoft Corp. */ -#define MM_CREATIVE 2 /* Creative labs */ +#endif #define MM_MIDI_MAPPER 1 /* MIDI Mapper */ #define MM_WAVE_MAPPER 2 /* Wave Mapper */ -- 2.11.4.GIT