Commit 787ccc80 authored by Peter Dons Tychsen's avatar Peter Dons Tychsen Committed by Alexandre Julliard

devenum: Fix the implementation of IEnumMoniker::Skip(), to match the MSDN specs.

parent 53f64a09
...@@ -800,9 +800,21 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(LPENUMMONIKER iface, ULONG celt, ...@@ -800,9 +800,21 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(LPENUMMONIKER iface, ULONG celt,
static HRESULT WINAPI DEVENUM_IEnumMoniker_Skip(LPENUMMONIKER iface, ULONG celt) static HRESULT WINAPI DEVENUM_IEnumMoniker_Skip(LPENUMMONIKER iface, ULONG celt)
{ {
EnumMonikerImpl *This = (EnumMonikerImpl *)iface; EnumMonikerImpl *This = (EnumMonikerImpl *)iface;
DWORD subKeys;
TRACE("(%p)->(%d)\n", iface, celt); TRACE("(%p)->(%d)\n", iface, celt);
/* Before incrementing, check if there are any more values to run thru.
Some programs use the Skip() function to get the amount of devices */
if(RegQueryInfoKeyW(This->hkey, NULL, NULL, NULL, &subKeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
{
return S_FALSE;
}
if((This->index + celt) >= subKeys)
{
return S_FALSE;
}
This->index += celt; This->index += celt;
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