System.Win32.Types

Win32-2.3.1.1: A binding to part of the Win32 library

Copyright | (c) Alastair Reid 1997-2003
License | BSD-style (see the file libraries/base/LICENSE)
Maintainer | Esa Ilari Vuokko <ei@vuokko.info>
Stability | provisional
Portability | portable
Safe Haskell | Trustworthy
Language | Haskell98

System.Win32.Types

Description

A collection of FFI declarations for interfacing with Win32.

Synopsis

- type BOOL = Bool
- type BYTE = Word8
- type UCHAR = CUChar
- type USHORT = Word16
- type UINT = Word32
- type INT = Int32
- type WORD = Word16
- type DWORD = Word32
- type LONG = Int32
- type FLOAT = Float
- type LARGE_INTEGER = Int64
- type UINT_PTR = Word
- type DDWORD = Word64
- type MbString = Maybe String
- type MbINT = Maybe INT
- type ATOM = UINT
- type WPARAM = UINT
- type LPARAM = LONG
- type LRESULT = LONG
- type SIZE_T = DWORD
- type MbATOM = Maybe ATOM
- type HRESULT = LONG
- type Addr = Ptr ()
- type LPVOID = Ptr ()
- type LPBOOL = Ptr BOOL
- type LPBYTE = Ptr BYTE
- type PUCHAR = Ptr UCHAR
- type LPDWORD = Ptr DWORD
- type LPSTR = Ptr CChar
- type LPCSTR = LPSTR
- type LPWSTR = Ptr CWchar
- type LPCWSTR = LPWSTR
- type LPTSTR = Ptr TCHAR
- type LPCTSTR = LPTSTR
- type LPCTSTR_ = LPCTSTR
- maybePtr :: Maybe (Ptr a) -> Ptr a
- ptrToMaybe :: Ptr a -> Maybe (Ptr a)
- maybeNum :: Num a => Maybe a -> a
- numToMaybe :: (Eq a, Num a) => a -> Maybe a
- type MbLPVOID = Maybe LPVOID
- type MbLPCSTR = Maybe LPCSTR
- type MbLPCTSTR = Maybe LPCTSTR
- withTString :: String -> (LPTSTR -> IO a) -> IO a
- withTStringLen :: String -> ((LPTSTR, Int) -> IO a) -> IO a
- peekTString :: LPCTSTR -> IO String
- peekTStringLen :: (LPCTSTR, Int) -> IO String
- newTString :: String -> IO LPCTSTR
- type TCHAR = CWchar
- type HANDLE = Ptr ()
- type ForeignHANDLE = ForeignPtr ()
- newForeignHANDLE :: HANDLE -> IO ForeignHANDLE
- handleToWord :: HANDLE -> UINT_PTR
- type HKEY = ForeignHANDLE
- type PKEY = HANDLE
- nullHANDLE :: HANDLE
- type MbHANDLE = Maybe HANDLE
- type HINSTANCE = Ptr ()
- type MbHINSTANCE = Maybe HINSTANCE
- type HMODULE = Ptr ()
- type MbHMODULE = Maybe HMODULE
- nullFinalHANDLE :: ForeignPtr a
- iNVALID_HANDLE_VALUE :: HANDLE
- type ErrCode = DWORD
- failIf :: (a -> Bool) -> String -> IO a -> IO a
- failIf_ :: (a -> Bool) -> String -> IO a -> IO ()
- failIfNull :: String -> IO (Ptr a) -> IO (Ptr a)
- failIfZero :: (Eq a, Num a) => String -> IO a -> IO a
- failIfFalse_ :: String -> IO Bool -> IO ()
- failUnlessSuccess :: String -> IO ErrCode -> IO ()
- failUnlessSuccessOr :: ErrCode -> String -> IO ErrCode -> IO Bool
- errorWin :: String -> IO a
- failWith :: String -> ErrCode -> IO a
- c_maperrno :: IO ()
- ddwordToDwords :: DDWORD -> (DWORD, DWORD)
- dwordsToDdword :: (DWORD, DWORD) -> DDWORD
- deleteObjectFinaliser :: FunPtr (Ptr a -> IO ())
- localFree :: Ptr a -> IO (Ptr a)
- getLastError :: IO ErrCode
- getErrorMessage :: DWORD -> IO LPWSTR
- lOWORD :: DWORD -> WORD
- hIWORD :: DWORD -> WORD
- castUINTPtrToPtr :: UINT_PTR -> Ptr a
- castPtrToUINTPtr :: Ptr s -> UINT_PTR
- type LCID = DWORD
- type LANGID = WORD
- type SortID = WORD
- mAKELCID :: LANGID -> SortID -> LCID
- lANGIDFROMLCID :: LCID -> LANGID
- sORTIDFROMLCID :: LCID -> SortID
- type SubLANGID = WORD
- type PrimaryLANGID = WORD
- mAKELANGID :: PrimaryLANGID -> SubLANGID -> LANGID
- pRIMARYLANGID :: LANGID -> PrimaryLANGID
- sUBLANGID :: LANGID -> SubLANGID
- nullPtr :: Ptr a

# Documentation

type BOOL = Bool Source #

