Commit 87b36442 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

shell32: Pass the object instead of the iface to helper functions.

parent 9e460675
...@@ -3333,10 +3333,9 @@ static HRESULT WINAPI knownfolder_QueryInterface( ...@@ -3333,10 +3333,9 @@ static HRESULT WINAPI knownfolder_QueryInterface(
} }
static HRESULT knownfolder_set_id( static HRESULT knownfolder_set_id(
IKnownFolder *iface, struct knownfolder *knownfolder,
const KNOWNFOLDERID *kfid) const KNOWNFOLDERID *kfid)
{ {
struct knownfolder *knownfolder = impl_from_IKnownFolder( iface );
HKEY hKey; HKEY hKey;
HRESULT hr; HRESULT hr;
...@@ -3636,7 +3635,7 @@ static const struct IKnownFolderVtbl knownfolder_vtbl = ...@@ -3636,7 +3635,7 @@ static const struct IKnownFolderVtbl knownfolder_vtbl =
knownfolder_GetFolderDefinition knownfolder_GetFolderDefinition
}; };
static HRESULT knownfolder_create( void **ppv ) static HRESULT knownfolder_create( struct knownfolder **knownfolder )
{ {
struct knownfolder *kf; struct knownfolder *kf;
...@@ -3648,9 +3647,9 @@ static HRESULT knownfolder_create( void **ppv ) ...@@ -3648,9 +3647,9 @@ static HRESULT knownfolder_create( void **ppv )
memset( &kf->id, 0, sizeof(kf->id) ); memset( &kf->id, 0, sizeof(kf->id) );
kf->registryPath = NULL; kf->registryPath = NULL;
*ppv = &kf->IKnownFolder_iface.lpVtbl; *knownfolder = kf;
TRACE("returning iface %p\n", *ppv); TRACE("returning iface %p\n", &kf->IKnownFolder_iface);
return S_OK; return S_OK;
} }
...@@ -3783,6 +3782,7 @@ static HRESULT WINAPI foldermanager_GetFolder( ...@@ -3783,6 +3782,7 @@ static HRESULT WINAPI foldermanager_GetFolder(
IKnownFolder **ppkf) IKnownFolder **ppkf)
{ {
struct foldermanager *fm = impl_from_IKnownFolderManager( iface ); struct foldermanager *fm = impl_from_IKnownFolderManager( iface );
struct knownfolder *kf;
HRESULT hr; HRESULT hr;
TRACE("%s, %p\n", debugstr_guid(rfid), ppkf); TRACE("%s, %p\n", debugstr_guid(rfid), ppkf);
...@@ -3792,9 +3792,14 @@ static HRESULT WINAPI foldermanager_GetFolder( ...@@ -3792,9 +3792,14 @@ static HRESULT WINAPI foldermanager_GetFolder(
WARN("unknown folder\n"); WARN("unknown folder\n");
return E_INVALIDARG; return E_INVALIDARG;
} }
hr = knownfolder_create( (void **)ppkf ); hr = knownfolder_create( &kf );
if (SUCCEEDED( hr )) if (SUCCEEDED( hr ))
hr = knownfolder_set_id( *ppkf, rfid ); {
hr = knownfolder_set_id( kf, rfid );
*ppkf = &kf->IKnownFolder_iface;
}
else
*ppkf = NULL;
return hr; return hr;
} }
......
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