BOOL CALLBACK GetnsISupportsProxyForUIThread(nsISupports *pMyThreadElement, nsISupports **ppUIThreadElement
, const nsIID &iid)
{
BOOL bRetValue = FALSE;
do
{
if(pMyThreadElement == NULL || ppUIThreadElement == NULL)
break;
nsCOMPtr<nsIServiceManager> Manager;
FF_CHECK_Result(NS_GetServiceManager(getter_AddRefs(Manager)));
FF_CHECK_COMPTR(Manager);
nsCOMPtr<nsIProxyObjectManager> pIProxyObjectManager;
FF_CHECK_Result(Manager->GetServiceByContractID("@mozilla.org/xpcomproxy;1", NS_GET_IID(nsIProxyObjectManager)
, getter_AddRefs(pIProxyObjectManager)));
FF_CHECK_Result(pIProxyObjectManager->GetProxyForObject((PROXY_PARAM1*)1, iid,
pMyThreadElement,NS_PROXY_SYNC | NS_PROXY_ALWAYS, (void**)ppUIThreadElement));
bRetValue = (*ppUIThreadElement != NULL);
} while(0);
return bRetValue;
}