File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Files.App/Services/Windows Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -156,3 +156,4 @@ IApplicationDestinations
156156ApplicationDestinations
157157IApplicationDocumentLists
158158ApplicationDocumentLists
159+ ILFree
Original file line number Diff line number Diff line change @@ -63,11 +63,10 @@ public unsafe void SetDesktopSlideshow(string[] aszPaths)
6363 ( void * * ) pDesktopWallpaper . GetAddressOf ( ) )
6464 . ThrowOnFailure ( ) ;
6565
66- uint dwCount = ( uint ) aszPaths . Length ;
67- ITEMIDLIST * * ppItemIdList = stackalloc ITEMIDLIST * [ dwCount ] ;
66+ ITEMIDLIST * * ppItemIdList = stackalloc ITEMIDLIST * [ aszPaths . Length ] ;
6867
6968 // Get array of PIDL from the selected image files
70- for ( uint dwIndex = 0u ; dwIndex < dwCount ; dwIndex ++ )
69+ for ( uint dwIndex = 0u ; dwIndex < ( uint ) aszPaths . Length ; dwIndex ++ )
7170 ppItemIdList [ dwIndex ] = PInvoke . ILCreateFromPath ( aszPaths [ dwIndex ] ) ;
7271
7372 // Get a shell array of the array of the PIDL
@@ -78,8 +77,8 @@ public unsafe void SetDesktopSlideshow(string[] aszPaths)
7877 hr = pDesktopWallpaper . Get ( ) ->SetSlideshow ( pShellItemArray . Get ( ) ) . ThrowOnFailure ( ) ;
7978
8079 // Free the allocated PIDL
81- for ( uint dwIndex = 0u ; dwIndex < dwCount ; dwIndex ++ )
82- ILFree ( ppItemIdList [ dwIndex ] ) ;
80+ for ( uint dwIndex = 0u ; dwIndex < ( uint ) aszPaths . Length ; dwIndex ++ )
81+ PInvoke . ILFree ( ppItemIdList [ dwIndex ] ) ;
8382
8483 // Set wallpaper position to fill the monitor.
8584 hr = pDesktopWallpaper . Get ( ) ->SetPosition ( DESKTOP_WALLPAPER_POSITION . DWPOS_FILL ) . ThrowOnFailure ( ) ;
You can’t perform that action at this time.
0 commit comments