Win32-2.14.0.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.Types

Description

A collection of FFI declarations for interfacing with Win32.

Synopsis

Documentation

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

type LPVOID = Ptr () Source #

type HANDLE = Ptr () Source #

type BOOL = Bool 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 #

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

type INT = Int32 Source #

type ATOM = WORD Source #

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

type Addr = Ptr () Source #

type HINSTANCE = Ptr () Source #

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

type HMODULE = Ptr () Source #

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

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

useAsCWStringSafe :: FilePath -> (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

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.

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

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

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

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

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

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