Skip to content

Commit

Permalink
Add a last call of EnumerateNamedStreams with empty name to let the u…
Browse files Browse the repository at this point in the history
  • Loading branch information
Liryna committed Oct 18, 2015
1 parent 930943b commit c39e712
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dokan/dokan.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ typedef struct _DOKAN_OPERATIONS {


// CreateFile
// In case OPEN_ALWAYS & CREATE_ALWAYS are opening successfully a already existing file,
// you have to return STATUS_OBJECT_NAME_COLLISION.
// If file is a directory, CreateFile (not OpenDirectory) may be called.
// In this case, CreateFile should return STATUS_SUCCESS when that directory can be opened.
// You should set TRUE on DokanFileInfo->IsDirectory when file is a directory.
Expand Down
11 changes: 10 additions & 1 deletion dokan/fileinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,16 @@ DokanEnumerateNamedStreams(
}

if (entrySize == 0)
return result; //EnumerateNamedStreams have directly failed
return result; //EnumerateNamedStreams has directly failed

//Empty call to let user clean the allocated memory
DokanInstance->DokanOperations->EnumerateNamedStreams(
NULL,
&enumContext,
NULL,
NULL,
FileInfo);

return STATUS_SUCCESS;
}

Expand Down
6 changes: 6 additions & 0 deletions dokan_mirror/mirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,12 @@ MirrorEnumerateNamedStreams(
HANDLE handle;
WCHAR filePath[MAX_PATH];

if (FileName == NULL) { //Dokan ask to free the previous allocated memory
DbgPrint(L"EnumerateNamedStreams Free allocated memory\n");
EnumContext = NULL;
return STATUS_SUCCESS;
}

GetFilePath(filePath, MAX_PATH, FileName);

DbgPrint(L"EnumerateNamedStreams %s\n", filePath);
Expand Down
2 changes: 1 addition & 1 deletion dokan_mount/mounter.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ FindMountEntry(PDOKAN_CONTROL DokanControl)
return NULL;
}

/* NOTE: g_MountList expects MountPoint to have the format of C:\ */
/* NOTE: g_MountList expects MountPoint to has the format of C:\ */

This comment has been minimized.

Copy link
@justanotheranonymoususer

justanotheranonymoususer Oct 19, 2015

Contributor

This is an incorrect fix, as far as I can tell.

This comment has been minimized.

Copy link
@Liryna

Liryna Oct 19, 2015

Author Member

😭 I will revert it next commit


if(useMountPoint && IsMountPointDriveLetter(DokanControl->MountPoint)) {

Expand Down

0 comments on commit c39e712

Please sign in to comment.