ole32: Indentation fix.
This commit is contained in:
parent
8cf55497cc
commit
fa96beb5c4
@ -2727,83 +2727,82 @@ HRESULT WINAPI CoResumeClassObjects(void)
|
|||||||
* CoGetClassObject()
|
* CoGetClassObject()
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CoCreateInstance(
|
HRESULT WINAPI CoCreateInstance(
|
||||||
REFCLSID rclsid,
|
REFCLSID rclsid,
|
||||||
LPUNKNOWN pUnkOuter,
|
LPUNKNOWN pUnkOuter,
|
||||||
DWORD dwClsContext,
|
DWORD dwClsContext,
|
||||||
REFIID iid,
|
REFIID iid,
|
||||||
LPVOID *ppv)
|
LPVOID *ppv)
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
LPCLASSFACTORY lpclf = 0;
|
LPCLASSFACTORY lpclf = 0;
|
||||||
APARTMENT *apt;
|
APARTMENT *apt;
|
||||||
|
|
||||||
TRACE("(rclsid=%s, pUnkOuter=%p, dwClsContext=%08x, riid=%s, ppv=%p)\n", debugstr_guid(rclsid),
|
TRACE("(rclsid=%s, pUnkOuter=%p, dwClsContext=%08x, riid=%s, ppv=%p)\n", debugstr_guid(rclsid),
|
||||||
pUnkOuter, dwClsContext, debugstr_guid(iid), ppv);
|
pUnkOuter, dwClsContext, debugstr_guid(iid), ppv);
|
||||||
|
|
||||||
/*
|
if (ppv==0)
|
||||||
* Sanity check
|
return E_POINTER;
|
||||||
*/
|
|
||||||
if (ppv==0)
|
|
||||||
return E_POINTER;
|
|
||||||
|
|
||||||
/*
|
*ppv = 0;
|
||||||
* Initialize the "out" parameter
|
|
||||||
*/
|
|
||||||
*ppv = 0;
|
|
||||||
|
|
||||||
if (!(apt = COM_CurrentApt()))
|
if (!(apt = COM_CurrentApt()))
|
||||||
{
|
|
||||||
if (!(apt = apartment_find_multi_threaded()))
|
|
||||||
{
|
{
|
||||||
ERR("apartment not initialised\n");
|
if (!(apt = apartment_find_multi_threaded()))
|
||||||
return CO_E_NOTINITIALIZED;
|
|
||||||
}
|
|
||||||
apartment_release(apt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The Standard Global Interface Table (GIT) object is a process-wide singleton.
|
|
||||||
* Rather than create a class factory, we can just check for it here
|
|
||||||
*/
|
|
||||||
if (IsEqualIID(rclsid, &CLSID_StdGlobalInterfaceTable)) {
|
|
||||||
if (StdGlobalInterfaceTableInstance == NULL)
|
|
||||||
StdGlobalInterfaceTableInstance = StdGlobalInterfaceTable_Construct();
|
|
||||||
hres = IGlobalInterfaceTable_QueryInterface( (IGlobalInterfaceTable*) StdGlobalInterfaceTableInstance, iid, ppv);
|
|
||||||
if (hres) return hres;
|
|
||||||
|
|
||||||
TRACE("Retrieved GIT (%p)\n", *ppv);
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsEqualCLSID(rclsid, &CLSID_ManualResetEvent))
|
|
||||||
return ManualResetEvent_Construct(pUnkOuter, iid, ppv);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get a class factory to construct the object we want.
|
|
||||||
*/
|
|
||||||
hres = CoGetClassObject(rclsid,
|
|
||||||
dwClsContext,
|
|
||||||
NULL,
|
|
||||||
&IID_IClassFactory,
|
|
||||||
(LPVOID)&lpclf);
|
|
||||||
|
|
||||||
if (FAILED(hres))
|
|
||||||
return hres;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Create the object and don't forget to release the factory
|
|
||||||
*/
|
|
||||||
hres = IClassFactory_CreateInstance(lpclf, pUnkOuter, iid, ppv);
|
|
||||||
IClassFactory_Release(lpclf);
|
|
||||||
if(FAILED(hres))
|
|
||||||
{
|
{
|
||||||
if (hres == CLASS_E_NOAGGREGATION && pUnkOuter)
|
ERR("apartment not initialised\n");
|
||||||
FIXME("Class %s does not support aggregation\n", debugstr_guid(rclsid));
|
return CO_E_NOTINITIALIZED;
|
||||||
else
|
|
||||||
FIXME("no instance created for interface %s of class %s, hres is 0x%08x\n", debugstr_guid(iid), debugstr_guid(rclsid),hres);
|
|
||||||
}
|
}
|
||||||
|
apartment_release(apt);
|
||||||
|
}
|
||||||
|
|
||||||
return hres;
|
/*
|
||||||
|
* The Standard Global Interface Table (GIT) object is a process-wide singleton.
|
||||||
|
* Rather than create a class factory, we can just check for it here
|
||||||
|
*/
|
||||||
|
if (IsEqualIID(rclsid, &CLSID_StdGlobalInterfaceTable))
|
||||||
|
{
|
||||||
|
if (StdGlobalInterfaceTableInstance == NULL)
|
||||||
|
StdGlobalInterfaceTableInstance = StdGlobalInterfaceTable_Construct();
|
||||||
|
hres = IGlobalInterfaceTable_QueryInterface((IGlobalInterfaceTable*)StdGlobalInterfaceTableInstance,
|
||||||
|
iid,
|
||||||
|
ppv);
|
||||||
|
if (hres) return hres;
|
||||||
|
|
||||||
|
TRACE("Retrieved GIT (%p)\n", *ppv);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsEqualCLSID(rclsid, &CLSID_ManualResetEvent))
|
||||||
|
return ManualResetEvent_Construct(pUnkOuter, iid, ppv);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get a class factory to construct the object we want.
|
||||||
|
*/
|
||||||
|
hres = CoGetClassObject(rclsid,
|
||||||
|
dwClsContext,
|
||||||
|
NULL,
|
||||||
|
&IID_IClassFactory,
|
||||||
|
(LPVOID)&lpclf);
|
||||||
|
|
||||||
|
if (FAILED(hres))
|
||||||
|
return hres;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create the object and don't forget to release the factory
|
||||||
|
*/
|
||||||
|
hres = IClassFactory_CreateInstance(lpclf, pUnkOuter, iid, ppv);
|
||||||
|
IClassFactory_Release(lpclf);
|
||||||
|
if (FAILED(hres))
|
||||||
|
{
|
||||||
|
if (hres == CLASS_E_NOAGGREGATION && pUnkOuter)
|
||||||
|
FIXME("Class %s does not support aggregation\n", debugstr_guid(rclsid));
|
||||||
|
else
|
||||||
|
FIXME("no instance created for interface %s of class %s, hres is 0x%08x\n",
|
||||||
|
debugstr_guid(iid),
|
||||||
|
debugstr_guid(rclsid),hres);
|
||||||
|
}
|
||||||
|
|
||||||
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -1877,11 +1877,11 @@ HOLEMENU WINAPI OleCreateMenuDescriptor(
|
|||||||
* Destroy the shared menu descriptor
|
* Destroy the shared menu descriptor
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI OleDestroyMenuDescriptor(
|
HRESULT WINAPI OleDestroyMenuDescriptor(
|
||||||
HOLEMENU hmenuDescriptor)
|
HOLEMENU hmenuDescriptor)
|
||||||
{
|
{
|
||||||
if ( hmenuDescriptor )
|
if ( hmenuDescriptor )
|
||||||
GlobalFree( hmenuDescriptor );
|
GlobalFree( hmenuDescriptor );
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
@ -1905,72 +1905,73 @@ HRESULT WINAPI OleDestroyMenuDescriptor(
|
|||||||
* these are non null.
|
* these are non null.
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI OleSetMenuDescriptor(
|
HRESULT WINAPI OleSetMenuDescriptor(
|
||||||
HOLEMENU hOleMenu,
|
HOLEMENU hOleMenu,
|
||||||
HWND hwndFrame,
|
HWND hwndFrame,
|
||||||
HWND hwndActiveObject,
|
HWND hwndActiveObject,
|
||||||
LPOLEINPLACEFRAME lpFrame,
|
LPOLEINPLACEFRAME lpFrame,
|
||||||
LPOLEINPLACEACTIVEOBJECT lpActiveObject)
|
LPOLEINPLACEACTIVEOBJECT lpActiveObject)
|
||||||
{
|
{
|
||||||
OleMenuDescriptor *pOleMenuDescriptor = NULL;
|
OleMenuDescriptor *pOleMenuDescriptor = NULL;
|
||||||
|
|
||||||
/* Check args */
|
/* Check args */
|
||||||
if ( !hwndFrame || (hOleMenu && !hwndActiveObject) )
|
if ( !hwndFrame || (hOleMenu && !hwndActiveObject) )
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
if ( lpFrame || lpActiveObject )
|
if ( lpFrame || lpActiveObject )
|
||||||
{
|
{
|
||||||
FIXME("(%p, %p, %p, %p, %p), Context sensitive help filtering not implemented!\n",
|
FIXME("(%p, %p, %p, %p, %p), Context sensitive help filtering not implemented!\n",
|
||||||
hOleMenu,
|
hOleMenu,
|
||||||
hwndFrame,
|
hwndFrame,
|
||||||
hwndActiveObject,
|
hwndActiveObject,
|
||||||
lpFrame,
|
lpFrame,
|
||||||
lpActiveObject);
|
lpActiveObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set up a message hook to intercept the containers frame window messages.
|
/* Set up a message hook to intercept the containers frame window messages.
|
||||||
* The message filter is responsible for dispatching menu messages from the
|
* The message filter is responsible for dispatching menu messages from the
|
||||||
* shared menu which are intended for the object.
|
* shared menu which are intended for the object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( hOleMenu ) /* Want to install dispatching code */
|
if ( hOleMenu ) /* Want to install dispatching code */
|
||||||
{
|
{
|
||||||
/* If OLEMenu hooks are already installed for this thread, fail
|
/* If OLEMenu hooks are already installed for this thread, fail
|
||||||
* Note: This effectively means that OleSetMenuDescriptor cannot
|
* Note: This effectively means that OleSetMenuDescriptor cannot
|
||||||
* be called twice in succession on the same frame window
|
* be called twice in succession on the same frame window
|
||||||
* without first calling it with a null hOleMenu to uninstall */
|
* without first calling it with a null hOleMenu to uninstall
|
||||||
if ( OLEMenu_IsHookInstalled( GetCurrentThreadId() ) )
|
*/
|
||||||
return E_FAIL;
|
if ( OLEMenu_IsHookInstalled( GetCurrentThreadId() ) )
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
/* Get the menu descriptor */
|
/* Get the menu descriptor */
|
||||||
pOleMenuDescriptor = GlobalLock( hOleMenu );
|
pOleMenuDescriptor = GlobalLock( hOleMenu );
|
||||||
if ( !pOleMenuDescriptor )
|
if ( !pOleMenuDescriptor )
|
||||||
return E_UNEXPECTED;
|
return E_UNEXPECTED;
|
||||||
|
|
||||||
/* Update the menu descriptor */
|
/* Update the menu descriptor */
|
||||||
pOleMenuDescriptor->hwndFrame = hwndFrame;
|
pOleMenuDescriptor->hwndFrame = hwndFrame;
|
||||||
pOleMenuDescriptor->hwndActiveObject = hwndActiveObject;
|
pOleMenuDescriptor->hwndActiveObject = hwndActiveObject;
|
||||||
|
|
||||||
GlobalUnlock( hOleMenu );
|
GlobalUnlock( hOleMenu );
|
||||||
pOleMenuDescriptor = NULL;
|
pOleMenuDescriptor = NULL;
|
||||||
|
|
||||||
/* Add a menu descriptor windows property to the frame window */
|
/* Add a menu descriptor windows property to the frame window */
|
||||||
SetPropW( hwndFrame, prop_olemenuW, hOleMenu );
|
SetPropW( hwndFrame, prop_olemenuW, hOleMenu );
|
||||||
|
|
||||||
/* Install thread scope message hooks for WH_GETMESSAGE and WH_CALLWNDPROC */
|
/* Install thread scope message hooks for WH_GETMESSAGE and WH_CALLWNDPROC */
|
||||||
if ( !OLEMenu_InstallHooks( GetCurrentThreadId() ) )
|
if ( !OLEMenu_InstallHooks( GetCurrentThreadId() ) )
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
else /* Want to uninstall dispatching code */
|
else /* Want to uninstall dispatching code */
|
||||||
{
|
{
|
||||||
/* Uninstall the hooks */
|
/* Uninstall the hooks */
|
||||||
if ( !OLEMenu_UnInstallHooks( GetCurrentThreadId() ) )
|
if ( !OLEMenu_UnInstallHooks( GetCurrentThreadId() ) )
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
/* Remove the menu descriptor property from the frame window */
|
/* Remove the menu descriptor property from the frame window */
|
||||||
RemovePropW( hwndFrame, prop_olemenuW );
|
RemovePropW( hwndFrame, prop_olemenuW );
|
||||||
}
|
}
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
@ -629,7 +629,7 @@ static HRESULT WINAPI PointerMonikerCF_CreateInstance(LPCLASSFACTORY iface,
|
|||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
hr = IMoniker_QueryInterface(pMoniker, riid, ppv);
|
hr = IMoniker_QueryInterface(pMoniker, riid, ppv);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
IMoniker_Release(pMoniker);
|
IMoniker_Release(pMoniker);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user