The big win here is getting rid of the reimplementation of wcsdup.
From: Alex Henrie alexhenrie24@gmail.com
The big win here is getting rid of the reimplementation of wcsdup. --- dlls/dsound/dsound_private.h | 12 ---------- dlls/dsound/propset.c | 46 ++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 35 deletions(-)
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 18dc369db5c..e12baadf650 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -270,15 +270,3 @@ BOOL DSOUND_check_supported(IAudioClient *client, DWORD rate, DWORD depth, WORD channels) DECLSPEC_HIDDEN; HRESULT enumerate_mmdevices(EDataFlow flow, GUID *guids, LPDSENUMCALLBACKW cb, void *user) DECLSPEC_HIDDEN; - -static inline WCHAR *strdupW( const WCHAR *str ) -{ - size_t size; - WCHAR *ret; - - if (!str) return NULL; - size = (lstrlenW( str ) + 1) * sizeof(WCHAR); - ret = HeapAlloc( GetProcessHeap(), 0, size ); - if (ret) memcpy( ret, str, size ); - return ret; -} diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c index f42cfbf4163..55fe288b8f0 100644 --- a/dlls/dsound/propset.c +++ b/dlls/dsound/propset.c @@ -92,7 +92,7 @@ static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface)
if (!ref) { TRACE("(%p) released\n", This); - HeapFree(GetProcessHeap(), 0, This); + free(This); } return ref; } @@ -174,13 +174,13 @@ static HRESULT DSPROPERTY_WaveDeviceMappingA(
data.DataFlow = ppd->DataFlow; len = MultiByteToWideChar(CP_ACP, 0, ppd->DeviceName, -1, NULL, 0); - data.DeviceName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + data.DeviceName = malloc(len * sizeof(WCHAR)); if (!data.DeviceName) return E_OUTOFMEMORY; MultiByteToWideChar(CP_ACP, 0, ppd->DeviceName, -1, data.DeviceName, len);
hr = DSPROPERTY_WaveDeviceMappingW(&data, cbPropData, pcbReturned); - HeapFree(GetProcessHeap(), 0, data.DeviceName); + free(data.DeviceName); ppd->DeviceId = data.DeviceId;
if (pcbReturned) @@ -246,9 +246,9 @@ static HRESULT DSPROPERTY_DescriptionW( return hr; }
- ppd->Description = strdupW(pv.pwszVal); - ppd->Module = strdupW(wine_vxd_drv); - ppd->Interface = strdupW(wInterface); + ppd->Description = wcsdup(pv.pwszVal); + ppd->Module = wcsdup(wine_vxd_drv); + ppd->Interface = wcsdup(wInterface); ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
PropVariantClear(&pv); @@ -281,19 +281,19 @@ BOOL CALLBACK enum_callback(GUID *guid, const WCHAR *desc, const WCHAR *module, data.DeviceId = *guid;
len = lstrlenW(module) + 1; - data.Module = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + data.Module = malloc(len * sizeof(WCHAR)); memcpy(data.Module, module, len * sizeof(WCHAR));
len = lstrlenW(desc) + 1; - data.Description = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + data.Description = malloc(len * sizeof(WCHAR)); memcpy(data.Description, desc, len * sizeof(WCHAR));
data.Interface = wInterface;
ret = ppd->Callback(&data, ppd->Context);
- HeapFree(GetProcessHeap(), 0, data.Module); - HeapFree(GetProcessHeap(), 0, data.Description); + free(data.Module); + free(data.Description);
return ret; } @@ -341,12 +341,12 @@ static BOOL DSPROPERTY_descWtoA(const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W dataA->DeviceId = dataW->DeviceId; dataA->WaveDeviceId = dataW->WaveDeviceId; dataA->Interface = Interface; - dataA->Module = HeapAlloc(GetProcessHeap(), 0, modlen); - dataA->Description = HeapAlloc(GetProcessHeap(), 0, desclen); + dataA->Module = malloc(modlen); + dataA->Description = malloc(desclen); if (!dataA->Module || !dataA->Description) { - HeapFree(GetProcessHeap(), 0, dataA->Module); - HeapFree(GetProcessHeap(), 0, dataA->Description); + free(dataA->Module); + free(dataA->Description); dataA->Module = dataA->Description = NULL; return FALSE; } @@ -381,8 +381,8 @@ static BOOL CALLBACK DSPROPERTY_enumWtoA(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTIO if (!ret) return FALSE; ret = ppd->Callback(&descA, ppd->Context); - HeapFree(GetProcessHeap(), 0, descA.Module); - HeapFree(GetProcessHeap(), 0, descA.Description); + free(descA.Module); + free(descA.Description); return ret; }
@@ -458,9 +458,9 @@ static HRESULT DSPROPERTY_DescriptionA( return hr; if (!DSPROPERTY_descWtoA(&data, ppd)) hr = E_OUTOFMEMORY; - HeapFree(GetProcessHeap(), 0, data.Description); - HeapFree(GetProcessHeap(), 0, data.Module); - HeapFree(GetProcessHeap(), 0, data.Interface); + free(data.Description); + free(data.Module); + free(data.Interface); return hr; }
@@ -484,9 +484,9 @@ static HRESULT DSPROPERTY_Description1( if (FAILED(hr)) return hr; DSPROPERTY_descWto1(&data, ppd); - HeapFree(GetProcessHeap(), 0, data.Description); - HeapFree(GetProcessHeap(), 0, data.Module); - HeapFree(GetProcessHeap(), 0, data.Interface); + free(data.Description); + free(data.Module); + free(data.Interface); return hr; }
@@ -615,7 +615,7 @@ HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, void **ppv)
TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
- iks = HeapAlloc(GetProcessHeap(), 0, sizeof(*iks)); + iks = malloc(sizeof(*iks)); if (!iks) { WARN("out of memory\n"); return DSERR_OUTOFMEMORY;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126211
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors: advapi32:security has no test summary line (early exit of the main process?) advapi32:security has unaccounted for todo messages