Win32 2.3.0.2 → 2.3.1.0
raw patch · 33 files changed
+170/−38 lines, 33 filessetup-changednew-uploader
Files
- Graphics/Win32.hs +3/−1
- Graphics/Win32/Dialogue.hsc +3/−1
- Graphics/Win32/GDI/Bitmap.hsc +3/−1
- Graphics/Win32/GDI/Brush.hsc +3/−1
- Graphics/Win32/GDI/Clip.hsc +3/−1
- Graphics/Win32/GDI/Font.hsc +3/−1
- Graphics/Win32/GDI/Graphics2D.hs +3/−1
- Graphics/Win32/GDI/HDC.hs +3/−1
- Graphics/Win32/GDI/Palette.hsc +3/−1
- Graphics/Win32/GDI/Path.hs +3/−1
- Graphics/Win32/GDI/Pen.hsc +3/−1
- Graphics/Win32/GDI/Region.hs +3/−1
- Graphics/Win32/Icon.hs +3/−1
- Graphics/Win32/Key.hsc +3/−1
- Graphics/Win32/Menu.hsc +3/−1
- Graphics/Win32/Message.hsc +3/−1
- Graphics/Win32/Misc.hsc +3/−1
- Graphics/Win32/Resource.hsc +3/−1
- Graphics/Win32/Window.hsc +18/−1
- Setup.hs +1/−1
- System/Win32.hs +3/−1
- System/Win32/Console.hsc +3/−1
- System/Win32/DLL.hsc +3/−1
- System/Win32/DebugApi.hsc +3/−1
- System/Win32/File.hsc +3/−1
- System/Win32/Info.hsc +3/−1
- System/Win32/Mem.hsc +49/−2
- System/Win32/Process.hsc +3/−1
- System/Win32/Shell.hsc +7/−1
- System/Win32/SimpleMAPI.hsc +11/−5
- System/Win32/Time.hsc +3/−1
- System/Win32/Types.hs +5/−1
- Win32.cabal +1/−1
Graphics/Win32.hs view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/Dialogue.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/GDI/Bitmap.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/GDI/Brush.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/GDI/Clip.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/GDI/Font.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/GDI/Graphics2D.hs view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/GDI/HDC.hs view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/GDI/Palette.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/GDI/Path.hs view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/GDI/Pen.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/GDI/Region.hs view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/Icon.hs view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/Key.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/Menu.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/Message.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/Misc.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/Resource.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
Graphics/Win32/Window.hsc view
@@ -204,7 +204,24 @@ _ <- c_SetWindowLongPtr wnd (#{const GWLP_USERDATA}) (castPtr (castFunPtrToPtr fp)) return ()-foreign import capi unsafe "windows.h SetWindowLongPtrW"++{- Note [SetWindowLongPtrW]+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~++Windows.h defines SetWindowLongPtrW as SetWindowLongW for 32-bit platforms+(i386_HOST_ARCH for our mingw32 environment). Unfortunately since the foreign+import name is given inside of a string, the macro will not be expanded.++Until a better solution is presented each version is provided explicitly here.++-}+#if defined(i386_HOST_ARCH)+foreign import WINDOWS_CCONV unsafe "windows.h SetWindowLongW"+#elif defined(x86_64_HOST_ARCH)+foreign import WINDOWS_CCONV unsafe "windows.h SetWindowLongPtrW"+#else+# error Unknown mingw32 arch+#endif c_SetWindowLongPtr :: HWND -> INT -> Ptr LONG -> IO (Ptr LONG) createWindow
Setup.hs view
@@ -3,4 +3,4 @@ import Distribution.Simple main :: IO ()-main = defaultMainWithHooks defaultUserHooks+main = defaultMainWithHooks autoconfUserHooks
System/Win32.hs view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
System/Win32/Console.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701 +#if __GLASGOW_HASKELL__ >= 709 +{-# LANGUAGE Safe #-} +#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
System/Win32/DLL.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
System/Win32/DebugApi.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
System/Win32/File.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
System/Win32/Info.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
System/Win32/Mem.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------@@ -26,6 +28,47 @@ #include <windows.h> +----------------------------------------------------------------+-- Data types+----------------------------------------------------------------++data MEMORY_BASIC_INFORMATION = MEMORY_BASIC_INFORMATION+ { mbiBaseAddress :: Addr+ , mbiAllocationBase :: Addr+ , mbiAllocationProtect :: DWORD+ , mbiRegionSize :: SIZE_T+ , mbiState :: DWORD+ , mbiProtect :: DWORD+ , mbiType :: DWORD+ } deriving (Show)++----------------------------------------------------------------+-- Instances+----------------------------------------------------------------++instance Storable MEMORY_BASIC_INFORMATION where+ sizeOf _ = #size MEMORY_BASIC_INFORMATION+ alignment = sizeOf+ poke buf mbi = do+ (#poke MEMORY_BASIC_INFORMATION, BaseAddress) buf (mbiBaseAddress mbi)+ (#poke MEMORY_BASIC_INFORMATION, AllocationBase) buf (mbiAllocationBase mbi)+ (#poke MEMORY_BASIC_INFORMATION, AllocationProtect) buf (mbiAllocationProtect mbi)+ (#poke MEMORY_BASIC_INFORMATION, RegionSize) buf (mbiRegionSize mbi)+ (#poke MEMORY_BASIC_INFORMATION, State) buf (mbiState mbi)+ (#poke MEMORY_BASIC_INFORMATION, Protect) buf (mbiProtect mbi)+ (#poke MEMORY_BASIC_INFORMATION, Type) buf (mbiType mbi)+ peek buf = do+ baseAddress <- (#peek MEMORY_BASIC_INFORMATION, BaseAddress) buf+ allocationBase <- (#peek MEMORY_BASIC_INFORMATION, AllocationBase) buf+ allocationProtect <- (#peek MEMORY_BASIC_INFORMATION, AllocationProtect) buf+ regionSize <- (#peek MEMORY_BASIC_INFORMATION, RegionSize) buf+ state <- (#peek MEMORY_BASIC_INFORMATION, State) buf+ protect <- (#peek MEMORY_BASIC_INFORMATION, Protect) buf+ ty <- (#peek MEMORY_BASIC_INFORMATION, Type) buf+ return $ MEMORY_BASIC_INFORMATION baseAddress allocationBase allocationProtect regionSize state protect ty++----------------------------------------------------------------+ copyMemory :: Ptr a -> Ptr a -> DWORD -> IO () copyMemory dest src nbytes = copyBytes dest src (fromIntegral nbytes) @@ -263,7 +306,11 @@ foreign import WINDOWS_CCONV unsafe "windows.h VirtualProtectEx" c_VirtualProtectEx :: HANDLE -> Addr -> DWORD -> DWORD -> Ptr DWORD -> IO Bool --- No VirtualQuery..()+virtualQueryEx :: HANDLE -> LPVOID -> Ptr MEMORY_BASIC_INFORMATION -> SIZE_T -> IO DWORD+virtualQueryEx hProcess lpAddress lpBuffer dwLength =+ failIfZero "VirtualQueryEx" $ c_VirtualQueryEx hProcess lpAddress lpBuffer dwLength+foreign import WINDOWS_CCONV unsafe "windows.h VirtualQueryEx"+ c_VirtualQueryEx :: HANDLE -> LPVOID -> Ptr MEMORY_BASIC_INFORMATION -> SIZE_T -> IO DWORD virtualUnlock :: Addr -> DWORD -> IO () virtualUnlock addr size =
System/Win32/Process.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
System/Win32/Shell.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701 +#if __GLASGOW_HASKELL__ >= 709 +{-# LANGUAGE Safe #-} +#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -22,6 +24,8 @@ cSIDL_APPDATA, cSIDL_WINDOWS, cSIDL_PERSONAL, + cSIDL_LOCAL_APPDATA, + cSIDL_DESKTOPDIRECTORY, cSIDL_PROGRAM_FILES, SHGetFolderPathFlags, sHGFP_TYPE_CURRENT, @@ -56,6 +60,8 @@ , cSIDL_APPDATA = CSIDL_APPDATA , cSIDL_WINDOWS = CSIDL_WINDOWS , cSIDL_PERSONAL = CSIDL_PERSONAL + , cSIDL_LOCAL_APPDATA = CSIDL_LOCAL_APPDATA + , cSIDL_DESKTOPDIRECTORY = CSIDL_DESKTOPDIRECTORY , cSIDL_PROGRAM_FILES = CSIDL_PROGRAM_FILES } -- XXX there are lots more of these
System/Win32/SimpleMAPI.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------@@ -21,8 +23,6 @@ -- some of the values we use, e.g. MAPI_LOGOFF_SHARED. -- mapix.h does define MAPI_LOGOFF_SHARED, but the various flags -- clash with each other.--- So for now we only define the module content on i386.-#if __i386__ import Control.Exception ( bracket, handle, finally, onException , IOException )@@ -53,8 +53,12 @@ , mAPI_LOGON_UI = MAPI_LOGON_UI , mAPI_NEW_SESSION = MAPI_NEW_SESSION , mAPI_FORCE_DOWNLOAD = MAPI_FORCE_DOWNLOAD+#ifdef MAPI_LOGOFF_SHARED , mAPI_LOGOFF_SHARED = MAPI_LOGOFF_SHARED+#endif+#ifdef MAPI_LOGOFF_UI , mAPI_LOGOFF_UI = MAPI_LOGOFF_UI+#endif , mAPI_DIALOG = MAPI_DIALOG , mAPI_UNREAD_ONLY = MAPI_UNREAD_ONLY , mAPI_LONG_MSGID = MAPI_LONG_MSGID@@ -81,7 +85,9 @@ , ((#const MAPI_E_DISK_FULL) , "Disk full") , ((#const MAPI_E_INSUFFICIENT_MEMORY) , "Not enough memory") , ((#const MAPI_E_ACCESS_DENIED) , "Access denied")+#ifdef MAPI_E_BLK_TOO_SMALL , ((#const MAPI_E_BLK_TOO_SMALL) , "BLK_TOO_SMALL")+#endif , ((#const MAPI_E_TOO_MANY_SESSIONS), "Too many open sessions") , ((#const MAPI_E_TOO_MANY_FILES) , "Too many open files") , ((#const MAPI_E_TOO_MANY_RECIPIENTS) , "Too many recipients")@@ -96,7 +102,9 @@ , ((#const MAPI_E_INVALID_SESSION) , "Invalid session") , ((#const MAPI_E_TYPE_NOT_SUPPORTED) , "Type not supported") , ((#const MAPI_E_AMBIGUOUS_RECIPIENT) , "Ambigious recipient")+#ifdef MAPI_E_AMBIGUOUS_RECIP , ((#const MAPI_E_AMBIGUOUS_RECIP) , "Ambigious recipient")+#endif , ((#const MAPI_E_MESSAGE_IN_USE) , "Message in use") , ((#const MAPI_E_NETWORK_FAILURE) , "Network failure") , ((#const MAPI_E_INVALID_EDITFIELDS) , "Invalid editfields")@@ -407,5 +415,3 @@ handleIOException :: (IOException -> IO a) -> IO a -> IO a handleIOException = handle--#endif
System/Win32/Time.hsc view
@@ -1,4 +1,6 @@-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -----------------------------------------------------------------------------
System/Win32/Types.hs view
@@ -25,7 +25,7 @@ import Data.Char (isSpace) import Data.Int (Int32, Int64) import Data.Maybe (fromMaybe)-import Data.Word (Word, Word8, Word16, Word32, Word64)+import Data.Word (Word8, Word16, Word32, Word64) import Foreign.C.Error (getErrno, errnoToIOError) import Foreign.C.String (newCWString, withCWStringLen) import Foreign.C.String (peekCWString, peekCWStringLen, withCWString)@@ -35,6 +35,10 @@ import Numeric (showHex) import System.IO.Error (ioeSetErrorString) import System.IO.Unsafe (unsafePerformIO)++#if !MIN_VERSION_base(4,8,0)+import Data.Word (Word)+#endif #if MIN_VERSION_base(4,7,0) import Data.Bits (finiteBitSize)
Win32.cabal view
@@ -1,5 +1,5 @@ name: Win32-version: 2.3.0.2+version: 2.3.1.0 license: BSD3 license-file: LICENSE author: Alastair Reid