Commit ba999f05 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Test HRESULT values using proper success code.

parent 2f21130f
...@@ -2910,7 +2910,7 @@ HRESULT WINAPI CoCreateInstance( ...@@ -2910,7 +2910,7 @@ HRESULT WINAPI CoCreateInstance(
{ {
IGlobalInterfaceTable *git = get_std_git(); IGlobalInterfaceTable *git = get_std_git();
hres = IGlobalInterfaceTable_QueryInterface(git, iid, ppv); hres = IGlobalInterfaceTable_QueryInterface(git, iid, ppv);
if (hres) return hres; if (hres != S_OK) return hres;
TRACE("Retrieved GIT (%p)\n", *ppv); TRACE("Retrieved GIT (%p)\n", *ppv);
return S_OK; return S_OK;
...@@ -2992,7 +2992,7 @@ HRESULT WINAPI CoCreateInstanceEx( ...@@ -2992,7 +2992,7 @@ HRESULT WINAPI CoCreateInstanceEx(
&IID_IUnknown, &IID_IUnknown,
(VOID**)&pUnk); (VOID**)&pUnk);
if (hr) if (hr != S_OK)
return hr; return hr;
/* /*
......
...@@ -296,7 +296,7 @@ StdGlobalInterfaceTable_GetInterfaceFromGlobal( ...@@ -296,7 +296,7 @@ StdGlobalInterfaceTable_GetInterfaceFromGlobal(
hres = CoUnmarshalInterface(stream, riid, ppv); hres = CoUnmarshalInterface(stream, riid, ppv);
IStream_Release(stream); IStream_Release(stream);
if (hres) { if (hres != S_OK) {
WARN("Failed to unmarshal stream\n"); WARN("Failed to unmarshal stream\n");
return hres; return hres;
} }
......
...@@ -1519,7 +1519,7 @@ static void __RPC_STUB dispatch_rpc(RPC_MESSAGE *msg) ...@@ -1519,7 +1519,7 @@ static void __RPC_STUB dispatch_rpc(RPC_MESSAGE *msg)
/* if IRpcStubBuffer_Invoke fails, we should raise an exception to tell /* if IRpcStubBuffer_Invoke fails, we should raise an exception to tell
* the RPC runtime that the call failed */ * the RPC runtime that the call failed */
if (hr) RpcRaiseException(hr); if (hr != S_OK) RpcRaiseException(hr);
} }
/* stub registration */ /* stub registration */
...@@ -1656,6 +1656,7 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process) ...@@ -1656,6 +1656,7 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process)
DWORD size = (MAX_PATH+1) * sizeof(WCHAR); DWORD size = (MAX_PATH+1) * sizeof(WCHAR);
STARTUPINFOW sinfo; STARTUPINFOW sinfo;
PROCESS_INFORMATION pinfo; PROCESS_INFORMATION pinfo;
LONG ret;
hres = COM_OpenKeyForCLSID(rclsid, wszLocalServer32, KEY_READ, &key); hres = COM_OpenKeyForCLSID(rclsid, wszLocalServer32, KEY_READ, &key);
if (FAILED(hres)) { if (FAILED(hres)) {
...@@ -1663,9 +1664,9 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process) ...@@ -1663,9 +1664,9 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process)
return hres; return hres;
} }
hres = RegQueryValueExW(key, NULL, NULL, NULL, (LPBYTE)command, &size); ret = RegQueryValueExW(key, NULL, NULL, NULL, (LPBYTE)command, &size);
RegCloseKey(key); RegCloseKey(key);
if (hres) { if (ret) {
WARN("No default value for LocalServer32 key\n"); WARN("No default value for LocalServer32 key\n");
return REGDB_E_CLASSNOTREG; /* FIXME: check retval */ return REGDB_E_CLASSNOTREG; /* FIXME: check retval */
} }
...@@ -1861,9 +1862,9 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) ...@@ -1861,9 +1862,9 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
return E_NOINTERFACE; return E_NOINTERFACE;
hres = CreateStreamOnHGlobal(0,TRUE,&pStm); hres = CreateStreamOnHGlobal(0,TRUE,&pStm);
if (hres) return hres; if (hres != S_OK) return hres;
hres = IStream_Write(pStm,marshalbuffer,bufferlen,&res); hres = IStream_Write(pStm,marshalbuffer,bufferlen,&res);
if (hres) goto out; if (hres != S_OK) goto out;
seekto.u.LowPart = 0;seekto.u.HighPart = 0; seekto.u.LowPart = 0;seekto.u.HighPart = 0;
hres = IStream_Seek(pStm,seekto,STREAM_SEEK_SET,&newpos); hres = IStream_Seek(pStm,seekto,STREAM_SEEK_SET,&newpos);
...@@ -1935,13 +1936,13 @@ static DWORD WINAPI local_server_thread(LPVOID param) ...@@ -1935,13 +1936,13 @@ static DWORD WINAPI local_server_thread(LPVOID param)
TRACE("marshalling LocalServer to client\n"); TRACE("marshalling LocalServer to client\n");
hres = IStream_Stat(pStm,&ststg,STATFLAG_NONAME); hres = IStream_Stat(pStm,&ststg,STATFLAG_NONAME);
if (hres) if (hres != S_OK)
break; break;
seekto.u.LowPart = 0; seekto.u.LowPart = 0;
seekto.u.HighPart = 0; seekto.u.HighPart = 0;
hres = IStream_Seek(pStm,seekto,STREAM_SEEK_SET,&newpos); hres = IStream_Seek(pStm,seekto,STREAM_SEEK_SET,&newpos);
if (hres) { if (hres != S_OK) {
FIXME("IStream_Seek failed, %x\n",hres); FIXME("IStream_Seek failed, %x\n",hres);
break; break;
} }
...@@ -1950,7 +1951,7 @@ static DWORD WINAPI local_server_thread(LPVOID param) ...@@ -1950,7 +1951,7 @@ static DWORD WINAPI local_server_thread(LPVOID param)
buffer = HeapAlloc(GetProcessHeap(),0,buflen); buffer = HeapAlloc(GetProcessHeap(),0,buflen);
hres = IStream_Read(pStm,buffer,buflen,&res); hres = IStream_Read(pStm,buffer,buflen,&res);
if (hres) { if (hres != S_OK) {
FIXME("Stream Read failed, %x\n",hres); FIXME("Stream Read failed, %x\n",hres);
HeapFree(GetProcessHeap(),0,buffer); HeapFree(GetProcessHeap(),0,buffer);
break; 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