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 | None |
Language | Haskell2010 |
System.Win32.WindowsString.FileMapping
Description
A collection of FFI declarations for interfacing with Win32 mapped files.
Synopsis
- mapFile :: WindowsPath -> IO (ForeignPtr a, Int)
- withMappedFile :: WindowsPath -> Bool -> Maybe Bool -> (Integer -> MappedObject -> IO a) -> IO a
- createFileMapping :: Maybe HANDLE -> ProtectFlags -> DDWORD -> Maybe WindowsString -> IO HANDLE
- openFileMapping :: FileMapAccess -> BOOL -> Maybe WindowsString -> IO HANDLE
- type FileMapAccess = DWORD
- type ProtectSectionFlags = DWORD
- data MappedObject = MappedObject HANDLE HANDLE FileMapAccess
- sEC_COMMIT :: ProtectSectionFlags
- sEC_IMAGE :: ProtectSectionFlags
- sEC_NOCACHE :: ProtectSectionFlags
- sEC_RESERVE :: ProtectSectionFlags
- fILE_MAP_ALL_ACCESS :: FileMapAccess
- fILE_MAP_COPY :: FileMapAccess
- fILE_MAP_READ :: FileMapAccess
- fILE_MAP_WRITE :: FileMapAccess
- fILE_SHARE_WRITE :: ShareMode
- withMappedArea :: MappedObject -> Integer -> Int -> (Ptr a -> IO b) -> IO b
- mapViewOfFileEx :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> Ptr a -> IO (Ptr b)
- mapViewOfFile :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> IO (Ptr a)
- unmapViewOfFile :: Ptr a -> IO ()
Documentation
mapFile :: WindowsPath -> 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.
Arguments
Path
Write? (False = read-only)
Sharing mode, no sharing, share read, share read+write
Action
Opens an existing file and creates mapping object to it.
createFileMapping :: Maybe HANDLE -> ProtectFlags -> DDWORD -> Maybe WindowsString -> IO HANDLE Source #
openFileMapping :: FileMapAccess -> BOOL -> Maybe WindowsString -> IO HANDLE Source #
type FileMapAccess = DWORD Source #
type ProtectSectionFlags = DWORD Source #
data MappedObject Source #
Constructors
Arguments
Mapped object, from withMappedFile
Position in file
Size of mapped area
Action
Maps area into memory.
mapViewOfFileEx :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> Ptr a -> IO (Ptr b) Source #
mapViewOfFile :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> IO (Ptr a) Source #
unmapViewOfFile :: Ptr a -> IO () Source #