Commit 341bf7a4 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

ole32: Only call IROTData::GetComparisonData once, like native does.

parent 04498ba4
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);
/* see MSDN docs for IROTData::GetComparisonData, which states what this
* constant is (http://msdn2.microsoft.com/en-us/library/ms693773.aspx) */
#define MAX_COMPARISON_DATA 2048
/* define the structure of the running object table elements */ /* define the structure of the running object table elements */
struct rot_entry struct rot_entry
{ {
...@@ -139,16 +143,14 @@ static HRESULT get_moniker_comparison_data(IMoniker *pMoniker, MInterfacePointer ...@@ -139,16 +143,14 @@ static HRESULT get_moniker_comparison_data(IMoniker *pMoniker, MInterfacePointer
{ {
HRESULT hr; HRESULT hr;
IROTData *pROTData = NULL; IROTData *pROTData = NULL;
ULONG size = 0; ULONG size = MAX_COMPARISON_DATA;
hr = IMoniker_QueryInterface(pMoniker, &IID_IROTData, (void *)&pROTData); hr = IMoniker_QueryInterface(pMoniker, &IID_IROTData, (void *)&pROTData);
if (hr != S_OK) if (hr != S_OK)
{ {
ERR("Failed to query moniker for IROTData interface, hr = 0x%08x\n", hr); ERR("Failed to query moniker for IROTData interface, hr = 0x%08x\n", hr);
return hr; return hr;
} }
IROTData_GetComparisonData(pROTData, NULL, 0, &size);
*moniker_data = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(MInterfacePointer, abData[size])); *moniker_data = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(MInterfacePointer, abData[size]));
(*moniker_data)->ulCntData = size;
hr = IROTData_GetComparisonData(pROTData, (*moniker_data)->abData, size, &size); hr = IROTData_GetComparisonData(pROTData, (*moniker_data)->abData, size, &size);
if (hr != S_OK) if (hr != S_OK)
{ {
...@@ -156,6 +158,7 @@ static HRESULT get_moniker_comparison_data(IMoniker *pMoniker, MInterfacePointer ...@@ -156,6 +158,7 @@ static HRESULT get_moniker_comparison_data(IMoniker *pMoniker, MInterfacePointer
HeapFree(GetProcessHeap(), 0, *moniker_data); HeapFree(GetProcessHeap(), 0, *moniker_data);
return hr; return hr;
} }
(*moniker_data)->ulCntData = size;
return S_OK; return S_OK;
} }
......
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