oledb32: Implement GetCustomErrorObject().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
41984c62a6
commit
333039f318
|
@ -42,7 +42,7 @@ struct ErrorEntry
|
||||||
{
|
{
|
||||||
ERRORINFO info;
|
ERRORINFO info;
|
||||||
DISPPARAMS dispparams;
|
DISPPARAMS dispparams;
|
||||||
IUnknown *unknown;
|
IUnknown *custom_error;
|
||||||
DWORD lookupID;
|
DWORD lookupID;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -113,8 +113,8 @@ static ULONG WINAPI IErrorInfoImpl_Release(IErrorInfo* iface)
|
||||||
|
|
||||||
for (i = 0; i < This->count; i++)
|
for (i = 0; i < This->count; i++)
|
||||||
{
|
{
|
||||||
if (This->records[i].unknown)
|
if (This->records[i].custom_error)
|
||||||
IUnknown_Release(This->records[i].unknown);
|
IUnknown_Release(This->records[i].custom_error);
|
||||||
}
|
}
|
||||||
heap_free(This->records);
|
heap_free(This->records);
|
||||||
heap_free(This);
|
heap_free(This);
|
||||||
|
@ -257,9 +257,9 @@ static HRESULT WINAPI errorrec_AddErrorRecord(IErrorRecords *iface, ERRORINFO *p
|
||||||
entry->info = *pErrorInfo;
|
entry->info = *pErrorInfo;
|
||||||
if(pdispparams)
|
if(pdispparams)
|
||||||
entry->dispparams = *pdispparams;
|
entry->dispparams = *pdispparams;
|
||||||
entry->unknown = punkCustomError;
|
entry->custom_error = punkCustomError;
|
||||||
if(entry->unknown)
|
if (entry->custom_error)
|
||||||
IUnknown_AddRef(entry->unknown);
|
IUnknown_AddRef(entry->custom_error);
|
||||||
entry->lookupID = dwDynamicErrorID;
|
entry->lookupID = dwDynamicErrorID;
|
||||||
|
|
||||||
This->count++;
|
This->count++;
|
||||||
|
@ -283,21 +283,25 @@ static HRESULT WINAPI errorrec_GetBasicErrorInfo(IErrorRecords *iface, ULONG ind
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI errorrec_GetCustomErrorObject(IErrorRecords *iface, ULONG index,
|
static HRESULT WINAPI errorrec_GetCustomErrorObject(IErrorRecords *iface, ULONG index,
|
||||||
REFIID riid, IUnknown **ppObject)
|
REFIID riid, IUnknown **object)
|
||||||
{
|
{
|
||||||
ErrorInfoImpl *This = impl_from_IErrorRecords(iface);
|
ErrorInfoImpl *This = impl_from_IErrorRecords(iface);
|
||||||
|
|
||||||
FIXME("(%p)->(%u %s, %p)\n", This, index, debugstr_guid(riid), ppObject);
|
TRACE("(%p)->(%u %s %p)\n", This, index, debugstr_guid(riid), object);
|
||||||
|
|
||||||
if (!ppObject)
|
if (!object)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
*ppObject = NULL;
|
*object = NULL;
|
||||||
|
|
||||||
if (index >= This->count)
|
if (index >= This->count)
|
||||||
return DB_E_BADRECORDNUM;
|
return DB_E_BADRECORDNUM;
|
||||||
|
|
||||||
return E_NOTIMPL;
|
index = This->count - index - 1;
|
||||||
|
if (This->records[index].custom_error)
|
||||||
|
return IUnknown_QueryInterface(This->records[index].custom_error, riid, (void **)object);
|
||||||
|
else
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI errorrec_GetErrorInfo(IErrorRecords *iface, ULONG index,
|
static HRESULT WINAPI errorrec_GetErrorInfo(IErrorRecords *iface, ULONG index,
|
||||||
|
|
|
@ -414,6 +414,12 @@ static void test_errorinfo(void)
|
||||||
ok(hr == S_OK, "got %08x\n", hr);
|
ok(hr == S_OK, "got %08x\n", hr);
|
||||||
ok(cnt == 1, "expected 1 got %d\n", cnt);
|
ok(cnt == 1, "expected 1 got %d\n", cnt);
|
||||||
|
|
||||||
|
/* Record does not contain custom error object. */
|
||||||
|
unk2 = (void*)0xdeadbeef;
|
||||||
|
hr = IErrorRecords_GetCustomErrorObject(errrecs, 0, &IID_IUnknown, &unk2);
|
||||||
|
ok(hr == S_OK, "got %08x\n", hr);
|
||||||
|
ok(unk2 == NULL, "Got custom object %p.\n", unk2);
|
||||||
|
|
||||||
hr = IErrorRecords_AddErrorRecord(errrecs, &info2, 2, NULL, NULL, 0);
|
hr = IErrorRecords_AddErrorRecord(errrecs, &info2, 2, NULL, NULL, 0);
|
||||||
ok(hr == S_OK, "got %08x\n", hr);
|
ok(hr == S_OK, "got %08x\n", hr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue