#511 Regression in getBufferFromName()

Next_major_release
closed
nobody
None
1
2013-07-31
2013-07-23
No

https://sourceforge.net/p/notepad-plus/bugs/4406/

There was also some discussion about this in the forum.

There is a comment here which supposedly quotes MSDN:

The documentation for GetFileInformationByHandle says: "nFileIndexLow: Low-order part of a unique identifier that is associated with a file. This value is useful ONLY WHILE THE FILE IS OPEN by at least one process. If no processes have it open, the index may change the next time the file is opened."

Now, I can't find this quote in MSDN, but if it's true then the attached patch should fix the problem.

But at another place on MSDN there is a worrying comment:

Depending on the underlying network features of the operating system and the type of server connected to, the GetFileInformationByHandle function may fail, return partial information, or full information for the given file.

So what does GetFileInformationByHandle() return if a user accesses a non-NTFS partition over the network? It's just not very clear. If we sometimes get "partial information" from GetFileInformationByHandle() then getBufferFromName() is broken.

To be frank I think it would be best if getBufferFromName() went back to the way it was before. Opening the same file twice is much less annoying than not being able to open a file at all.

1 Attachments

Discussion

  • Andreas Jonsson

    Andreas Jonsson - 2013-07-24

    Previous patch was wrong, see new patch.

     
  • Don HO

    Don HO - 2013-07-31
    • status: open --> accepted
    • Priority: 5 --> 7
     
  • Don HO

    Don HO - 2013-07-31
    • status: accepted --> closed
    • Priority: 7 --> 1
     
  • Don HO

    Don HO - 2013-07-31

    As agreeed, the fuction in question is reverted. So this patch will not be applied.

    Don