From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/oleaut32/recinfo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/oleaut32/recinfo.c b/dlls/oleaut32/recinfo.c index 7d46d6c4299..7e1cb957af9 100644 --- a/dlls/oleaut32/recinfo.c +++ b/dlls/oleaut32/recinfo.c @@ -179,9 +179,9 @@ static ULONG WINAPI IRecordInfoImpl_Release(IRecordInfo *iface) for(i=0; i<This->n_vars; i++) SysFreeString(This->fields[i].name); SysFreeString(This->name); - HeapFree(GetProcessHeap(), 0, This->fields); + free(This->fields); ITypeInfo_Release(This->pTypeInfo); - HeapFree(GetProcessHeap(), 0, This); + free(This); } return ref; } @@ -667,7 +667,7 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo return E_INVALIDARG; }
- ret = HeapAlloc(GetProcessHeap(), 0, sizeof(*ret)); + ret = calloc(1, sizeof(*ret)); ret->IRecordInfo_iface.lpVtbl = &IRecordInfoImplVtbl; ret->ref = 1; ret->pTypeInfo = pTypeInfo; @@ -687,7 +687,7 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo ret->name = NULL; }
- ret->fields = HeapAlloc(GetProcessHeap(), 0, ret->n_vars*sizeof(fieldstr)); + ret->fields = calloc(ret->n_vars, sizeof(fieldstr)); for(i = 0; i<ret->n_vars; i++) { VARDESC *vardesc; hres = ITypeInfo_GetVarDesc(pTypeInfo, i, &vardesc);
From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/oleaut32/recinfo.c | 6 ++---- dlls/oleaut32/variant.c | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/oleaut32/recinfo.c b/dlls/oleaut32/recinfo.c index 7e1cb957af9..8b6d61adc69 100644 --- a/dlls/oleaut32/recinfo.c +++ b/dlls/oleaut32/recinfo.c @@ -524,7 +524,7 @@ static PVOID WINAPI IRecordInfoImpl_RecordCreate(IRecordInfo *iface)
TRACE("(%p)\n", This);
- record = HeapAlloc(GetProcessHeap(), 0, This->size); + record = CoTaskMemAlloc(This->size); IRecordInfo_RecordInit(iface, record); TRACE("created record at %p\n", record); return record; @@ -555,9 +555,7 @@ static HRESULT WINAPI IRecordInfoImpl_RecordDestroy(IRecordInfo *iface, PVOID pv if(FAILED(hres)) return hres;
- if(!HeapFree(GetProcessHeap(), 0, pvRecord)) - return E_INVALIDARG; - + CoTaskMemFree(pvRecord); return S_OK; }
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 8c2aa3b729d..8186a0b3856 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -686,11 +686,12 @@ static HRESULT VARIANT_CopyIRecordInfo(VARIANT *dest, const VARIANT *src) hr = IRecordInfo_GetSize(src_rec->pRecInfo, &size); if (FAILED(hr)) return hr;
- /* This could look cleaner if only RecordCreate() was used, but native doesn't use it. - Memory should be allocated in a same way as RecordCreate() does, so RecordDestroy() + /* Windows does not use RecordCreate() here, memory should be allocated in compatible way so RecordDestroy() could free it later. */ - dest_rec->pvRecord = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); + dest_rec->pvRecord = CoTaskMemAlloc(size); if (!dest_rec->pvRecord) return E_OUTOFMEMORY; + if (size) + memset(dest_rec->pvRecord, 0, size);
dest_rec->pRecInfo = src_rec->pRecInfo; IRecordInfo_AddRef(src_rec->pRecInfo);
From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/oleaut32/recinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/oleaut32/recinfo.c b/dlls/oleaut32/recinfo.c index 8b6d61adc69..2b1565873d4 100644 --- a/dlls/oleaut32/recinfo.c +++ b/dlls/oleaut32/recinfo.c @@ -595,7 +595,7 @@ HRESULT WINAPI GetRecordInfoFromGuids(REFGUID rGuidTypeLib, ULONG uVerMajor, ITypeLib *pTypeLib; HRESULT hres;
- TRACE("%p, %lu, %lu, %#lx, %s, %p.\n", rGuidTypeLib, uVerMajor, uVerMinor, + TRACE("%s, %lu, %lu, %#lx, %s, %p.\n", debugstr_guid(rGuidTypeLib), uVerMajor, uVerMinor, lcid, debugstr_guid(rGuidTypeInfo), ppRecInfo);
hres = LoadRegTypeLib(rGuidTypeLib, uVerMajor, uVerMinor, lcid, &pTypeLib);