OSDN Git Service

TPI_STATUS_ENDPROCESSを送るよう変更。
authorsirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Tue, 2 Mar 2010 05:06:15 +0000 (05:06 +0000)
committersirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Tue, 2 Mar 2010 05:06:15 +0000 (05:06 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@275 9df91469-1e22-0410-86e7-ea8537beb833

src/plugin/7zArc/7zArc.cpp

index 0e61d53..60c1cb2 100644 (file)
@@ -356,7 +356,7 @@ private:
        int nMode;\r
        bool fTriedPassword;\r
        TPI_PROCESSINFO piInfo;\r
-       wxULongLong_t llCurrentPos;\r
+       wxULongLong_t nCurrentPos;\r
        COutFileStream * _outFileStreamSpec;\r
        CMyComPtr<ISequentialOutStream> _outFileStream;\r
 };\r
@@ -369,7 +369,7 @@ STDMETHODIMP CArchiveExtractCallback::SetTotal(wxULongLong_t)
 STDMETHODIMP CArchiveExtractCallback::SetCompleted(const wxULongLong_t * nProcessed)\r
 {\r
        this->piInfo.eStatus                = TPI_STATUS_INPROCESS;\r
-       this->piInfo.nProcessedSize     = * nProcessed - this->llCurrentPos;\r
+       this->piInfo.nProcessedSize     = * nProcessed - this->nCurrentPos;\r
        if (g_prProc == NULL || this->piInfo.fiInfo.szStoredName.IsEmpty() || g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) == TPI_CALLBACK_CONTINUE)\r
        {\r
                return S_OK;\r
@@ -386,16 +386,23 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(unsigned int nIndex, ISequential
        * outStream = 0;\r
        _outFileStream.Release();\r
 \r
-       // 現在位置を記録。\r
-       this->llCurrentPos += this->piInfo.fiInfo.nUnpackedSize;\r
+       // 前のファイルの処理の終了を通知。\r
+       this->nCurrentPos += this->piInfo.fiInfo.nUnpackedSize;\r
+       this->piInfo.eMessage               = TPI_MESSAGE_STATUS;\r
+       if (this->nCurrentPos != 0)\r
+       {\r
+               this->piInfo.eStatus            = TPI_STATUS_ENDPROCESS;\r
+               if (g_prProc != NULL && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
+               {\r
+                       this->nErrorCode = TPI_ERROR_D_SKIPPED;\r
+                       return E_ABORT;\r
+               }\r
+       }\r
 \r
        // ファイルの基本情報を取得。\r
-       this->piInfo.eMessage               = TPI_MESSAGE_STATUS;\r
        this->piInfo.eStatus                = TPI_STATUS_BEGINPROCESS;\r
        GetFileInformation2(this->hArc, & this->piInfo.fiInfo, nIndex);\r
        this->piInfo.fnDestination          = wxFileName(swInfo->fnDestinationDirectory.GetFullPath() + wxFileName::GetPathSeparator() + (swInfo->fStoreDirectoryPathes ? this->piInfo.fiInfo.fnFileName.GetPath() : (wxString) wxEmptyString), this->piInfo.fiInfo.fnFileName.GetFullName());\r
-\r
-       // コールバック関数に送信。\r
        if (g_prProc != NULL && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
        {\r
                this->nErrorCode = TPI_ERROR_D_SKIPPED;\r
@@ -575,8 +582,18 @@ STDMETHODIMP CArchiveUpdateCallback::GetProperty(unsigned int nIndex, PROPID pro
 \r
 STDMETHODIMP CArchiveUpdateCallback::GetStream(unsigned int nIndex, ISequentialInStream ** inStream)\r
 {\r
-       // 現在位置を記録\r
+       // 前のファイルの処理の終了を通知\r
        this->nCurrentPos += this->piInfo.fiInfo.nUnpackedSize;\r
+       this->piInfo.eMessage               = TPI_MESSAGE_STATUS;\r
+       if (this->nCurrentPos != 0)\r
+       {\r
+               this->piInfo.eStatus            = TPI_STATUS_ENDPROCESS;\r
+               if (g_prProc != NULL && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
+               {\r
+                       this->nErrorCode = TPI_ERROR_D_SKIPPED;\r
+                       return E_ABORT;\r
+               }\r
+       }\r
 \r
        // ファイルの基本情報を取得。\r
        NWindows::NCOM::CPropVariant prop;\r
@@ -599,7 +616,6 @@ STDMETHODIMP CArchiveUpdateCallback::GetStream(unsigned int nIndex, ISequentialI
        this->piInfo.fiInfo.nFileId         = nIndex;\r
        this->piInfo.fiInfo.fnFileName      = wxFileName(this->piInfo.fiInfo.szStoredName);\r
        this->piInfo.fiInfo.fnFileName.Normalize(wxPATH_NORM_DOTS | wxPATH_NORM_ABSOLUTE | wxPATH_NORM_LONG, this->swInfo->fnDestinationDirectory.GetFullPath());\r
-       this->piInfo.eMessage               = TPI_MESSAGE_STATUS;\r
        this->piInfo.eStatus                = TPI_STATUS_BEGINPROCESS;\r
        this->piInfo.fnDestination          = wxFileName(this->piInfo.fiInfo.szStoredName);\r
 \r