type BYTE = Word8 Source #

type UCHAR = CUChar Source #

type USHORT = Word16 Source #

type UINT = Word32 Source #

type INT = Int32 Source #

type WORD = Word16 Source #

type DWORD = Word32 Source #

type LONG = Int32 Source #

type FLOAT = Float Source #

type LARGE_INTEGER = Int64 Source #

type UINT_PTR = Word Source #

type DDWORD = Word64 Source #

type MbString = Maybe String Source #

type MbINT = Maybe INT Source #

type ATOM = UINT Source #

type WPARAM = UINT Source #

type LPARAM = LONG Source #

type LRESULT = LONG Source #

type SIZE_T = DWORD Source #

type MbATOM = Maybe ATOM Source #

type HRESULT = LONG Source #

type Addr = Ptr () Source #

type LPVOID = Ptr () Source #

type LPBOOL = Ptr BOOL Source #

type LPBYTE = Ptr BYTE Source #

type PUCHAR = Ptr UCHAR Source #

type LPDWORD = Ptr DWORD Source #

type LPSTR = Ptr CChar Source #

type LPCSTR = LPSTR Source #

type LPWSTR = Ptr CWchar Source #

type LPCWSTR = LPWSTR Source #

type LPTSTR = Ptr TCHAR Source #

type LPCTSTR = LPTSTR Source #

type LPCTSTR_ = LPCTSTR Source #

maybePtr :: Maybe (Ptr a) -> Ptr a Source #

ptrToMaybe :: Ptr a -> Maybe (Ptr a) Source #

maybeNum :: Num a => Maybe a -> a Source #

numToMaybe :: (Eq a, Num a) => a -> Maybe a Source #

type MbLPVOID = Maybe LPVOID Source #

type MbLPCSTR = Maybe LPCSTR Source #

type MbLPCTSTR = Maybe LPCTSTR Source #

withTString :: String -> (LPTSTR -> IO a) -> IO a Source #

withTStringLen :: String -> ((LPTSTR, Int) -> IO a) -> IO a Source #

peekTString :: LPCTSTR -> IO String Source #

peekTStringLen :: (LPCTSTR, Int) -> IO String Source #

newTString :: String -> IO LPCTSTR Source #

type TCHAR = CWchar Source #

type HANDLE = Ptr () Source #

type ForeignHANDLE = ForeignPtr () Source #

newForeignHANDLE :: HANDLE -> IO ForeignHANDLE Source #

handleToWord :: HANDLE -> UINT_PTR Source #

type HKEY = ForeignHANDLE Source #

type PKEY = HANDLE Source #

nullHANDLE :: HANDLE Source #

type MbHANDLE = Maybe HANDLE Source #

type HINSTANCE = Ptr () Source #

type MbHINSTANCE = Maybe HINSTANCE Source #

type HMODULE = Ptr () Source #

type MbHMODULE = Maybe HMODULE Source #

nullFinalHANDLE :: ForeignPtr a Source #

iNVALID_HANDLE_VALUE :: HANDLE Source #

type ErrCode = DWORD Source #

failIf :: (a -> Bool) -> String -> IO a -> IO a Source #

failIf_ :: (a -> Bool) -> String -> IO a -> IO () Source #

failIfNull :: String -> IO (Ptr a) -> IO (Ptr a) Source #

failIfZero :: (Eq a, Num a) => String -> IO a -> IO a Source #

failIfFalse_ :: String -> IO Bool -> IO () Source #

failUnlessSuccess :: String -> IO ErrCode -> IO () Source #

failUnlessSuccessOr :: ErrCode -> String -> IO ErrCode -> IO Bool Source #

errorWin :: String -> IO a Source #

failWith :: String -> ErrCode -> IO a Source #

c_maperrno :: IO () Source #

ddwordToDwords :: DDWORD -> (DWORD, DWORD) Source #

dwordsToDdword :: (DWORD, DWORD) -> DDWORD Source #

deleteObjectFinaliser :: FunPtr (Ptr a -> IO ()) Source #

localFree :: Ptr a -> IO (Ptr a) Source #

getLastError :: IO ErrCode Source #

getErrorMessage :: DWORD -> IO LPWSTR Source #

lOWORD :: DWORD -> WORD Source #

hIWORD :: DWORD -> WORD Source #

castUINTPtrToPtr :: UINT_PTR -> Ptr a Source #

castPtrToUINTPtr :: Ptr s -> UINT_PTR Source #

type LCID = DWORD Source #

type LANGID = WORD Source #

type SortID = WORD Source #

mAKELCID :: LANGID -> SortID -> LCID Source #

lANGIDFROMLCID :: LCID -> LANGID Source #

sORTIDFROMLCID :: LCID -> SortID Source #

type SubLANGID = WORD Source #

type PrimaryLANGID = WORD Source #

mAKELANGID :: PrimaryLANGID -> SubLANGID -> LANGID Source #

pRIMARYLANGID :: LANGID -> PrimaryLANGID Source #

sUBLANGID :: LANGID -> SubLANGID Source #

nullPtr :: Ptr a Source #

The constant `nullPtr` contains a distinguished value of `Ptr` that is not associated with a valid memory location.