If an application calls the FindFirstFile API on a directory, and then attempts to remove that directory without first closing ...

If an application calls the FindFirstFile API on a directory, and then attempts to remove that directory without first closing the FindFirstFile handle, the directory will be reported as being in use. The RemoveDirectory API call will return an ERROR_SHARING_VIOLATION error. This compatibility fix will force the FindFirstFile handle closed to ensure the directory is removed. The fix also ensures the FindFirstFile handles are valid before calling the FindNext or FindClose APIs. The FindFirstFile handle will not be forced closed unless the directory is empty. Applies to: Windows 95, Windows 98