Win32-2.14.1.0: A binding to Windows Win32 API.
Copyright(c) Alastair Reid 1997-2003
LicenseBSD-style (see the file libraries/base/LICENSE)
MaintainerEsa Ilari Vuokko <ei@vuokko.info>
Stabilityprovisional
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell2010

System.Win32.WindowsString.Types

Description

A collection of FFI declarations for interfacing with Win32.

Synopsis

Documentation

c_wcslen :: CWString -> IO SIZE_T Source #

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

withFilePath :: WindowsPath -> (LPTSTR -> IO a) -> IO a Source #

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

useAsCWStringSafe :: WindowsPath -> (CWString -> IO a) -> IO a Source #

Wrapper around useAsCString, checking the encoded FilePath for internal NUL codepoints as these are disallowed in Windows filepaths. See https://gitlab.haskell.org/ghc/ghc/-/issues/13660

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

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

failIfNeg :: (Num a, Ord a) => String -> IO a -> IO a 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 #

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

nullPtr :: Ptr a #

type MbHMODULE = Maybe HMODULE Source #

type HMODULE = Ptr () Source #

type HINSTANCE = Ptr () Source #

type MbHANDLE = Maybe HANDLE Source #

type ForeignHANDLE = ForeignPtr () Source #

type HANDLE = Ptr () Source #

type TCHAR = CWchar Source #

type MbLPCTSTR = Maybe LPCTSTR Source #

type MbLPCSTR = Maybe LPCSTR Source #

type MbLPVOID = Maybe LPVOID Source #

type LPTSTR = Ptr TCHAR Source #

type LPWSTR = Ptr CWchar Source #

type LPSTR = Ptr CChar Source #

type LPDWORD = Ptr DWORD Source #

type PUCHAR = Ptr UCHAR Source #

type LPBYTE = Ptr BYTE Source #

type LPBOOL = Ptr BOOL Source #

type LPVOID = Ptr () Source #

type Addr = Ptr () Source #

type MbATOM = Maybe ATOM Source #

type ATOM = WORD Source #

type MbINT = Maybe INT Source #

type MbString = Maybe String Source #

type DDWORD = Word64 Source #

type HALF_PTR = Ptr INT32 Source #

type ULONG_PTR = CUIntPtr Source #

type LONG_PTR = CIntPtr Source #

type UINT_PTR = Word Source #

type ULONG = Word32 Source #

type INT_PTR = Ptr CInt Source #

type SHORT = Int16 Source #

type ULONG64 = Word64 Source #

type ULONG32 = Word32 Source #

type UINT64 = Word64 Source #

type UINT32 = Word32 Source #

type LONG64 = Int64 Source #

type LONG32 = Int32 Source #

type INT64 = Int64 Source #

type INT32 = Int32 Source #

type DWORD64 = Word64 Source #

type DWORD32 = Word32 Source #

type LARGE_INTEGER = Int64 Source #

type FLOAT = Float Source #

type LONG = Int32 Source #

type DWORD = Word32 Source #

type WORD = Word16 Source #

type INT = Int32 Source #

type UINT = Word32 Source #

type USHORT = Word16 Source #

type UCHAR = CUChar Source #

type BYTE = Word8 Source #

type BOOL = Bool Source #

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

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

internal_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO () Source #

Returns -1 on error. Otherwise writes two values representing the file into the given ptrs.

internal_lockFile :: CUIntPtr -> Word64 -> Word64 -> CInt -> IO CInt Source #

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

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.

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

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

withHandleToHANDLENative :: Handle -> (HANDLE -> IO a) -> IO a Source #

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

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