const void *c4_CustomHandler::Get(int index_, int &length_) { c4_Bytes &buf = _seq->Buffer(); int colnum = _seq->PropIndex(Property().GetId()); d4_assert(colnum >= 0); if (!_seq->DoGet(index_, colnum, buf)) ClearBytes(buf); length_ = buf.Size(); return buf.Contents(); }
/*---------------------------------------------------------------------------------------------- Retrieve the STATSTG structure for this stream. Note that we will always use integer ids for the Resource. It is not thought worthwhile to convert this to a name string here. Hence the returned name is always NULL even if the name is requested. ----------------------------------------------------------------------------------------------*/ STDMETHODIMP ResourceStream::Stat(STATSTG * pstatstg, DWORD grfStatFlag) { BEGIN_COM_METHOD; ChkComArgPtr(pstatstg); // Clear the whole structure initially ClearBytes(pstatstg, isizeof(STATSTG)); switch (grfStatFlag) { case STATFLAG_DEFAULT: // resource will always be identified by an integer id. case STATFLAG_NONAME: pstatstg->type = STGTY_STREAM; pstatstg->cbSize.LowPart = m_cbData; return S_OK; default: ThrowHr(WarnHr(STG_E_INVALIDFLAG)); } END_COM_METHOD(g_fact, IID_IStream); }