Copyright | (c) Esa Ilari Vuokko 2006 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Esa Ilari Vuokko <ei@vuokko.info> |
Stability | provisional |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
System.Win32.FileMapping
Description
A collection of FFI declarations for interfacing with Win32 mapped files.
Synopsis
- mapFile :: FilePath -> IO (ForeignPtr a, Int)
- mapFile :: FilePath -> IO (ForeignPtr a, Int)
- mapFileBs :: FilePath -> IO ByteString
- mapFileBs :: FilePath -> IO ByteString
- data MappedObject = MappedObject HANDLE HANDLE FileMapAccess
- withMappedFile :: FilePath -> Bool -> Maybe Bool -> (Integer -> MappedObject -> IO a) -> IO a
- withMappedFile :: FilePath -> Bool -> Maybe Bool -> (Integer -> MappedObject -> IO a) -> IO a
- withMappedArea :: MappedObject -> Integer -> Int -> (Ptr a -> IO b) -> IO b
- withMappedArea :: MappedObject -> Integer -> Int -> (Ptr a -> IO b) -> IO b
- type ProtectSectionFlags = DWORD
- sEC_COMMIT :: ProtectSectionFlags
- sEC_COMMIT :: ProtectSectionFlags
- sEC_IMAGE :: ProtectSectionFlags
- sEC_IMAGE :: ProtectSectionFlags
- sEC_NOCACHE :: ProtectSectionFlags
- sEC_NOCACHE :: ProtectSectionFlags
- sEC_RESERVE :: ProtectSectionFlags
- sEC_RESERVE :: ProtectSectionFlags
- type FileMapAccess = DWORD
- fILE_MAP_ALL_ACCESS :: FileMapAccess
- fILE_MAP_ALL_ACCESS :: FileMapAccess
- fILE_MAP_COPY :: FileMapAccess
- fILE_MAP_COPY :: FileMapAccess
- fILE_MAP_READ :: FileMapAccess
- fILE_MAP_READ :: FileMapAccess
- fILE_MAP_WRITE :: FileMapAccess
- fILE_MAP_WRITE :: FileMapAccess
- createFileMapping :: Maybe HANDLE -> ProtectFlags -> DDWORD -> Maybe String -> IO HANDLE
- createFileMapping :: Maybe HANDLE -> ProtectFlags -> DDWORD -> Maybe String -> IO HANDLE
- openFileMapping :: FileMapAccess -> BOOL -> Maybe String -> IO HANDLE
- openFileMapping :: FileMapAccess -> BOOL -> Maybe String -> IO HANDLE
- mapViewOfFileEx :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> Ptr a -> IO (Ptr b)
- mapViewOfFileEx :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> Ptr a -> IO (Ptr b)
- mapViewOfFile :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> IO (Ptr a)
- mapViewOfFile :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> IO (Ptr a)
- unmapViewOfFile :: Ptr a -> IO ()
- unmapViewOfFile :: Ptr a -> IO ()
- c_OpenFileMapping :: DWORD -> BOOL -> LPCTSTR -> IO HANDLE
- c_CreateFileMapping :: HANDLE -> Ptr () -> DWORD -> DWORD -> DWORD -> LPCTSTR -> IO HANDLE
- c_MapViewOfFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> SIZE_T -> Ptr a -> IO (Ptr b)
- c_UnmapViewOfFile :: Ptr a -> IO BOOL
- c_UnmapViewOfFileFinaliser :: FunPtr (Ptr a -> IO ())
Documentation
mapFile :: FilePath -> IO (ForeignPtr a, Int) Source #
Maps file fully and returns ForeignPtr and length of the mapped area. The mapped file is opened read-only and shared reading.
mapFile :: FilePath -> IO (ForeignPtr a, Int) Source #
Maps file fully and returns ForeignPtr and length of the mapped area. The mapped file is opened read-only and shared reading.
data MappedObject Source #
Constructors
MappedObject HANDLE HANDLE FileMapAccess |
Arguments
:: FilePath | Path |
-> Bool | Write? (False = read-only) |
-> Maybe Bool | Sharing mode, no sharing, share read, share read+write |
-> (Integer -> MappedObject -> IO a) | Action |
-> IO a |
Opens an existing file and creates mapping object to it.
Arguments
:: FilePath | Path |
-> Bool | Write? (False = read-only) |
-> Maybe Bool | Sharing mode, no sharing, share read, share read+write |
-> (Integer -> MappedObject -> IO a) | Action |
-> IO a |
Opens an existing file and creates mapping object to it.
Arguments
:: MappedObject | Mapped object, from withMappedFile |
-> Integer | Position in file |
-> Int | Size of mapped area |
-> (Ptr a -> IO b) | Action |
-> IO b |
Maps area into memory.
Arguments
:: MappedObject | Mapped object, from withMappedFile |
-> Integer | Position in file |
-> Int | Size of mapped area |
-> (Ptr a -> IO b) | Action |
-> IO b |
Maps area into memory.
type ProtectSectionFlags = DWORD Source #
type FileMapAccess = DWORD Source #
openFileMapping :: FileMapAccess -> BOOL -> Maybe String -> IO HANDLE Source #
openFileMapping :: FileMapAccess -> BOOL -> Maybe String -> IO HANDLE Source #
mapViewOfFileEx :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> Ptr a -> IO (Ptr b) Source #
mapViewOfFileEx :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> Ptr a -> IO (Ptr b) Source #
mapViewOfFile :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> IO (Ptr a) Source #
mapViewOfFile :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> IO (Ptr a) Source #
unmapViewOfFile :: Ptr a -> IO () Source #
unmapViewOfFile :: Ptr a -> IO () Source #