| 612 | } |
| 613 | |
| 614 | STDMETHODIMP 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 | |
| 646 | HANDLE CStreamData::GetWriteHandle() const { |
| 647 | return m_writeHandle; |
nothing calls this directly
no outgoing calls
no test coverage detected