| 130 | } |
| 131 | |
| 132 | HRESULT __stdcall DataObject::GetData(FORMATETC *pFormatEtc,STGMEDIUM *pMedium) |
| 133 | { |
| 134 | if(pFormatEtc == NULL || pMedium == NULL) |
| 135 | { |
| 136 | return E_INVALIDARG; |
| 137 | } |
| 138 | |
| 139 | if(QueryGetData(pFormatEtc) == DV_E_FORMATETC) |
| 140 | { |
| 141 | return DV_E_FORMATETC; |
| 142 | } |
| 143 | |
| 144 | for(const auto &dao : m_daoList) |
| 145 | { |
| 146 | if(dao.fe.cfFormat == pFormatEtc->cfFormat && |
| 147 | dao.fe.tymed & pFormatEtc->tymed && |
| 148 | dao.fe.dwAspect == pFormatEtc->dwAspect) |
| 149 | { |
| 150 | BOOL bRet = DuplicateStorageMedium(pMedium,&dao.stg,&dao.fe); |
| 151 | |
| 152 | if(!bRet) |
| 153 | { |
| 154 | return STG_E_MEDIUMFULL; |
| 155 | } |
| 156 | |
| 157 | return S_OK; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | return DV_E_FORMATETC; |
| 162 | } |
| 163 | |
| 164 | BOOL DataObject::DuplicateStorageMedium(STGMEDIUM *pstgDest, const STGMEDIUM *pstgSrc, const FORMATETC *pftc) |
| 165 | { |
no outgoing calls