File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/Files.App/Services/Windows Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,11 @@ public unsafe void SetDesktopSlideshow(string[] aszPaths)
6363 ( void * * ) pDesktopWallpaper . GetAddressOf ( ) )
6464 . ThrowOnFailure ( ) ;
6565
66+ uint dwCount = ( uint ) aszPaths . Length ;
6667 ITEMIDLIST * * ppItemIdList = stackalloc ITEMIDLIST * [ aszPaths . Length ] ;
6768
6869 // Get array of PIDL from the selected image files
69- for ( uint dwIndex = 0u ; dwIndex < ( uint ) aszPaths . Length ; dwIndex ++ )
70+ for ( uint dwIndex = 0u ; dwIndex < dwCount ; dwIndex ++ )
7071 ppItemIdList [ dwIndex ] = PInvoke . ILCreateFromPath ( aszPaths [ dwIndex ] ) ;
7172
7273 // Get a shell array of the array of the PIDL
@@ -77,7 +78,7 @@ public unsafe void SetDesktopSlideshow(string[] aszPaths)
7778 hr = pDesktopWallpaper . Get ( ) ->SetSlideshow ( pShellItemArray . Get ( ) ) . ThrowOnFailure ( ) ;
7879
7980 // Free the allocated PIDL
80- for ( uint dwIndex = 0u ; dwIndex < ( uint ) aszPaths . Length ; dwIndex ++ )
81+ for ( uint dwIndex = 0u ; dwIndex < dwCount ; dwIndex ++ )
8182 PInvoke . ILFree ( ppItemIdList [ dwIndex ] ) ;
8283
8384 // Set wallpaper position to fill the monitor.
You can’t perform that action at this time.
0 commit comments