Skip to content

Commit

Permalink
check fileObject before calling CcFlushCache
Browse files Browse the repository at this point in the history
git-svn-id: http://dokan.googlecode.com/svn/trunk@116 53ea604a-054e-0410-8546-456bafaea6b0
  • Loading branch information
asakaw committed Mar 22, 2010
1 parent 9330a4e commit 58b8a40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions sys/cleanup.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ Return Value:
__leave;
}

CcFlushCache(&fcb->SectionObjectPointers, NULL, 0, NULL);
CcPurgeCacheSection(&fcb->SectionObjectPointers, NULL, 0, FALSE);
CcUninitializeCacheMap(fileObject, NULL, NULL);
if (fileObject->SectionObjectPointer != NULL &&
fileObject->SectionObjectPointer->DataSectionObject != NULL) {
CcFlushCache(&fcb->SectionObjectPointers, NULL, 0, NULL);
CcPurgeCacheSection(&fcb->SectionObjectPointers, NULL, 0, FALSE);
CcUninitializeCacheMap(fileObject, NULL, NULL);
}
fileObject->Flags |= FO_CLEANUP_COMPLETE;

eventContext->Context = ccb->UserContext;
Expand Down
2 changes: 1 addition & 1 deletion sys/public.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.

#include "devioctl.h"

#define DOKAN_VERSION 0x0000185
#define DOKAN_VERSION 0x0000186

#define EVENT_CONTEXT_MAX_SIZE (1024*32)

Expand Down

0 comments on commit 58b8a40

Please sign in to comment.