haskell / 9 / libraries / win32-2.12.0.0 / system-win32-types.html

System.Win32.Types

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

Description

A collection of FFI declarations for interfacing with Win32.

type LPTSTR = Ptr TCHAR Source

type DDWORD = Word64 Source

type UCHAR = CUChar Source

type WORD = Word16 Source

type LPCWSTR = LPWSTR Source

type LPCSTR = LPSTR Source

type LPSTR = Ptr CChar Source

type LPDWORD = Ptr DWORD Source

type LPVOID = Ptr () Source

type LPCTSTR = LPTSTR Source

type LPWSTR = Ptr CWchar Source

type HANDLE = Ptr () Source

type ErrCode = DWORD Source

type ULONG = Word32 Source

type UINT = Word32 Source

type DWORD = Word32 Source

type BYTE = Word8 Source

type LPBOOL = Ptr BOOL Source

type BOOL = Bool Source

type Addr = Ptr () Source

type SHORT = Int16 Source

type INT = Int32 Source

type ATOM = WORD Source

type LONG = Int32 Source

type LRESULT = LONG_PTR Source

type WPARAM = UINT_PTR Source

type HINSTANCE = Ptr () Source

type LONG_PTR = CIntPtr Source

type LPARAM = LONG_PTR Source

type LCID = DWORD Source

type LANGID = WORD Source

type SortID = WORD Source

type SubLANGID = WORD Source

type PrimaryLANGID = WORD Source

type ULONG_PTR = CUIntPtr Source

type SIZE_T = ULONG_PTR Source

type HKEY = ForeignHANDLE Source

type PKEY = HANDLE Source

type LPBYTE = Ptr BYTE Source

type TCHAR = CWchar Source

type HMODULE = Ptr () Source

type LPCTSTR_ = LPCTSTR Source

type LARGE_INTEGER = Int64 Source

type DWORD32 = Word32 Source

type DWORD64 = Word64 Source

type DWORD_PTR = ULONG_PTR Source

type USHORT = Word16 Source

type FLOAT = Float Source

type INT32 = Int32 Source

type INT64 = Int64 Source

type LONG32 = Int32 Source

type LONG64 = Int64 Source

type UINT32 = Word32 Source

type UINT64 = Word64 Source

type ULONG32 = Word32 Source

type ULONG64 = Word64 Source

type INT_PTR = Ptr CInt Source

type UINT_PTR = Word Source

type HALF_PTR = Ptr INT32 Source

type MbString = Maybe String Source

type MbINT = Maybe INT Source

type MbATOM = Maybe ATOM Source

type HRESULT = LONG Source

type PUCHAR = Ptr UCHAR Source

type MbLPVOID = Maybe LPVOID Source

type MbLPCSTR = Maybe LPCSTR Source

type MbLPCTSTR = Maybe LPCTSTR Source

type ForeignHANDLE = ForeignPtr () Source

type MbHANDLE = Maybe HANDLE Source

type MbHINSTANCE = Maybe HINSTANCE Source

type MbHMODULE = Maybe HMODULE Source

try :: String -> (LPTSTR -> UINT -> IO UINT) -> UINT -> IO String Source

getLastError :: IO ErrCode Source

c_maperrno_func :: ErrCode -> IO Errno Source

nullHANDLE :: HANDLE Source

iNVALID_HANDLE_VALUE :: HANDLE Source

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

getErrorMessage :: DWORD -> IO LPWSTR 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

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

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

setLastError :: ErrCode -> IO () Source

c_get_osfhandle :: CInt -> IO HANDLE Source

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

newTString :: String -> IO LPCTSTR Source

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

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

peekTString :: LPCTSTR -> IO String Source

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

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

errorWin :: String -> IO a Source

castUINTPtrToPtr :: UINT_PTR -> Ptr a Source

mAKELCID :: LANGID -> SortID -> LCID Source

lANGIDFROMLCID :: LCID -> LANGID Source

sORTIDFROMLCID :: LCID -> SortID Source

mAKELANGID :: PrimaryLANGID -> SubLANGID -> LANGID Source

pRIMARYLANGID :: LANGID -> PrimaryLANGID Source

sUBLANGID :: LANGID -> SubLANGID Source

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

newForeignHANDLE :: HANDLE -> IO ForeignHANDLE Source

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

eRROR_INSUFFICIENT_BUFFER :: ErrCode Source

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

handleToWord :: HANDLE -> UINT_PTR Source

castPtrToUINTPtr :: Ptr s -> UINT_PTR Source

nullHINSTANCE :: HINSTANCE Source

nullFinalHANDLE :: ForeignPtr a Source

_open_osfhandle :: CIntPtr -> CInt -> IO CInt 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.

withHandleToHANDLE :: Handle -> (HANDLE -> IO a) -> IO a Source

Extract a Windows HANDLE from a Haskell Handle and perform an action on it.

withHandleToHANDLEPosix :: Handle -> (HANDLE -> IO a) -> IO a Source

withStablePtr :: a -> (StablePtr a -> IO b) -> IO b Source

failIfNeg :: (Num a, Ord a) => String -> IO a -> IO a Source

eRROR_MOD_NOT_FOUND :: ErrCode Source

eRROR_PROC_NOT_FOUND :: ErrCode Source

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

lOWORD :: DWORD -> WORD Source

hIWORD :: DWORD -> WORD Source

nullPtr :: Ptr a Source

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/9.4.2/docs/libraries/Win32-2.12.0.0/System-Win32-Types.html