packages feed

Win32 2.13.1.0 → 2.13.2.0

raw patch · 4 files changed

+31/−6 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Graphics.Win32.Icon: c_CreateIcon :: HINSTANCE -> Int -> Int -> BYTE -> BYTE -> Ptr BYTE -> Ptr BYTE -> IO HICON
+ Graphics.Win32.Icon: createIcon :: HINSTANCE -> Int -> Int -> BYTE -> BYTE -> Ptr BYTE -> Ptr BYTE -> IO HICON
+ Graphics.Win32.Message: iCON_BIG :: WPARAM
+ Graphics.Win32.Message: iCON_SMALL :: WPARAM
+ Graphics.Win32.Message: wM_SETICON :: WindowMessage
+ System.Win32.Console: CONSOLE_SCREEN_BUFFER_INFOEX :: COORD -> COORD -> WORD -> SMALL_RECT -> COORD -> WORD -> BOOL -> [COLORREF] -> CONSOLE_SCREEN_BUFFER_INFOEX
+ System.Win32.Console: [bFullscreenSupported] :: CONSOLE_SCREEN_BUFFER_INFOEX -> BOOL
+ System.Win32.Console: [colorTable] :: CONSOLE_SCREEN_BUFFER_INFOEX -> [COLORREF]
+ System.Win32.Console: [dwCursorPositionEx] :: CONSOLE_SCREEN_BUFFER_INFOEX -> COORD
+ System.Win32.Console: [dwMaximumWindowSizeEx] :: CONSOLE_SCREEN_BUFFER_INFOEX -> COORD
+ System.Win32.Console: [dwSizeEx] :: CONSOLE_SCREEN_BUFFER_INFOEX -> COORD
+ System.Win32.Console: [srWindowEx] :: CONSOLE_SCREEN_BUFFER_INFOEX -> SMALL_RECT
+ System.Win32.Console: [wAttributesEx] :: CONSOLE_SCREEN_BUFFER_INFOEX -> WORD
+ System.Win32.Console: [wPopupAttributes] :: CONSOLE_SCREEN_BUFFER_INFOEX -> WORD
+ System.Win32.Console: data CONSOLE_SCREEN_BUFFER_INFOEX
+ System.Win32.Console: getConsoleScreenBufferInfoEx :: HANDLE -> IO CONSOLE_SCREEN_BUFFER_INFOEX
+ System.Win32.Console: getCurrentConsoleScreenBufferInfoEx :: IO CONSOLE_SCREEN_BUFFER_INFOEX
+ System.Win32.Console: instance Foreign.Storable.Storable System.Win32.Console.CONSOLE_SCREEN_BUFFER_INFOEX
+ System.Win32.Console: instance GHC.Classes.Eq System.Win32.Console.CONSOLE_SCREEN_BUFFER_INFOEX
+ System.Win32.Console: instance GHC.Show.Show System.Win32.Console.CONSOLE_SCREEN_BUFFER_INFOEX
+ System.Win32.Console: type COLORREF = Word32
+ System.Win32.Types: iNVALID_SET_FILE_POINTER :: DWORD

Files

System/Win32/Info/Computer.hsc view
@@ -94,7 +94,7 @@       len' <- peek len
       peekTStringLen (buf, (fromIntegral len'))
   where
-    maxLength = #const MAX_COMPUTERNAME_LENGTH
+    maxLength = #const MAX_PATH
 
 foreign import WINDOWS_CCONV unsafe "GetComputerNameW"
   c_GetComputerName :: LPTSTR -> LPDWORD -> IO Bool
System/Win32/Types.hsc view
@@ -57,10 +57,11 @@ #endif  ##if defined(__IO_MANAGER_WINIO__)+import GHC.IO.Exception (ioException, IOException(..), IOErrorType(InappropriateType)) import GHC.IO.SubSystem ((<!>)) import GHC.IO.Handle.Windows-import GHC.IO.Windows.Handle (fromHANDLE, Io(), NativeHandle(),-                              handleToMode, optimizeFileAccess)+import GHC.IO.Windows.Handle (fromHANDLE, Io(), NativeHandle(), ConsoleHandle(),+                              toHANDLE, handleToMode, optimizeFileAccess) import qualified GHC.Event.Windows as Mgr import GHC.IO.Device (IODeviceType(..)) ##endif@@ -290,9 +291,28 @@     -- getting to it while we are doing horrible manipulations with it, and hence     -- stops it being finalized (and closed).     withStablePtr haskell_handle $ const $ do-        windows_handle <- handleToHANDLE haskell_handle+        -- Grab the write handle variable from the Handle+        let write_handle_mvar = case haskell_handle of+                FileHandle _ handle_mvar     -> handle_mvar+                DuplexHandle _ _ handle_mvar -> handle_mvar++        -- This is "write" MVar, we could also take the "read" one+        windows_handle <- readMVar write_handle_mvar >>= handle_ToHANDLE+         -- Do what the user originally wanted         action windows_handle+  where+    -- | Turn an existing Handle into a Win32 HANDLE. This function throws an+    -- IOError if the Handle does not reference a HANDLE+    handle_ToHANDLE :: Handle__ -> IO HANDLE+    handle_ToHANDLE (Handle__{haDevice = dev}) =+        case (cast dev :: Maybe (Io NativeHandle), cast dev :: Maybe (Io ConsoleHandle)) of+          (Just hwnd, Nothing) -> return $ toHANDLE hwnd+          (Nothing, Just hwnd) -> return $ toHANDLE hwnd+          _                    -> throwErr "not a known HANDLE"++    throwErr msg = ioException $ IOError (Just haskell_handle)+      InappropriateType "withHandleToHANDLENative" msg Nothing Nothing ##endif  withHandleToHANDLEPosix :: Handle -> (HANDLE -> IO a) -> IO a
Win32.cabal view
@@ -1,5 +1,5 @@ name:           Win32-version:        2.13.1.0+version:        2.13.2.0 license:        BSD3 license-file:   LICENSE author:         Alastair Reid, shelarcy, Tamar Christina@@ -11,7 +11,7 @@ synopsis:       A binding to Windows Win32 API. description:    This library contains direct bindings to the Windows Win32 APIs for Haskell. build-type:     Simple-cabal-version:  >= 2.0+cabal-version:  2.0 extra-source-files:     include/diatemp.h include/dumpBMP.h include/ellipse.h include/errors.h     include/Win32Aux.h include/win32debug.h include/alignment.h
changelog.md view
@@ -1,5 +1,10 @@ # Changelog for [`Win32` package](http://hackage.haskell.org/package/Win32) +## New - Unreleased++* Set maximum string size for getComputerName. (See #190)+* Update withHandleToHANDLENative to handle duplex and console handles (See #191)+ ## 2.13.1.0 November 2021  * Fix a bug in which `System.Win32.MinTTY.isMinTTY` would incorrectly return