On 7/21/2010 08:31, Austin English wrote:
HRESULT WINAPI DMUSIC_CreateDirectMusicPortImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter, LPDMUS_PORTPARAMS pPortParams, LPDMUS_PORTCAPS pPortCaps) { IDirectMusicPortImpl *obj;
HRESULT hr = E_FAIL; UINT j;
TRACE("(%p,%p,%p)\n", lpcGUID, ppobj, pUnkOuter);
@@ -381,7 +380,6 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicPortImpl (LPCGUID lpcGUID, LPVOID *ppobj, obj->caps = *pPortCaps; obj->pDirectSound = NULL; obj->pLatencyClock = NULL;
hr = DMUSIC_CreateReferenceClockImpl(&IID_IReferenceClock, (LPVOID*)&obj->pLatencyClock, NULL);
if(0) {
I doubt you could remove a call here. And probably return value should be used to exit earlier on a failure.