| 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 |
A collection of FFI declarations for interfacing with Win32.
_open_osfhandle :: CIntPtr -> CInt -> IO CInt Source
c_get_osfhandle :: CInt -> IO HANDLE Source
c_maperrno_func :: ErrCode -> IO Errno Source
castPtrToUINTPtr :: Ptr s -> UINT_PTR Source
castUINTPtrToPtr :: UINT_PTR -> Ptr a Source
ddwordToDwords :: DDWORD -> (DWORD, DWORD) Source
deleteObjectFinaliser :: FunPtr (Ptr a -> IO ()) Source
dwordsToDdword :: (DWORD, DWORD) -> DDWORD Source
eERROR_ENVVAR_NOT_FOUND :: ErrCode Source
eRROR_INSUFFICIENT_BUFFER :: ErrCode Source
eRROR_MOD_NOT_FOUND :: ErrCode Source
eRROR_PROC_NOT_FOUND :: ErrCode Source
errorWin :: String -> IO a Source
failIf :: (a -> Bool) -> String -> IO a -> IO a Source
failIfFalse_ :: String -> IO Bool -> 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
failIf_ :: (a -> Bool) -> String -> IO a -> IO () Source
failUnlessSuccess :: String -> IO ErrCode -> IO () Source
failUnlessSuccessOr :: ErrCode -> String -> IO ErrCode -> IO Bool Source
failWith :: String -> ErrCode -> IO a Source
getErrorMessage :: DWORD -> IO LPWSTR Source
getLastError :: IO ErrCode 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.
hIWORD :: DWORD -> WORD Source
handleToWord :: HANDLE -> UINT_PTR Source
iNVALID_HANDLE_VALUE :: HANDLE Source
iNVALID_SET_FILE_POINTER :: DWORD 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
lANGIDFROMLCID :: LCID -> LANGID Source
lOWORD :: DWORD -> WORD Source
localFree :: Ptr a -> IO (Ptr a) Source
mAKELANGID :: PrimaryLANGID -> SubLANGID -> LANGID Source
mAKELCID :: LANGID -> SortID -> LCID Source
maybeNum :: Num a => Maybe a -> a Source
maybePtr :: Maybe (Ptr a) -> Ptr a Source
newForeignHANDLE :: HANDLE -> IO ForeignHANDLE Source
newTString :: String -> IO LPCTSTR Source
nullFinalHANDLE :: ForeignPtr a Source
nullHINSTANCE :: HINSTANCE Source
numToMaybe :: (Eq a, Num a) => a -> Maybe a Source
pRIMARYLANGID :: LANGID -> PrimaryLANGID Source
peekTString :: LPCTSTR -> IO String Source
peekTStringLen :: (LPCTSTR, Int) -> IO String Source
ptrToMaybe :: Ptr a -> Maybe (Ptr a) Source
sORTIDFROMLCID :: LCID -> SortID Source
sUBLANGID :: LANGID -> SubLANGID Source
setLastError :: ErrCode -> IO () Source
try :: String -> (LPTSTR -> UINT -> IO UINT) -> UINT -> IO String 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
withFilePath :: FilePath -> (LPTSTR -> IO a) -> IO a Source
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
withTString :: String -> (LPTSTR -> IO a) -> IO a Source
withTStringLen :: String -> ((LPTSTR, Int) -> IO a) -> IO a Source
type DWORD_PTR = ULONG_PTR Source
type ForeignHANDLE = ForeignPtr () Source
type HALF_PTR = Ptr INT32 Source
type HINSTANCE = Ptr () Source
type HKEY = ForeignHANDLE Source
type INT_PTR = Ptr CInt Source
type LARGE_INTEGER = Int64 Source
type LONG_PTR = CIntPtr Source
type LPCTSTR_ = LPCTSTR Source
type LPDWORD = Ptr DWORD Source
type LPTSTR = Ptr TCHAR Source
type LPWSTR = Ptr CWchar Source
type LRESULT = LONG_PTR Source
type MbATOM = Maybe ATOM Source
type MbHANDLE = Maybe HANDLE Source
type MbHINSTANCE = Maybe HINSTANCE Source
type MbHMODULE = Maybe HMODULE Source
type MbLPCSTR = Maybe LPCSTR Source
type MbLPCTSTR = Maybe LPCTSTR Source
type MbLPVOID = Maybe LPVOID Source
type MbString = Maybe String Source
type PUCHAR = Ptr UCHAR Source
type PrimaryLANGID = WORD Source
type SIZE_T = ULONG_PTR Source
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.12.1/docs/libraries/Win32-2.14.1.0-d391/System-Win32-Types.html