Commit 598a12a9 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

quartz: Use nameless unions.

parent b8b57a98
MODULE = quartz.dll MODULE = quartz.dll
IMPORTLIB = quartz IMPORTLIB = quartz
IMPORTS = strmiids dxguid strmbase uuid dsound msacm32 msvfw32 ole32 oleaut32 rpcrt4 user32 gdi32 advapi32 IMPORTS = strmiids dxguid strmbase uuid dsound msacm32 msvfw32 ole32 oleaut32 rpcrt4 user32 gdi32 advapi32
EXTRADEFS = -DWINE_NO_NAMELESS_EXTENSION
EXTRADLLFLAGS = -mno-cygwin EXTRADLLFLAGS = -mno-cygwin
......
...@@ -597,24 +597,24 @@ static HRESULT FM2_WriteFilterData(const REGFILTER2 * prf2, BYTE **ppData, ULONG ...@@ -597,24 +597,24 @@ static HRESULT FM2_WriteFilterData(const REGFILTER2 * prf2, BYTE **ppData, ULONG
rrf.dwVersion = prf2->dwVersion; rrf.dwVersion = prf2->dwVersion;
rrf.dwMerit = prf2->dwMerit; rrf.dwMerit = prf2->dwMerit;
rrf.dwPins = prf2->u.s2.cPins2; rrf.dwPins = prf2->cPins2;
rrf.dwUnused = 0; rrf.dwUnused = 0;
add_data(&mainStore, &rrf, sizeof(rrf)); add_data(&mainStore, &rrf, sizeof(rrf));
for (i = 0; i < prf2->u.s2.cPins2; i++) for (i = 0; i < prf2->cPins2; i++)
{ {
size += sizeof(struct REG_RFP); size += sizeof(struct REG_RFP);
if (prf2->u.s2.rgPins2[i].clsPinCategory) if (prf2->rgPins2[i].clsPinCategory)
size += sizeof(DWORD); size += sizeof(DWORD);
size += prf2->u.s2.rgPins2[i].nMediaTypes * sizeof(struct REG_TYPE); size += prf2->rgPins2[i].nMediaTypes * sizeof(struct REG_TYPE);
size += prf2->u.s2.rgPins2[i].nMediums * sizeof(DWORD); size += prf2->rgPins2[i].nMediums * sizeof(DWORD);
} }
for (i = 0; i < prf2->u.s2.cPins2; i++) for (i = 0; i < prf2->cPins2; i++)
{ {
struct REG_RFP rrfp; struct REG_RFP rrfp;
REGFILTERPINS2 rgPin2 = prf2->u.s2.rgPins2[i]; REGFILTERPINS2 rgPin2 = prf2->rgPins2[i];
unsigned int j; unsigned int j;
rrfp.signature[0] = '0'; rrfp.signature[0] = '0';
...@@ -716,9 +716,9 @@ static HRESULT FM2_ReadFilterData(BYTE *pData, REGFILTER2 * prf2) ...@@ -716,9 +716,9 @@ static HRESULT FM2_ReadFilterData(BYTE *pData, REGFILTER2 * prf2)
prf2->dwVersion = prrf->dwVersion; prf2->dwVersion = prrf->dwVersion;
prf2->dwMerit = prrf->dwMerit; prf2->dwMerit = prrf->dwMerit;
prf2->u.s2.cPins2 = prrf->dwPins; prf2->cPins2 = prrf->dwPins;
rgPins2 = CoTaskMemAlloc(prrf->dwPins * sizeof(*rgPins2)); rgPins2 = CoTaskMemAlloc(prrf->dwPins * sizeof(*rgPins2));
prf2->u.s2.rgPins2 = rgPins2; prf2->rgPins2 = rgPins2;
pCurrent += sizeof(struct REG_RF); pCurrent += sizeof(struct REG_RF);
for (i = 0; i < prrf->dwPins; i++) for (i = 0; i < prrf->dwPins; i++)
...@@ -800,20 +800,20 @@ static HRESULT FM2_ReadFilterData(BYTE *pData, REGFILTER2 * prf2) ...@@ -800,20 +800,20 @@ static HRESULT FM2_ReadFilterData(BYTE *pData, REGFILTER2 * prf2)
static void FM2_DeleteRegFilter(REGFILTER2 * prf2) static void FM2_DeleteRegFilter(REGFILTER2 * prf2)
{ {
UINT i; UINT i;
for (i = 0; i < prf2->u.s2.cPins2; i++) for (i = 0; i < prf2->cPins2; i++)
{ {
UINT j; UINT j;
CoTaskMemFree((void*)prf2->u.s2.rgPins2[i].clsPinCategory); CoTaskMemFree((void*)prf2->rgPins2[i].clsPinCategory);
for (j = 0; j < prf2->u.s2.rgPins2[i].nMediaTypes; j++) for (j = 0; j < prf2->rgPins2[i].nMediaTypes; j++)
{ {
CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2[i].lpMediaType[j].clsMajorType); CoTaskMemFree((LPVOID)prf2->rgPins2[i].lpMediaType[j].clsMajorType);
CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2[i].lpMediaType[j].clsMinorType); CoTaskMemFree((LPVOID)prf2->rgPins2[i].lpMediaType[j].clsMinorType);
} }
CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2[i].lpMediaType); CoTaskMemFree((LPVOID)prf2->rgPins2[i].lpMediaType);
CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2[i].lpMedium); CoTaskMemFree((LPVOID)prf2->rgPins2[i].lpMedium);
} }
CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2); CoTaskMemFree((LPVOID)prf2->rgPins2);
} }
static HRESULT WINAPI FilterMapper3_RegisterFilter(IFilterMapper3 *iface, static HRESULT WINAPI FilterMapper3_RegisterFilter(IFilterMapper3 *iface,
...@@ -848,24 +848,24 @@ static HRESULT WINAPI FilterMapper3_RegisterFilter(IFilterMapper3 *iface, ...@@ -848,24 +848,24 @@ static HRESULT WINAPI FilterMapper3_RegisterFilter(IFilterMapper3 *iface,
/* REGFILTER2 structure is converted from version 1 to 2. Tested on Win2k. */ /* REGFILTER2 structure is converted from version 1 to 2. Tested on Win2k. */
regfilter2.dwVersion = 2; regfilter2.dwVersion = 2;
regfilter2.dwMerit = prf2->dwMerit; regfilter2.dwMerit = prf2->dwMerit;
regfilter2.u.s2.cPins2 = prf2->u.s1.cPins; regfilter2.cPins2 = prf2->cPins;
pregfp2 = CoTaskMemAlloc(prf2->u.s1.cPins * sizeof(REGFILTERPINS2)); pregfp2 = CoTaskMemAlloc(prf2->cPins * sizeof(REGFILTERPINS2));
regfilter2.u.s2.rgPins2 = pregfp2; regfilter2.rgPins2 = pregfp2;
for (i = 0; i < prf2->u.s1.cPins; i++) for (i = 0; i < prf2->cPins; i++)
{ {
flags = 0; flags = 0;
if (prf2->u.s1.rgPins[i].bRendered) if (prf2->rgPins[i].bRendered)
flags |= REG_PINFLAG_B_RENDERER; flags |= REG_PINFLAG_B_RENDERER;
if (prf2->u.s1.rgPins[i].bOutput) if (prf2->rgPins[i].bOutput)
flags |= REG_PINFLAG_B_OUTPUT; flags |= REG_PINFLAG_B_OUTPUT;
if (prf2->u.s1.rgPins[i].bZero) if (prf2->rgPins[i].bZero)
flags |= REG_PINFLAG_B_ZERO; flags |= REG_PINFLAG_B_ZERO;
if (prf2->u.s1.rgPins[i].bMany) if (prf2->rgPins[i].bMany)
flags |= REG_PINFLAG_B_MANY; flags |= REG_PINFLAG_B_MANY;
pregfp2[i].dwFlags = flags; pregfp2[i].dwFlags = flags;
pregfp2[i].cInstances = 1; pregfp2[i].cInstances = 1;
pregfp2[i].nMediaTypes = prf2->u.s1.rgPins[i].nMediaTypes; pregfp2[i].nMediaTypes = prf2->rgPins[i].nMediaTypes;
pregfp2[i].lpMediaType = prf2->u.s1.rgPins[i].lpMediaType; pregfp2[i].lpMediaType = prf2->rgPins[i].lpMediaType;
pregfp2[i].nMediums = 0; pregfp2[i].nMediums = 0;
pregfp2[i].lpMedium = NULL; pregfp2[i].lpMedium = NULL;
pregfp2[i].clsPinCategory = NULL; pregfp2[i].clsPinCategory = NULL;
...@@ -1152,9 +1152,9 @@ static HRESULT WINAPI FilterMapper3_EnumMatchingFilters( ...@@ -1152,9 +1152,9 @@ static HRESULT WINAPI FilterMapper3_EnumMatchingFilters(
/* determine whether filter meets requirements */ /* determine whether filter meets requirements */
if (SUCCEEDED(hrSub) && (rf2.dwMerit >= dwMerit)) if (SUCCEEDED(hrSub) && (rf2.dwMerit >= dwMerit))
{ {
for (i = 0; (i < rf2.u.s2.cPins2) && (!bInputMatch || !bOutputMatch); i++) for (i = 0; (i < rf2.cPins2) && (!bInputMatch || !bOutputMatch); i++)
{ {
const REGFILTERPINS2 * rfp2 = rf2.u.s2.rgPins2 + i; const REGFILTERPINS2 * rfp2 = rf2.rgPins2 + i;
bInputMatch = bInputMatch || (!(rfp2->dwFlags & REG_PINFLAG_B_OUTPUT) && bInputMatch = bInputMatch || (!(rfp2->dwFlags & REG_PINFLAG_B_OUTPUT) &&
(!bRender || (rfp2->dwFlags & REG_PINFLAG_B_RENDERER)) && (!bRender || (rfp2->dwFlags & REG_PINFLAG_B_RENDERER)) &&
......
...@@ -86,8 +86,8 @@ static HRESULT register_filters(struct regsvr_filter const *list) ...@@ -86,8 +86,8 @@ static HRESULT register_filters(struct regsvr_filter const *list)
for (i = 0; list->pins[i].flags != 0xFFFFFFFF; i++) ; for (i = 0; list->pins[i].flags != 0xFFFFFFFF; i++) ;
rf2.dwVersion = 2; rf2.dwVersion = 2;
rf2.dwMerit = list->merit; rf2.dwMerit = list->merit;
rf2.u.s2.cPins2 = i; rf2.cPins2 = i;
rf2.u.s2.rgPins2 = prfp2 = CoTaskMemAlloc(i*sizeof(REGFILTERPINS2)); rf2.rgPins2 = prfp2 = CoTaskMemAlloc(i*sizeof(REGFILTERPINS2));
if (!prfp2) { if (!prfp2) {
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
break; break;
......
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