Commit fdbd8cf0 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

shdocvw: Use CRT allocation functions.

parent 0e39cd65
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "shlobj.h" #include "shlobj.h"
#include "exdisp.h" #include "exdisp.h"
#include "wine/heap.h"
#include "wine/list.h" #include "wine/list.h"
/********************************************************************** /**********************************************************************
......
...@@ -104,14 +104,14 @@ DWORD WINAPI IEWinMain(LPSTR szCommandLine, int nShowWindow) ...@@ -104,14 +104,14 @@ DWORD WINAPI IEWinMain(LPSTR szCommandLine, int nShowWindow)
ExitProcess(1); ExitProcess(1);
len = MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, NULL, 0);
cmdline = heap_alloc(len*sizeof(WCHAR)); cmdline = malloc(len * sizeof(WCHAR));
if(!cmdline) if(!cmdline)
ExitProcess(1); ExitProcess(1);
MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, cmdline, len); MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, cmdline, len);
ret = pIEWinMain(cmdline, nShowWindow); ret = pIEWinMain(cmdline, nShowWindow);
heap_free(cmdline); free(cmdline);
return ret; return ret;
} }
...@@ -403,13 +403,13 @@ DWORD WINAPI ParseURLFromOutsideSourceA(LPCSTR url, LPSTR out, LPDWORD plen, LPD ...@@ -403,13 +403,13 @@ DWORD WINAPI ParseURLFromOutsideSourceA(LPCSTR url, LPSTR out, LPDWORD plen, LPD
if (url) { if (url) {
len = MultiByteToWideChar(CP_ACP, 0, url, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, url, -1, NULL, 0);
urlW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); urlW = malloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, url, -1, urlW, len); MultiByteToWideChar(CP_ACP, 0, url, -1, urlW, len);
} }
len = ARRAY_SIZE(buffer); len = ARRAY_SIZE(buffer);
ParseURLFromOutsideSourceW(urlW, buffer, &len, unknown); ParseURLFromOutsideSourceW(urlW, buffer, &len, unknown);
HeapFree(GetProcessHeap(), 0, urlW); free(urlW);
needed = WideCharToMultiByte(CP_ACP, 0, buffer, -1, NULL, 0, NULL, NULL); needed = WideCharToMultiByte(CP_ACP, 0, buffer, -1, NULL, 0, NULL, NULL);
...@@ -460,11 +460,11 @@ DWORD WINAPI SHRestricted2A(DWORD restriction, LPCSTR url, DWORD reserved) ...@@ -460,11 +460,11 @@ DWORD WINAPI SHRestricted2A(DWORD restriction, LPCSTR url, DWORD reserved)
TRACE("(%ld, %s, %ld)\n", restriction, debugstr_a(url), reserved); TRACE("(%ld, %s, %ld)\n", restriction, debugstr_a(url), reserved);
if (url) { if (url) {
DWORD len = MultiByteToWideChar(CP_ACP, 0, url, -1, NULL, 0); DWORD len = MultiByteToWideChar(CP_ACP, 0, url, -1, NULL, 0);
urlW = heap_alloc(len * sizeof(WCHAR)); urlW = malloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, url, -1, urlW, len); MultiByteToWideChar(CP_ACP, 0, url, -1, urlW, len);
} }
res = SHRestricted2W(restriction, urlW, reserved); res = SHRestricted2W(restriction, urlW, reserved);
heap_free(urlW); free(urlW);
return res; return res;
} }
...@@ -547,10 +547,10 @@ BOOL WINAPI DoOrganizeFavDlg(HWND hwnd, LPCSTR initDir) ...@@ -547,10 +547,10 @@ BOOL WINAPI DoOrganizeFavDlg(HWND hwnd, LPCSTR initDir)
if (initDir) { if (initDir) {
DWORD len = MultiByteToWideChar(CP_ACP, 0, initDir, -1, NULL, 0); DWORD len = MultiByteToWideChar(CP_ACP, 0, initDir, -1, NULL, 0);
initDirW = heap_alloc(len * sizeof(WCHAR)); initDirW = malloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, initDir, -1, initDirW, len); MultiByteToWideChar(CP_ACP, 0, initDir, -1, initDirW, len);
} }
res = DoOrganizeFavDlgW(hwnd, initDirW); res = DoOrganizeFavDlgW(hwnd, initDirW);
heap_free(initDirW); free(initDirW);
return res; return res;
} }
...@@ -105,7 +105,7 @@ static ULONG WINAPI RegistryPropertyBag_IPropertyBag_Release(IPropertyBag *iface ...@@ -105,7 +105,7 @@ static ULONG WINAPI RegistryPropertyBag_IPropertyBag_Release(IPropertyBag *iface
if (cRef == 0) { if (cRef == 0) {
TRACE("Destroying This=%p)\n", This); TRACE("Destroying This=%p)\n", This);
RegCloseKey(This->m_hInitPropertyBagKey); RegCloseKey(This->m_hInitPropertyBagKey);
heap_free(This); free(This);
SHDOCVW_UnlockModule(); SHDOCVW_UnlockModule();
} }
...@@ -129,20 +129,20 @@ static HRESULT WINAPI RegistryPropertyBag_IPropertyBag_Read(IPropertyBag *iface, ...@@ -129,20 +129,20 @@ static HRESULT WINAPI RegistryPropertyBag_IPropertyBag_Read(IPropertyBag *iface,
if (res != ERROR_SUCCESS) if (res != ERROR_SUCCESS)
return E_INVALIDARG; return E_INVALIDARG;
pwszValue = heap_alloc(cbData); pwszValue = malloc(cbData);
if (!pwszValue) if (!pwszValue)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
res = RegQueryValueExW(This->m_hInitPropertyBagKey, pwszPropName, NULL, &dwType, res = RegQueryValueExW(This->m_hInitPropertyBagKey, pwszPropName, NULL, &dwType,
(LPBYTE)pwszValue, &cbData); (LPBYTE)pwszValue, &cbData);
if (res != ERROR_SUCCESS) { if (res != ERROR_SUCCESS) {
heap_free(pwszValue); free(pwszValue);
return E_INVALIDARG; return E_INVALIDARG;
} }
V_VT(pVar) = VT_BSTR; V_VT(pVar) = VT_BSTR;
V_BSTR(pVar) = SysAllocString(pwszValue); V_BSTR(pVar) = SysAllocString(pwszValue);
heap_free(pwszValue); free(pwszValue);
if (vtDst != VT_BSTR) { if (vtDst != VT_BSTR) {
hr = VariantChangeTypeEx(pVar, pVar, LOCALE_SYSTEM_DEFAULT, 0, vtDst); hr = VariantChangeTypeEx(pVar, pVar, LOCALE_SYSTEM_DEFAULT, 0, vtDst);
...@@ -174,8 +174,8 @@ static HRESULT RegistryPropertyBag_Constructor(HKEY hInitPropertyBagKey, REFIID ...@@ -174,8 +174,8 @@ static HRESULT RegistryPropertyBag_Constructor(HKEY hInitPropertyBagKey, REFIID
TRACE("(hInitPropertyBagKey=%p, riid=%s, ppvObject=%p)\n", hInitPropertyBagKey, TRACE("(hInitPropertyBagKey=%p, riid=%s, ppvObject=%p)\n", hInitPropertyBagKey,
debugstr_guid(riid), ppvObject); debugstr_guid(riid), ppvObject);
pRegistryPropertyBag = heap_alloc(sizeof(RegistryPropertyBag)); pRegistryPropertyBag = malloc(sizeof(RegistryPropertyBag));
if (pRegistryPropertyBag) { if (pRegistryPropertyBag) {
pRegistryPropertyBag->IPropertyBag_iface.lpVtbl = &RegistryPropertyBag_IPropertyBagVtbl; pRegistryPropertyBag->IPropertyBag_iface.lpVtbl = &RegistryPropertyBag_IPropertyBagVtbl;
pRegistryPropertyBag->m_cRef = 0; pRegistryPropertyBag->m_cRef = 0;
...@@ -256,7 +256,7 @@ static ULONG WINAPI InstanceObjectFactory_IClassFactory_Release(IClassFactory *i ...@@ -256,7 +256,7 @@ static ULONG WINAPI InstanceObjectFactory_IClassFactory_Release(IClassFactory *i
if (cRef == 0) { if (cRef == 0) {
IClassFactory_LockServer(iface, FALSE); IClassFactory_LockServer(iface, FALSE);
IPropertyBag_Release(This->m_pPropertyBag); IPropertyBag_Release(This->m_pPropertyBag);
heap_free(This); free(This);
} }
return cRef; return cRef;
...@@ -322,7 +322,7 @@ static HRESULT InstanceObjectFactory_Constructor(REFCLSID rclsid, IPropertyBag * ...@@ -322,7 +322,7 @@ static HRESULT InstanceObjectFactory_Constructor(REFCLSID rclsid, IPropertyBag *
TRACE("(RegistryPropertyBag=%p, riid=%s, ppvObject=%p)\n", pPropertyBag, TRACE("(RegistryPropertyBag=%p, riid=%s, ppvObject=%p)\n", pPropertyBag,
debugstr_guid(riid), ppvObject); debugstr_guid(riid), ppvObject);
pInstanceObjectFactory = heap_alloc(sizeof(InstanceObjectFactory)); pInstanceObjectFactory = malloc(sizeof(InstanceObjectFactory));
if (pInstanceObjectFactory) { if (pInstanceObjectFactory) {
pInstanceObjectFactory->IClassFactory_iface.lpVtbl = &InstanceObjectFactory_IClassFactoryVtbl; pInstanceObjectFactory->IClassFactory_iface.lpVtbl = &InstanceObjectFactory_IClassFactoryVtbl;
pInstanceObjectFactory->m_cRef = 0; pInstanceObjectFactory->m_cRef = 0;
......
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