{"action":"created","issue":{"url":"https://api.github.com/repos/dokan-dev/dokan-dotnet/issues/12","labels_url":"https://api.github.com/repos/dokan-dev/dokan-dotnet/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/dokan-dev/dokan-dotnet/issues/12/comments","events_url":"https://api.github.com/repos/dokan-dev/dokan-dotnet/issues/12/events","html_url":"https://github.com/dokan-dev/dokan-dotnet/issues/12","id":103669712,"number":12,"title":"IDokanOperations.OpenDirectory() with a blank filename (string.Empty)","user":{"login":"Liryna","id":4311419,"avatar_url":"https://avatars.githubusercontent.com/u/4311419?v=3","gravatar_id":"","url":"https://api.github.com/users/Liryna","html_url":"https://github.com/Liryna","followers_url":"https://api.github.com/users/Liryna/followers","following_url":"https://api.github.com/users/Liryna/following{/other_user}","gists_url":"https://api.github.com/users/Liryna/gists{/gist_id}","starred_url":"https://api.github.com/users/Liryna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Liryna/subscriptions","organizations_url":"https://api.github.com/users/Liryna/orgs","repos_url":"https://api.github.com/users/Liryna/repos","events_url":"https://api.github.com/users/Liryna/events{/privacy}","received_events_url":"https://api.github.com/users/Liryna/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-28T08:25:31Z","updated_at":"2015-08-28T12:43:45Z","closed_at":null,"body":"From @viciousviper\r\n\r\nDuring FileInfo.MoveTo(), DirectoryInfo.MoveTo(), and FileInfo.Replace() there is an irritating call to IDokanOperations.OpenDirectory() with a blank filename (string.Empty) and no associated cleanup calls.\r\n\r\nTest Sample C#\r\n```\r\nFileInfo test = new FileInfo(\"M:\\\\test.txt\");\r\ntest.MoveTo(\"M:\\\\test2.txt\");\r\n```\r\n\r\nMirror.c\r\n```\r\n###Create 0070\r\n   CreateDisposition 0x00000001\r\nCreateFile : C:\\Users\\test.txt\r\n  AccountName: liryna, DomainName: DESKTOP-RBPTIQA\r\n        OPEN_EXISTING\r\n        ShareMode = 0x7\r\n        FILE_SHARE_READ\r\n        FILE_SHARE_WRITE\r\n        FILE_SHARE_DELETE\r\n        AccessMode = 0x110080\r\n        DELETE\r\n        FILE_READ_ATTRIBUTES\r\n        SYNCHRONIZE\r\n        FlagsAndAttributes = 0x0\r\n\r\nCreateFile status = 0\r\n###GetFileInfo 0070\r\nGetFileInfo : C:\\Users\\test.txt\r\n        GetFileInformationByHandle success, file size = 3\r\n\r\n###GetFileInfo 0070\r\nGetFileInfo : C:\\Users\\test.txt\r\n        GetFileInformationByHandle success, file size = 3\r\n\r\nSL_OPEN_TARGET_DIRECTORY specified\r\n###Create 0071\r\nOpenDirectory : C:\\Users\r\n\r\nCreateFile status = 0\r\n###SetFileInfo 0070  10\r\nMoveFile C:\\Users\\test.txt -> C:\\Users\\test2.txt\r\n\r\n###Cleanup 0071\r\nCleanup: C:\\Users\\test2.txt\r\n\r\n###Close 0071\r\nClose: C:\\Users\\test2.txt\r\n\r\n###Cleanup 0070\r\nCleanup: C:\\Users\\test2.txt\r\n        invalid handle\r\n\r\n###Close 0070\r\nClose: C:\\Users\\test2.txt\r\n```\r\n\r\nWith the C mirror there is no OpenDirectory() with a blank filename (string.Empty).\r\n\r\n**EDIT:** OpenDirectoryProxy is called with (string.Empty) so there should be a issue in C->C#"},"comment":{"url":"https://api.github.com/repos/dokan-dev/dokan-dotnet/issues/comments/135765576","html_url":"https://github.com/dokan-dev/dokan-dotnet/issues/12#issuecomment-135765576","issue_url":"https://api.github.com/repos/dokan-dev/dokan-dotnet/issues/12","id":135765576,"user":{"login":"Liryna","id":4311419,"avatar_url":"https://avatars.githubusercontent.com/u/4311419?v=3","gravatar_id":"","url":"https://api.github.com/users/Liryna","html_url":"https://github.com/Liryna","followers_url":"https://api.github.com/users/Liryna/followers","following_url":"https://api.github.com/users/Liryna/following{/other_user}","gists_url":"https://api.github.com/users/Liryna/gists{/gist_id}","starred_url":"https://api.github.com/users/Liryna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Liryna/subscriptions","organizations_url":"https://api.github.com/users/Liryna/orgs","repos_url":"https://api.github.com/users/Liryna/repos","events_url":"https://api.github.com/users/Liryna/events{/privacy}","received_events_url":"https://api.github.com/users/Liryna/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T12:43:45Z","updated_at":"2015-08-28T12:43:45Z","body":"I added to DokanNet https://github.com/dokan-dev/dokan-dotnet/commit/a2a53c5f6619b5510685bbe94c57b71065673cb6. Like that I could compare and see what is happening during a `.MoveTo(\"M:\\\\liryna\\Desktop\\test2.txt\");`\r\n\r\n```\r\nCreateFileProxy :  \\liryna\\Desktop\\test.txt\r\n        CreationDisposition Open\r\n        FileShare ReadWrite, Delete\r\n        FileAccess ReadAttributes, Delete, Synchronize\r\n        FileOptions None\r\n        FileAttributes 0\r\nCreateFileProxy : \\liryna\\Desktop\\test.txt Return :  Success\r\n\r\nGetFileInformationProxy :  \\liryna\\Desktop\\test.txt\r\n        FileName :  \\liryna\\Desktop\\test.txt\r\n        Attributes :  Archive\r\n        CreationTime :  8/28/2015 1:11:05 AM\r\n        LastAccessTime :  8/28/2015 1:11:05 AM\r\n        LastWriteTime :  8/28/2015 1:11:13 AM\r\n        Length :  3\r\nGetFileInformationProxy : \\liryna\\Desktop\\test.txt Return :  Success\r\n\r\nGetFileInformationProxy :  \\liryna\\Desktop\\test.txt\r\n        FileName :  \\liryna\\Desktop\\test.txt\r\n        Attributes :  Archive\r\n        CreationTime :  8/28/2015 1:11:05 AM\r\n        LastAccessTime :  8/28/2015 1:11:05 AM\r\n        LastWriteTime :  8/28/2015 1:11:13 AM\r\n        Length :  3\r\nGetFileInformationProxy : \\liryna\\Desktop\\test.txt Return :  Success\r\n\r\nOpenDirectoryProxy :  \\liryna\\Desktop\r\nOpenDirectoryProxy : \\liryna\\Desktop Return :  Success\r\n\r\nMoveFileProxy :  \\liryna\\Desktop\\test.txt\r\n        NewFileName :  \\liryna\\Desktop\\test2.txt\r\n        ReplaceIfExisting :  False\r\nMoveFileProxy : \\liryna\\Desktop\\test.txt Return :  Success\r\n\r\nCleanupProxy :  \\liryna\\Desktop\\test2.txt\r\nCleanupProxy : \\liryna\\Desktop\\test2.txt Return :  Success\r\n\r\nCloseFileProxy :  \\liryna\\Desktop\\test2.txt\r\n\r\nCleanupProxy :  \\liryna\\Desktop\\test2.txt\r\nCleanupProxy : \\liryna\\Desktop\\test2.txt Return :  Success\r\nCloseFileProxy : \\liryna\\Desktop\\test2.txt Return :  Success\r\n\r\nCloseFileProxy :  \\liryna\\Desktop\\test2.txt\r\nCloseFileProxy : \\liryna\\Desktop\\test2.txt Return :  Success\r\n```\r\n\r\nThere is no empty string :cry: .\r\nThere should be another reason why string.empty happen."}}