W3cubDocs

/Haskell 9

System.Win32.WindowsString.FileMapping

Copyright (c) Esa Ilari Vuokko 2006
License BSD-style (see the file LICENSE)
Maintainer Esa Ilari Vuokko <[email protected]>
Stability provisional
Portability portable
Safe Haskell None
Language Haskell2010

Description

A collection of FFI declarations for interfacing with Win32 mapped files.

createFileMapping :: Maybe HANDLE -> ProtectFlags -> DDWORD -> Maybe WindowsString -> IO HANDLE Source

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.

openFileMapping :: FileMapAccess -> BOOL -> Maybe WindowsString -> IO HANDLE Source

withMappedFile Source

Arguments

:: WindowsPath

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.

fILE_SHARE_WRITE :: ShareMode Source

mapViewOfFile :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> IO (Ptr a) Source

mapViewOfFileEx :: HANDLE -> FileMapAccess -> DDWORD -> SIZE_T -> Ptr a -> IO (Ptr b) Source

unmapViewOfFile :: Ptr a -> IO () Source

withMappedArea Source

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.

fILE_MAP_ALL_ACCESS :: FileMapAccess Source

fILE_MAP_COPY :: FileMapAccess Source

fILE_MAP_READ :: FileMapAccess Source

fILE_MAP_WRITE :: FileMapAccess Source

sEC_COMMIT :: ProtectSectionFlags Source

sEC_IMAGE :: ProtectSectionFlags Source

sEC_NOCACHE :: ProtectSectionFlags Source

sEC_RESERVE :: ProtectSectionFlags Source

type FileMapAccess = DWORD Source

data MappedObject Source

type ProtectSectionFlags = DWORD 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-WindowsString-FileMapping.html