Full temporary folder will crash cursor initialization #696
The cursor will crash at initialization when the temporary folder full.
I set a cursor from a resource and use this code.
I can find the cursor will crash at initialization when the temporary folder full.
The cursor can be set.
Run this code when the temporary folder full.
And the other way is set a can not visit folder as the temp folder. And you can see the code in https://github.com/lindexi/lindexi_gd/tree/8e346e750fe2075e1366a2a098d63af3b50db177/FawlalnejajerelaWhallgemcurkear that I set a folder name as
The Cursor.LegacyLoadFromStream will generate a temporary file based on the memory stream. But the Path.GetTempFileName Method limit the number of the files is 65535 and it will throw IOException when overcount.
The LegacyLoadFromStream code in https://referencesource.microsoft.com/#PresentationCore/Core/CSharp/System/Windows/Input/Cursor.cs,935d59bd1efe76e4,references
Actual LoadFromStream may ignore LegacyLoadFromStream. But FileHelper.CreateAndOpenTemporaryFile will generate the file in WPF folder by default and use Path.GetRandomFileName to create a file without check access. And it also crashes when the temp folder can not write.