Exemplo n.º 1
0
/**************************************************************************
* IDataObject_fnGetData
*/
HRESULT WINAPI CIDLDataObj::GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
{
    char    szTemp[256];

    szTemp[0] = 0;
    GetClipboardFormatNameA (pformatetcIn->cfFormat, szTemp, 256);
    TRACE("(%p)->(%p %p format=%s)\n", this, pformatetcIn, pmedium, szTemp);

    if (pformatetcIn->cfFormat == cfShellIDList)
    {
      if (cidl < 1) return(E_UNEXPECTED);
      pmedium->hGlobal = RenderSHELLIDLIST(pidl, apidl, cidl);
    }
    else if    (pformatetcIn->cfFormat == CF_HDROP)
    {
      if (cidl < 1) return(E_UNEXPECTED);
      pmedium->hGlobal = RenderHDROP(pidl, apidl, cidl);
    }
    else if    (pformatetcIn->cfFormat == cfFileNameA)
    {
      if (cidl < 1) return(E_UNEXPECTED);
      pmedium->hGlobal = RenderFILENAMEA(pidl, apidl, cidl);
    }
    else if    (pformatetcIn->cfFormat == cfFileNameW)
    {
      if (cidl < 1) return(E_UNEXPECTED);
      pmedium->hGlobal = RenderFILENAMEW(pidl, apidl, cidl);
    }
    else if    (pformatetcIn->cfFormat == cfPreferredDropEffect)
    {
      pmedium->hGlobal = RenderPREFEREDDROPEFFECT(dropeffect);
    }
    else
    {
      FIXME("-- expected clipformat not implemented\n");
      return (E_INVALIDARG);
    }
    if (pmedium->hGlobal)
    {
      pmedium->tymed = TYMED_HGLOBAL;
      pmedium->pUnkForRelease = NULL;
      return S_OK;
    }
    return E_OUTOFMEMORY;
}
Exemplo n.º 2
0
/**************************************************************************
* IDataObject_fnGetData
*/
static HRESULT WINAPI IDataObject_fnGetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
{
	IDataObjectImpl *This = (IDataObjectImpl *)iface;

	char	szTemp[256];

	szTemp[0]=0;
	GetClipboardFormatNameA (pformatetcIn->cfFormat, szTemp, 256);
	TRACE("(%p)->(%p %p format=%s)\n", This, pformatetcIn, pmedium, szTemp);

	if (pformatetcIn->cfFormat == This->cfShellIDList)
	{
	  if (This->cidl < 1) return(E_UNEXPECTED);
	  pmedium->u.hGlobal = RenderSHELLIDLIST(This->pidl, This->apidl, This->cidl);
	}
	else if	(pformatetcIn->cfFormat == CF_HDROP)
	{
	  if (This->cidl < 1) return(E_UNEXPECTED);
	  pmedium->u.hGlobal = RenderHDROP(This->pidl, This->apidl, This->cidl);
	}
	else if	(pformatetcIn->cfFormat == This->cfFileNameA)
	{
	  if (This->cidl < 1) return(E_UNEXPECTED);
	  pmedium->u.hGlobal = RenderFILENAMEA(This->pidl, This->apidl, This->cidl);
	}
	else if	(pformatetcIn->cfFormat == This->cfFileNameW)
	{
	  if (This->cidl < 1) return(E_UNEXPECTED);
	  pmedium->u.hGlobal = RenderFILENAMEW(This->pidl, This->apidl, This->cidl);
	}
	else
	{
	  FIXME("-- expected clipformat not implemented\n");
	  return (E_INVALIDARG);
	}
	if (pmedium->u.hGlobal)
	{
	  pmedium->tymed = TYMED_HGLOBAL;
	  pmedium->pUnkForRelease = NULL;
	  return S_OK;
	}
	return E_OUTOFMEMORY;
}