hunk ./System/Win32/Types.hs 26 +import Numeric (showHex) hunk ./System/Win32/Types.hs 208 - msg <- peekTString c_msg - -- We ignore failure of freeing c_msg, given we're already failing - _ <- localFree c_msg + msg <- if c_msg == nullPtr + then return $ "Error 0x" ++ Numeric.showHex err_code "" + else do msg <- peekTString c_msg + -- We ignore failure of freeing c_msg, given we're already failing + _ <- localFree c_msg + return msg hunk ./System/Win32/Types.hs 223 + hunk ./System/Win32/FileMapping.hsc 23 -import Control.Exception ( block, bracket ) +import Control.Exception ( mask_, bracket ) hunk ./System/Win32/FileMapping.hsc 47 - fp <- block $ do + fp <- mask_ $ do hunk ./System/Win32/SimpleMAPI.hsc 143 - loadProc name dll conv = withCString name $ \name' -> do + loadProc :: String -> HMODULE -> (FunPtr a -> a) -> IO a + loadProc name dll conv = withCString name $ \name' -> do