Commit 5cf95396 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shell32: Return as soon as requested CLSID is located (Coverity).

parent 94667def
...@@ -59,7 +59,7 @@ static IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pc ...@@ -59,7 +59,7 @@ static IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pc
/* this table contains all CLSIDs of shell32 objects */ /* this table contains all CLSIDs of shell32 objects */
static const struct { static const struct {
REFIID riid; REFIID clsid;
LPFNCREATEINSTANCE lpfnCI; LPFNCREATEINSTANCE lpfnCI;
} InterfaceTable[] = { } InterfaceTable[] = {
...@@ -204,8 +204,8 @@ end: ...@@ -204,8 +204,8 @@ end:
*/ */
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
{ {
HRESULT hres = E_OUTOFMEMORY;
IClassFactory * pcf = NULL; IClassFactory * pcf = NULL;
HRESULT hres;
int i; int i;
TRACE("CLSID:%s,IID:%s\n",shdebugstr_guid(rclsid),shdebugstr_guid(iid)); TRACE("CLSID:%s,IID:%s\n",shdebugstr_guid(rclsid),shdebugstr_guid(iid));
...@@ -214,10 +214,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) ...@@ -214,10 +214,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
*ppv = NULL; *ppv = NULL;
/* search our internal interface table */ /* search our internal interface table */
for(i=0;InterfaceTable[i].riid;i++) { for(i=0;InterfaceTable[i].clsid;i++) {
if(IsEqualIID(InterfaceTable[i].riid, rclsid)) { if(IsEqualIID(InterfaceTable[i].clsid, rclsid)) {
TRACE("index[%u]\n", i); TRACE("index[%u]\n", i);
pcf = IDefClF_fnConstructor(InterfaceTable[i].lpfnCI, NULL, NULL); pcf = IDefClF_fnConstructor(InterfaceTable[i].lpfnCI, NULL, NULL);
break;
} }
} }
......
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