MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / Stat

Method Stat

src/DragDropSupport.cpp:614–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614STDMETHODIMP CStreamData::Stat(STATSTG * pStatstg, DWORD grfStatFlag) {
615 //Doesnt seem to get called by explorer
616 if (!pStatstg)
617 return STG_E_INVALIDPOINTER;
618
619 if (!(grfStatFlag & STATFLAG_NONAME)) { //allocate memory for name
620#ifdef UNICODE
621 int len = lstrlen(m_filedesc.cFileName)+1;
622 pStatstg->pwcsName = (LPOLESTR)CoTaskMemAlloc(len*sizeof(WCHAR));
623 lstrcpyn(pStatstg->pwcsName, m_filedesc.cFileName, len);
624#else
625 WCHAR * unistring = SU::CharToWChar(m_filedesc.cFileName);
626 int len = lstrlenW(unistring)+1;
627 pStatstg->pwcsName = (LPOLESTR)CoTaskMemAlloc(len*sizeof(WCHAR));
628 lstrcpynW(pStatstg->pwcsName, unistring, len);
629 SU::FreeWChar(unistring);
630#endif
631 }
632
633 pStatstg->type = STGTY_STREAM;
634 pStatstg->cbSize.LowPart = m_filedesc.nFileSizeLow;
635 pStatstg->cbSize.HighPart = m_filedesc.nFileSizeHigh;
636 pStatstg->mtime = m_filedesc.ftLastWriteTime;
637 pStatstg->ctime = m_filedesc.ftCreationTime;
638 pStatstg->atime = m_filedesc.ftLastAccessTime;
639 pStatstg->grfMode = STGM_READ;
640 pStatstg->grfLocksSupported = 0;
641 //pStatstg->clsid = ;
642 //pStatstg->grfStateBits = ;
643 return S_OK;
644}
645
646HANDLE CStreamData::GetWriteHandle() const {
647 return m_writeHandle;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected