Commit f59b482c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

devenum: Use nameless structs and unions.

parent 49b97bad
MODULE = devenum.dll MODULE = devenum.dll
IMPORTS = dmoguids strmiids uuid ole32 oleaut32 avicap32 winmm user32 advapi32 dsound msdmo IMPORTS = dmoguids strmiids uuid ole32 oleaut32 avicap32 winmm user32 advapi32 dsound msdmo
DELAYIMPORTS = msvfw32 DELAYIMPORTS = msvfw32
EXTRADEFS = -DWINE_NO_NAMELESS_EXTENSION
EXTRADLLFLAGS = -mno-cygwin EXTRADLLFLAGS = -mno-cygwin
......
...@@ -237,8 +237,8 @@ static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2) ...@@ -237,8 +237,8 @@ static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2)
REGFILTERPINS2 *rgPins = NULL; REGFILTERPINS2 *rgPins = NULL;
rgf2->dwVersion = 2; rgf2->dwVersion = 2;
rgf2->u.s2.cPins2 = 0; rgf2->cPins2 = 0;
rgf2->u.s2.rgPins2 = NULL; rgf2->rgPins2 = NULL;
if (RegOpenKeyExW(hkeyFilterClass, L"Pins", 0, KEY_READ, &hkeyPins) != ERROR_SUCCESS) if (RegOpenKeyExW(hkeyFilterClass, L"Pins", 0, KEY_READ, &hkeyPins) != ERROR_SUCCESS)
return ; return ;
...@@ -265,7 +265,7 @@ static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2) ...@@ -265,7 +265,7 @@ static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2)
HKEY hkeyPinKey = NULL; HKEY hkeyPinKey = NULL;
WCHAR wszPinName[MAX_PATH]; WCHAR wszPinName[MAX_PATH];
DWORD cName = ARRAY_SIZE(wszPinName); DWORD cName = ARRAY_SIZE(wszPinName);
REGFILTERPINS2 *rgPin = &rgPins[rgf2->u.s2.cPins2]; REGFILTERPINS2 *rgPin = &rgPins[rgf2->cPins2];
DWORD value, size, Type; DWORD value, size, Type;
LONG lRet; LONG lRet;
...@@ -306,7 +306,7 @@ static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2) ...@@ -306,7 +306,7 @@ static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2)
DEVENUM_ReadPinTypes(hkeyPinKey, rgPin); DEVENUM_ReadPinTypes(hkeyPinKey, rgPin);
++rgf2->u.s2.cPins2; ++rgf2->cPins2;
continue; continue;
error_cleanup: error_cleanup:
...@@ -316,38 +316,38 @@ static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2) ...@@ -316,38 +316,38 @@ static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2)
RegCloseKey(hkeyPins); RegCloseKey(hkeyPins);
if (rgPins && !rgf2->u.s2.cPins2) if (rgPins && !rgf2->cPins2)
{ {
CoTaskMemFree(rgPins); CoTaskMemFree(rgPins);
rgPins = NULL; rgPins = NULL;
} }
rgf2->u.s2.rgPins2 = rgPins; rgf2->rgPins2 = rgPins;
} }
static void free_regfilter2(REGFILTER2 *rgf) static void free_regfilter2(REGFILTER2 *rgf)
{ {
if (rgf->u.s2.rgPins2) if (rgf->rgPins2)
{ {
UINT iPin; UINT iPin;
for (iPin = 0; iPin < rgf->u.s2.cPins2; iPin++) for (iPin = 0; iPin < rgf->cPins2; iPin++)
{ {
if (rgf->u.s2.rgPins2[iPin].lpMediaType) if (rgf->rgPins2[iPin].lpMediaType)
{ {
UINT iType; UINT iType;
for (iType = 0; iType < rgf->u.s2.rgPins2[iPin].nMediaTypes; iType++) for (iType = 0; iType < rgf->rgPins2[iPin].nMediaTypes; iType++)
{ {
CoTaskMemFree((void *)rgf->u.s2.rgPins2[iPin].lpMediaType[iType].clsMajorType); CoTaskMemFree((void *)rgf->rgPins2[iPin].lpMediaType[iType].clsMajorType);
CoTaskMemFree((void *)rgf->u.s2.rgPins2[iPin].lpMediaType[iType].clsMinorType); CoTaskMemFree((void *)rgf->rgPins2[iPin].lpMediaType[iType].clsMinorType);
} }
CoTaskMemFree((void *)rgf->u.s2.rgPins2[iPin].lpMediaType); CoTaskMemFree((void *)rgf->rgPins2[iPin].lpMediaType);
} }
} }
CoTaskMemFree((void *)rgf->u.s2.rgPins2); CoTaskMemFree((void *)rgf->rgPins2);
} }
} }
...@@ -508,8 +508,8 @@ static BOOL CALLBACK register_dsound_devices(GUID *guid, const WCHAR *desc, cons ...@@ -508,8 +508,8 @@ static BOOL CALLBACK register_dsound_devices(GUID *guid, const WCHAR *desc, cons
/* write filter data */ /* write filter data */
rgf.dwVersion = 2; rgf.dwVersion = 2;
rgf.dwMerit = guid ? MERIT_DO_NOT_USE : MERIT_PREFERRED; rgf.dwMerit = guid ? MERIT_DO_NOT_USE : MERIT_PREFERRED;
rgf.u.s2.cPins2 = 1; rgf.cPins2 = 1;
rgf.u.s2.rgPins2 = &rgpins; rgf.rgPins2 = &rgpins;
rgpins.dwFlags = REG_PINFLAG_B_RENDERER; rgpins.dwFlags = REG_PINFLAG_B_RENDERER;
/* FIXME: native registers many more formats */ /* FIXME: native registers many more formats */
rgpins.nMediaTypes = 1; rgpins.nMediaTypes = 1;
...@@ -558,8 +558,8 @@ static void register_waveout_devices(void) ...@@ -558,8 +558,8 @@ static void register_waveout_devices(void)
/* write filter data */ /* write filter data */
rgf.dwVersion = 2; rgf.dwVersion = 2;
rgf.dwMerit = MERIT_DO_NOT_USE; rgf.dwMerit = MERIT_DO_NOT_USE;
rgf.u.s2.cPins2 = 1; rgf.cPins2 = 1;
rgf.u.s2.rgPins2 = &rgpins; rgf.rgPins2 = &rgpins;
rgpins.dwFlags = REG_PINFLAG_B_RENDERER; rgpins.dwFlags = REG_PINFLAG_B_RENDERER;
rgpins.nMediaTypes = 1; rgpins.nMediaTypes = 1;
rgpins.lpMediaType = &rgtypes; rgpins.lpMediaType = &rgtypes;
...@@ -642,8 +642,8 @@ static void register_midiout_devices(void) ...@@ -642,8 +642,8 @@ static void register_midiout_devices(void)
/* write filter data */ /* write filter data */
rgf.dwVersion = 2; rgf.dwVersion = 2;
rgf.dwMerit = (i == -1) ? MERIT_PREFERRED : MERIT_DO_NOT_USE; rgf.dwMerit = (i == -1) ? MERIT_PREFERRED : MERIT_DO_NOT_USE;
rgf.u.s2.cPins2 = 1; rgf.cPins2 = 1;
rgf.u.s2.rgPins2 = &rgpins; rgf.rgPins2 = &rgpins;
rgpins.dwFlags = REG_PINFLAG_B_RENDERER; rgpins.dwFlags = REG_PINFLAG_B_RENDERER;
rgpins.nMediaTypes = 1; rgpins.nMediaTypes = 1;
rgpins.lpMediaType = &rgtypes; rgpins.lpMediaType = &rgtypes;
...@@ -692,8 +692,8 @@ static void register_vfw_codecs(void) ...@@ -692,8 +692,8 @@ static void register_vfw_codecs(void)
/* write filter data */ /* write filter data */
rgf.dwVersion = 2; rgf.dwVersion = 2;
rgf.dwMerit = MERIT_DO_NOT_USE; rgf.dwMerit = MERIT_DO_NOT_USE;
rgf.u.s2.cPins2 = 2; rgf.cPins2 = 2;
rgf.u.s2.rgPins2 = rgpins; rgf.rgPins2 = rgpins;
rgpins[0].dwFlags = 0; rgpins[0].dwFlags = 0;
rgpins[0].nMediaTypes = 1; rgpins[0].nMediaTypes = 1;
rgpins[0].lpMediaType = &rgtypes[0]; rgpins[0].lpMediaType = &rgtypes[0];
...@@ -746,8 +746,8 @@ static void register_avicap_devices(void) ...@@ -746,8 +746,8 @@ static void register_avicap_devices(void)
rgf.dwVersion = 2; rgf.dwVersion = 2;
rgf.dwMerit = MERIT_DO_NOT_USE; rgf.dwMerit = MERIT_DO_NOT_USE;
rgf.u.s2.cPins2 = 1; rgf.cPins2 = 1;
rgf.u.s2.rgPins2 = &rgpins; rgf.rgPins2 = &rgpins;
rgpins.dwFlags = 0; rgpins.dwFlags = 0;
rgpins.nMediaTypes = 1; rgpins.nMediaTypes = 1;
rgpins.lpMediaType = &rgtypes; rgpins.lpMediaType = &rgtypes;
......
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