@@ -1106,10 +1106,9 @@ private static bool IsWindowsApplication(string fileName)
11061106 return false ;
11071107 }
11081108
1109- SHFILEINFO shinfo = new SHFILEINFO ( ) ;
1110- IntPtr type = SHGetFileInfo ( fileName , 0 , ref shinfo , ( uint ) Marshal . SizeOf ( shinfo ) , SHGFI_EXETYPE ) ;
1109+ int type = Interop . Windows . SHGetFileInfo ( fileName ) ;
11111110
1112- switch ( ( int ) type )
1111+ switch ( type )
11131112 {
11141113 case 0x0 :
11151114 // 0x0 = not an exe
@@ -1640,38 +1639,6 @@ private static string FindExecutable(string filename)
16401639
16411640 #endregion
16421641
1643- #region Interop for SHGetFileInfo
1644-
1645- private const int SCS_32BIT_BINARY = 0 ; // A 32-bit Windows-based application
1646- private const int SCS_DOS_BINARY = 1 ; // An MS-DOS - based application
1647- private const int SCS_WOW_BINARY = 2 ; // A 16-bit Windows-based application
1648- private const int SCS_PIF_BINARY = 3 ; // A PIF file that executes an MS-DOS - based application
1649- private const int SCS_POSIX_BINARY = 4 ; // A POSIX - based application
1650- private const int SCS_OS216_BINARY = 5 ; // A 16-bit OS/2-based application
1651- private const int SCS_64BIT_BINARY = 6 ; // A 64-bit Windows-based application.
1652-
1653- [ StructLayout ( LayoutKind . Sequential , CharSet = CharSet . Unicode ) ]
1654- private struct SHFILEINFO
1655- {
1656- public IntPtr hIcon ;
1657- public int iIcon ;
1658- public uint dwAttributes ;
1659-
1660- [ MarshalAs ( UnmanagedType . ByValTStr , SizeConst = 260 ) ]
1661- public string szDisplayName ;
1662-
1663- [ MarshalAs ( UnmanagedType . ByValTStr , SizeConst = 80 ) ]
1664- public string szTypeName ;
1665- }
1666-
1667- private const uint SHGFI_EXETYPE = 0x000002000 ; // flag used to ask to return exe type
1668-
1669- [ DllImport ( "shell32.dll" , CharSet = CharSet . Unicode ) ]
1670- private static extern IntPtr SHGetFileInfo ( string pszPath , uint dwFileAttributes ,
1671- ref SHFILEINFO psfi , uint cbSizeFileInfo , uint uFlags ) ;
1672-
1673- #endregion
1674-
16751642 #region Minishell Interop
16761643
16771644 private bool _isMiniShell = false ;
0 commit comments