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 | Haskell2010 |
A collection of FFI declarations for interfacing with Win32.
- type HALF_PTR = Ptr INT32
- type DDWORD = Word64
- type MbString = Maybe String
- type MbINT = Maybe INT
- type ATOM = WORD
- type WPARAM = UINT_PTR
- type LPARAM = LONG_PTR
- type LRESULT = LONG_PTR
- type SIZE_T = ULONG_PTR
- 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
- nullHINSTANCE :: HINSTANCE
- type HINSTANCE = Ptr ()
- type MbHINSTANCE = Maybe HINSTANCE
- type HMODULE = Ptr ()
- type MbHMODULE = Maybe HMODULE
- nullFinalHANDLE :: ForeignPtr a
- iNVALID_HANDLE_VALUE :: HANDLE
- _open_osfhandle :: CIntPtr -> CInt -> IO CInt
- hANDLEToHandle :: HANDLE -> IO Handle
- c_get_osfhandle :: CInt -> IO HANDLE
- withHandleToHANDLE :: Handle -> (HANDLE -> IO a) -> IO a
- withStablePtr :: a -> (StablePtr a -> IO b) -> IO b
- type ErrCode = DWORD
- failIf :: (a -> Bool) -> String -> IO a -> IO a
- failIf_ :: (a -> Bool) -> String -> IO a -> IO ()
- failIfNeg :: (Num a, Ord a) => String -> IO a -> IO a
- 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
- eRROR_INSUFFICIENT_BUFFER :: ErrCode
- eRROR_MOD_NOT_FOUND :: ErrCode
- eRROR_PROC_NOT_FOUND :: ErrCode
- errorWin :: String -> IO a
- failWith :: String -> ErrCode -> IO a
- c_maperrno_func :: ErrCode -> IO Errno
- ddwordToDwords :: DDWORD -> (DWORD, DWORD)
- dwordsToDdword :: (DWORD, DWORD) -> DDWORD
- try :: String -> (LPTSTR -> UINT -> IO UINT) -> UINT -> IO String
- deleteObjectFinaliser :: FunPtr (Ptr a -> IO ())
- localFree :: Ptr a -> IO (Ptr a)
- getLastError :: IO ErrCode
- setLastError :: ErrCode -> IO ()
- 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
- 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 DWORD32 = Word32
- type DWORD64 = Word64
- type INT32 = Int32
- type INT64 = Int64
- type LONG32 = Int32
- type LONG64 = Int64
- type UINT32 = Word32
- type UINT64 = Word64
- type ULONG32 = Word32
- type ULONG64 = Word64
- type SHORT = Int16
- type INT_PTR = Ptr CInt
- type ULONG = Word32
- type UINT_PTR = Word
- type LONG_PTR = CIntPtr
- type ULONG_PTR = CUIntPtr
- type DWORD_PTR = ULONG_PTR
- nullPtr :: Ptr a
Documentation
type ForeignHANDLE = ForeignPtr () Source #
newForeignHANDLE :: HANDLE -> IO ForeignHANDLE Source #
handleToWord :: HANDLE -> UINT_PTR Source #
type HKEY = ForeignHANDLE Source #
nullHANDLE :: HANDLE Source #
type MbHINSTANCE = Maybe HINSTANCE Source #
nullFinalHANDLE :: ForeignPtr a Source #
hANDLEToHandle :: HANDLE -> IO Handle Source #
Create a Haskell Handle
from a Windows HANDLE
.
Beware that this function allocates a new file descriptor. A consequence of
this is that calling hANDLEToHandle
on the standard Windows handles will
not give you stdin
, stdout
, or stderr
. For example, if you
run this code:
import Graphics.Win32.Misc
stdoutHANDLE <- getStdHandle sTD_OUTPUT_HANDLE
stdout2 <- hANDLEToHandle
stdoutHANDLE
Then although you can use stdout2
to write to standard output, it is not
the case that
.stdout
== stdout2
getLastError :: IO ErrCode Source #
setLastError :: ErrCode -> IO () Source #
castUINTPtrToPtr :: UINT_PTR -> Ptr a Source #
castPtrToUINTPtr :: Ptr s -> UINT_PTR Source #
lANGIDFROMLCID :: LCID -> LANGID Source #
sORTIDFROMLCID :: LCID -> SortID Source #
type PrimaryLANGID = WORD Source #
mAKELANGID :: PrimaryLANGID -> SubLANGID -> LANGID Source #
pRIMARYLANGID :: LANGID -> PrimaryLANGID Source #
type LARGE_INTEGER = Int64 Source #