dokan-dev / dokany

User mode file system library for windows with FUSE Wrapper
http://dokan-dev.github.io
5.2k stars 661 forks source link

DokanGetMountPointList - Return valid point for empty result #1109

Open Liryna opened 1 year ago

Liryna commented 1 year ago

From https://github.com/dokan-dev/dokan-rust/pull/5#issuecomment-1243029619 , we should have DokanGetMountPointList return a non NULL value for empty result to diff whether the function failed or not.

KoltesDigital commented 1 year ago

I was thinking: if the value is non-null, DokanReleaseMountPointList must be called at some point. Therefore this function must recognize the magic value, and do nothing in this case. I believe this function isn't called so often, so performance overload is okay... but it just feels less classy.

Maybe a good old BOOL DOKANAPI DokanGetMountPointList(BOOL uncOnly, PDOKAN_MOUNT_POINT_INFO *outList, PULONG nbRead); would do the job and keep DokanReleaseMountPointList untouched, but this is kind of a breaking change.