Copyright | (c) Alastair Reid 1997-2003 |
---|---|
License | BSD-style (see the file libraries/base/LICENSE) |
Maintainer | Esa Ilari Vuokko <ei@vuokko.info> |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A collection of FFI declarations for interfacing with Win32.
Synopsis
- deleteFile :: WindowsString -> IO ()
- copyFile :: WindowsString -> WindowsString -> Bool -> IO ()
- moveFile :: WindowsString -> WindowsString -> IO ()
- moveFileEx :: WindowsString -> Maybe WindowsString -> MoveFileFlag -> IO ()
- setCurrentDirectory :: WindowsString -> IO ()
- createDirectory :: WindowsString -> Maybe LPSECURITY_ATTRIBUTES -> IO ()
- createDirectoryEx :: WindowsString -> WindowsString -> Maybe LPSECURITY_ATTRIBUTES -> IO ()
- removeDirectory :: WindowsString -> IO ()
- getBinaryType :: WindowsString -> IO BinaryType
- createFile :: WindowsString -> AccessMode -> ShareMode -> Maybe LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> Maybe HANDLE -> IO HANDLE
- setFileAttributes :: WindowsString -> FileAttributeOrFlag -> IO ()
- getFileAttributes :: WindowsString -> IO FileAttributeOrFlag
- getFileAttributesExStandard :: WindowsString -> IO WIN32_FILE_ATTRIBUTE_DATA
- findFirstChangeNotification :: WindowsString -> Bool -> FileNotificationFlag -> IO HANDLE
- getFindDataFileName :: FindData -> IO WindowsString
- findFirstFile :: WindowsString -> IO (HANDLE, FindData)
- defineDosDevice :: DefineDosDeviceFlags -> WindowsString -> Maybe WindowsString -> IO ()
- getDiskFreeSpace :: Maybe WindowsString -> IO (DWORD, DWORD, DWORD, DWORD)
- setVolumeLabel :: Maybe WindowsString -> Maybe WindowsString -> IO ()
- getFileExInfoStandard :: GET_FILEEX_INFO_LEVELS
- getFileExMaxInfoLevel :: GET_FILEEX_INFO_LEVELS
- type LockMode = DWORD
- type LPOVERLAPPED = Ptr OVERLAPPED
- data OVERLAPPED = OVERLAPPED {}
- type AccessMode = UINT
- type LPSECURITY_ATTRIBUTES = Ptr SECURITY_ATTRIBUTES
- data SECURITY_ATTRIBUTES = SECURITY_ATTRIBUTES {
- nLength :: !DWORD
- lpSecurityDescriptor :: !LPVOID
- bInheritHandle :: !BOOL
- type ShareMode = UINT
- type CreateMode = UINT
- type FileAttributeOrFlag = UINT
- type MoveFileFlag = DWORD
- type FilePtrDirection = DWORD
- type DriveType = UINT
- type DefineDosDeviceFlags = DWORD
- type BinaryType = DWORD
- type FileNotificationFlag = DWORD
- type FileType = DWORD
- data GET_FILEEX_INFO_LEVELS
- type PSECURITY_ATTRIBUTES = Ptr SECURITY_ATTRIBUTES
- type MbLPSECURITY_ATTRIBUTES = Maybe LPSECURITY_ATTRIBUTES
- data BY_HANDLE_FILE_INFORMATION = BY_HANDLE_FILE_INFORMATION {}
- data WIN32_FILE_ATTRIBUTE_DATA = WIN32_FILE_ATTRIBUTE_DATA {}
- type MbLPOVERLAPPED = Maybe LPOVERLAPPED
- data FindData
- gENERIC_NONE :: AccessMode
- gENERIC_READ :: AccessMode
- gENERIC_WRITE :: AccessMode
- gENERIC_EXECUTE :: AccessMode
- gENERIC_ALL :: AccessMode
- dELETE :: AccessMode
- rEAD_CONTROL :: AccessMode
- wRITE_DAC :: AccessMode
- wRITE_OWNER :: AccessMode
- sYNCHRONIZE :: AccessMode
- sTANDARD_RIGHTS_REQUIRED :: AccessMode
- sTANDARD_RIGHTS_READ :: AccessMode
- sTANDARD_RIGHTS_WRITE :: AccessMode
- sTANDARD_RIGHTS_EXECUTE :: AccessMode
- sTANDARD_RIGHTS_ALL :: AccessMode
- sPECIFIC_RIGHTS_ALL :: AccessMode
- aCCESS_SYSTEM_SECURITY :: AccessMode
- mAXIMUM_ALLOWED :: AccessMode
- fILE_ADD_FILE :: AccessMode
- fILE_ADD_SUBDIRECTORY :: AccessMode
- fILE_ALL_ACCESS :: AccessMode
- fILE_APPEND_DATA :: AccessMode
- fILE_CREATE_PIPE_INSTANCE :: AccessMode
- fILE_DELETE_CHILD :: AccessMode
- fILE_EXECUTE :: AccessMode
- fILE_LIST_DIRECTORY :: AccessMode
- fILE_READ_ATTRIBUTES :: AccessMode
- fILE_READ_DATA :: AccessMode
- fILE_READ_EA :: AccessMode
- fILE_TRAVERSE :: AccessMode
- fILE_WRITE_ATTRIBUTES :: AccessMode
- fILE_WRITE_DATA :: AccessMode
- fILE_WRITE_EA :: AccessMode
- fILE_SHARE_NONE :: ShareMode
- fILE_SHARE_READ :: ShareMode
- fILE_SHARE_WRITE :: ShareMode
- fILE_SHARE_DELETE :: ShareMode
- cREATE_NEW :: CreateMode
- cREATE_ALWAYS :: CreateMode
- oPEN_EXISTING :: CreateMode
- oPEN_ALWAYS :: CreateMode
- tRUNCATE_EXISTING :: CreateMode
- fILE_ATTRIBUTE_READONLY :: FileAttributeOrFlag
- fILE_ATTRIBUTE_HIDDEN :: FileAttributeOrFlag
- fILE_ATTRIBUTE_SYSTEM :: FileAttributeOrFlag
- fILE_ATTRIBUTE_DIRECTORY :: FileAttributeOrFlag
- fILE_ATTRIBUTE_ARCHIVE :: FileAttributeOrFlag
- fILE_ATTRIBUTE_NORMAL :: FileAttributeOrFlag
- fILE_ATTRIBUTE_TEMPORARY :: FileAttributeOrFlag
- fILE_ATTRIBUTE_COMPRESSED :: FileAttributeOrFlag
- fILE_ATTRIBUTE_REPARSE_POINT :: FileAttributeOrFlag
- fILE_FLAG_WRITE_THROUGH :: FileAttributeOrFlag
- fILE_FLAG_OVERLAPPED :: FileAttributeOrFlag
- fILE_FLAG_NO_BUFFERING :: FileAttributeOrFlag
- fILE_FLAG_RANDOM_ACCESS :: FileAttributeOrFlag
- fILE_FLAG_SEQUENTIAL_SCAN :: FileAttributeOrFlag
- fILE_FLAG_DELETE_ON_CLOSE :: FileAttributeOrFlag
- fILE_FLAG_BACKUP_SEMANTICS :: FileAttributeOrFlag
- fILE_FLAG_POSIX_SEMANTICS :: FileAttributeOrFlag
- sECURITY_ANONYMOUS :: FileAttributeOrFlag
- sECURITY_IDENTIFICATION :: FileAttributeOrFlag
- sECURITY_IMPERSONATION :: FileAttributeOrFlag
- sECURITY_DELEGATION :: FileAttributeOrFlag
- sECURITY_CONTEXT_TRACKING :: FileAttributeOrFlag
- sECURITY_EFFECTIVE_ONLY :: FileAttributeOrFlag
- sECURITY_SQOS_PRESENT :: FileAttributeOrFlag
- sECURITY_VALID_SQOS_FLAGS :: FileAttributeOrFlag
- mOVEFILE_REPLACE_EXISTING :: MoveFileFlag
- mOVEFILE_COPY_ALLOWED :: MoveFileFlag
- mOVEFILE_DELAY_UNTIL_REBOOT :: MoveFileFlag
- fILE_BEGIN :: FilePtrDirection
- fILE_CURRENT :: FilePtrDirection
- fILE_END :: FilePtrDirection
- dRIVE_UNKNOWN :: DriveType
- dRIVE_NO_ROOT_DIR :: DriveType
- dRIVE_REMOVABLE :: DriveType
- dRIVE_FIXED :: DriveType
- dRIVE_REMOTE :: DriveType
- dRIVE_CDROM :: DriveType
- dRIVE_RAMDISK :: DriveType
- dDD_RAW_TARGET_PATH :: DefineDosDeviceFlags
- dDD_REMOVE_DEFINITION :: DefineDosDeviceFlags
- dDD_EXACT_MATCH_ON_REMOVE :: DefineDosDeviceFlags
- sCS_32BIT_BINARY :: BinaryType
- sCS_DOS_BINARY :: BinaryType
- sCS_WOW_BINARY :: BinaryType
- sCS_PIF_BINARY :: BinaryType
- sCS_POSIX_BINARY :: BinaryType
- sCS_OS216_BINARY :: BinaryType
- fILE_NOTIFY_CHANGE_FILE_NAME :: FileNotificationFlag
- fILE_NOTIFY_CHANGE_DIR_NAME :: FileNotificationFlag
- fILE_NOTIFY_CHANGE_ATTRIBUTES :: FileNotificationFlag
- fILE_NOTIFY_CHANGE_SIZE :: FileNotificationFlag
- fILE_NOTIFY_CHANGE_LAST_WRITE :: FileNotificationFlag
- fILE_NOTIFY_CHANGE_SECURITY :: FileNotificationFlag
- fILE_TYPE_UNKNOWN :: FileType
- fILE_TYPE_DISK :: FileType
- fILE_TYPE_CHAR :: FileType
- fILE_TYPE_PIPE :: FileType
- fILE_TYPE_REMOTE :: FileType
- lOCKFILE_EXCLUSIVE_LOCK :: LockMode
- lOCKFILE_FAIL_IMMEDIATELY :: LockMode
- failIfWithRetry :: (a -> Bool) -> String -> IO a -> IO a
- failIfWithRetry_ :: (a -> Bool) -> String -> IO a -> IO ()
- failIfFalseWithRetry_ :: String -> IO Bool -> IO ()
- closeHandle :: HANDLE -> IO ()
- getFileType :: HANDLE -> IO FileType
- flushFileBuffers :: HANDLE -> IO ()
- setEndOfFile :: HANDLE -> IO ()
- getFileInformationByHandle :: HANDLE -> IO BY_HANDLE_FILE_INFORMATION
- win32_ReadFile :: HANDLE -> Ptr a -> DWORD -> Maybe LPOVERLAPPED -> IO DWORD
- win32_WriteFile :: HANDLE -> Ptr a -> DWORD -> Maybe LPOVERLAPPED -> IO DWORD
- setFilePointerEx :: HANDLE -> LARGE_INTEGER -> FilePtrDirection -> IO LARGE_INTEGER
- findNextChangeNotification :: HANDLE -> IO ()
- findCloseChangeNotification :: HANDLE -> IO ()
- findNextFile :: HANDLE -> FindData -> IO Bool
- findClose :: HANDLE -> IO ()
- areFileApisANSI :: IO Bool
- setFileApisToOEM :: IO ()
- setFileApisToANSI :: IO ()
- setHandleCount :: UINT -> IO UINT
- getLogicalDrives :: IO DWORD
- lockFile :: HANDLE -> LockMode -> DWORD64 -> DWORD64 -> IO BOOL
- unlockFile :: HANDLE -> DWORD64 -> DWORD64 -> IO BOOL
Documentation
deleteFile :: WindowsString -> IO () Source #
copyFile :: WindowsString -> WindowsString -> Bool -> IO () Source #
moveFile :: WindowsString -> WindowsString -> IO () Source #
moveFileEx :: WindowsString -> Maybe WindowsString -> MoveFileFlag -> IO () Source #
setCurrentDirectory :: WindowsString -> IO () Source #
createDirectory :: WindowsString -> Maybe LPSECURITY_ATTRIBUTES -> IO () Source #
createDirectoryEx :: WindowsString -> WindowsString -> Maybe LPSECURITY_ATTRIBUTES -> IO () Source #
removeDirectory :: WindowsString -> IO () Source #
createFile :: WindowsString -> AccessMode -> ShareMode -> Maybe LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> Maybe HANDLE -> IO HANDLE Source #
setFileAttributes :: WindowsString -> FileAttributeOrFlag -> IO () Source #
findFirstFile :: WindowsString -> IO (HANDLE, FindData) Source #
defineDosDevice :: DefineDosDeviceFlags -> WindowsString -> Maybe WindowsString -> IO () Source #
getDiskFreeSpace :: Maybe WindowsString -> IO (DWORD, DWORD, DWORD, DWORD) Source #
setVolumeLabel :: Maybe WindowsString -> Maybe WindowsString -> IO () Source #
type LPOVERLAPPED = Ptr OVERLAPPED Source #
data OVERLAPPED Source #
OVERLAPPED | |
|
Instances
Storable OVERLAPPED Source # | |
Defined in System.Win32.File.Internal sizeOf :: OVERLAPPED -> Int Source # alignment :: OVERLAPPED -> Int Source # peekElemOff :: Ptr OVERLAPPED -> Int -> IO OVERLAPPED Source # pokeElemOff :: Ptr OVERLAPPED -> Int -> OVERLAPPED -> IO () Source # peekByteOff :: Ptr b -> Int -> IO OVERLAPPED Source # pokeByteOff :: Ptr b -> Int -> OVERLAPPED -> IO () Source # peek :: Ptr OVERLAPPED -> IO OVERLAPPED Source # poke :: Ptr OVERLAPPED -> OVERLAPPED -> IO () Source # | |
Show OVERLAPPED Source # | |
Defined in System.Win32.File.Internal |
type AccessMode = UINT Source #
data SECURITY_ATTRIBUTES Source #
Instances
Storable SECURITY_ATTRIBUTES Source # | |
Defined in System.Win32.File.Internal sizeOf :: SECURITY_ATTRIBUTES -> Int Source # alignment :: SECURITY_ATTRIBUTES -> Int Source # peekElemOff :: Ptr SECURITY_ATTRIBUTES -> Int -> IO SECURITY_ATTRIBUTES Source # pokeElemOff :: Ptr SECURITY_ATTRIBUTES -> Int -> SECURITY_ATTRIBUTES -> IO () Source # peekByteOff :: Ptr b -> Int -> IO SECURITY_ATTRIBUTES Source # pokeByteOff :: Ptr b -> Int -> SECURITY_ATTRIBUTES -> IO () Source # peek :: Ptr SECURITY_ATTRIBUTES -> IO SECURITY_ATTRIBUTES Source # poke :: Ptr SECURITY_ATTRIBUTES -> SECURITY_ATTRIBUTES -> IO () Source # | |
Show SECURITY_ATTRIBUTES Source # | |
Defined in System.Win32.File.Internal |
type CreateMode = UINT Source #
type FileAttributeOrFlag = UINT Source #
type MoveFileFlag = DWORD Source #
type FilePtrDirection = DWORD Source #
type DefineDosDeviceFlags = DWORD Source #
type BinaryType = DWORD Source #
type FileNotificationFlag = DWORD Source #
data GET_FILEEX_INFO_LEVELS Source #
Instances
data BY_HANDLE_FILE_INFORMATION Source #
Instances
Storable BY_HANDLE_FILE_INFORMATION Source # | |
Defined in System.Win32.File.Internal sizeOf :: BY_HANDLE_FILE_INFORMATION -> Int Source # alignment :: BY_HANDLE_FILE_INFORMATION -> Int Source # peekElemOff :: Ptr BY_HANDLE_FILE_INFORMATION -> Int -> IO BY_HANDLE_FILE_INFORMATION Source # pokeElemOff :: Ptr BY_HANDLE_FILE_INFORMATION -> Int -> BY_HANDLE_FILE_INFORMATION -> IO () Source # peekByteOff :: Ptr b -> Int -> IO BY_HANDLE_FILE_INFORMATION Source # pokeByteOff :: Ptr b -> Int -> BY_HANDLE_FILE_INFORMATION -> IO () Source # peek :: Ptr BY_HANDLE_FILE_INFORMATION -> IO BY_HANDLE_FILE_INFORMATION Source # poke :: Ptr BY_HANDLE_FILE_INFORMATION -> BY_HANDLE_FILE_INFORMATION -> IO () Source # | |
Show BY_HANDLE_FILE_INFORMATION Source # | |
Defined in System.Win32.File.Internal |
data WIN32_FILE_ATTRIBUTE_DATA Source #
Instances
Storable WIN32_FILE_ATTRIBUTE_DATA Source # | |
Defined in System.Win32.File.Internal sizeOf :: WIN32_FILE_ATTRIBUTE_DATA -> Int Source # alignment :: WIN32_FILE_ATTRIBUTE_DATA -> Int Source # peekElemOff :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> Int -> IO WIN32_FILE_ATTRIBUTE_DATA Source # pokeElemOff :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> Int -> WIN32_FILE_ATTRIBUTE_DATA -> IO () Source # peekByteOff :: Ptr b -> Int -> IO WIN32_FILE_ATTRIBUTE_DATA Source # pokeByteOff :: Ptr b -> Int -> WIN32_FILE_ATTRIBUTE_DATA -> IO () Source # peek :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO WIN32_FILE_ATTRIBUTE_DATA Source # poke :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> WIN32_FILE_ATTRIBUTE_DATA -> IO () Source # | |
Show WIN32_FILE_ATTRIBUTE_DATA Source # | |
Defined in System.Win32.File.Internal |
type MbLPOVERLAPPED = Maybe LPOVERLAPPED Source #
dELETE :: AccessMode Source #
failIfWithRetry :: (a -> Bool) -> String -> IO a -> IO a Source #
like failIfFalse_, but retried on sharing violations. This is necessary for many file operations; see http://support.microsoft.com/kb/316609
closeHandle :: HANDLE -> IO () Source #
flushFileBuffers :: HANDLE -> IO () Source #
setEndOfFile :: HANDLE -> IO () Source #
win32_ReadFile :: HANDLE -> Ptr a -> DWORD -> Maybe LPOVERLAPPED -> IO DWORD Source #
win32_WriteFile :: HANDLE -> Ptr a -> DWORD -> Maybe LPOVERLAPPED -> IO DWORD Source #
setFilePointerEx :: HANDLE -> LARGE_INTEGER -> FilePtrDirection -> IO LARGE_INTEGER Source #
findNextChangeNotification :: HANDLE -> IO () Source #
findCloseChangeNotification :: HANDLE -> IO () Source #
areFileApisANSI :: IO Bool Source #
setFileApisToOEM :: IO () Source #
setFileApisToANSI :: IO () Source #
:: HANDLE | CreateFile handle |
-> LockMode | Locking mode |
-> DWORD64 | Size of region to lock |
-> DWORD64 | Beginning offset of file to lock |
-> IO BOOL | Indicates if locking was successful, if not query getLastError. |
Locks a given range in a file handle, To lock an entire file use 0xFFFFFFFFFFFFFFFF for size and 0 for offset.