System.Win32.Types
Copyright | (c) Alastair Reid 1997-2003 |
---|---|
License | BSD-style (see the file libraries/base/LICENSE) |
Maintainer | Esa Ilari Vuokko <[email protected]> |
Stability | provisional |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Description
A collection of FFI declarations for interfacing with Win32.
type PrimaryLANGID = WORD
type MbHMODULE = Maybe HMODULE
type MbHINSTANCE = Maybe HINSTANCE
type HKEY = ForeignHANDLE
type ForeignHANDLE = ForeignPtr ()
type MbLPCTSTR = Maybe LPCTSTR
type LARGE_INTEGER = Int64
sUBLANGID :: LANGID -> SubLANGID
pRIMARYLANGID :: LANGID -> PrimaryLANGID
mAKELANGID :: PrimaryLANGID -> SubLANGID -> LANGID
sORTIDFROMLCID :: LCID -> SortID
lANGIDFROMLCID :: LCID -> LANGID
mAKELCID :: LANGID -> SortID -> LCID
castPtrToUINTPtr :: Ptr s -> UINT_PTR
castUINTPtrToPtr :: UINT_PTR -> Ptr a
getErrorMessage :: DWORD -> IO LPWSTR
setLastError :: ErrCode -> IO ()
localFree :: Ptr a -> IO (Ptr a)
deleteObjectFinaliser :: FunPtr (Ptr a -> IO ())
c_maperrno_func :: ErrCode -> IO Errno
c_get_osfhandle :: CInt -> IO HANDLE
_open_osfhandle :: CIntPtr -> CInt -> IO CInt
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
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
newForeignHANDLE :: HANDLE -> IO ForeignHANDLE
handleToWord :: HANDLE -> UINT_PTR
nullHANDLE :: HANDLE
nullFinalHANDLE :: ForeignPtr a
iNVALID_HANDLE_VALUE :: HANDLE
hANDLEToHandle :: HANDLE -> IO Handle
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
.
withHandleToHANDLE :: Handle -> (HANDLE -> IO a) -> IO a
Extract a Windows HANDLE
from a Haskell Handle
and perform an action on it.
withStablePtr :: a -> (StablePtr a -> IO b) -> IO b
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
failWith :: String -> ErrCode -> IO a
ddwordToDwords :: DDWORD -> (DWORD, DWORD)
dwordsToDdword :: (DWORD, DWORD) -> DDWORD
try :: String -> (LPTSTR -> UINT -> IO UINT) -> UINT -> IO String
The constant nullPtr
contains a distinguished value of Ptr
that is not associated with a valid memory location.
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/8.10.2/docs/html/libraries/Win32-2.6.1.0/System-Win32-Types.html