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 | None |
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
- closeHandle :: HANDLE -> IO ()
- createFile_NoRetry :: String -> AccessMode -> ShareMode -> Maybe LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> Maybe HANDLE -> IO HANDLE
- failIfFalseWithRetry_ :: String -> IO Bool -> IO ()
- failIfWithRetry :: (a -> Bool) -> String -> IO a -> IO a
- failIfWithRetry_ :: (a -> Bool) -> String -> IO a -> IO ()
- findClose :: HANDLE -> IO ()
- findCloseChangeNotification :: HANDLE -> IO ()
- findNextChangeNotification :: HANDLE -> IO ()
- findNextFile :: HANDLE -> FindData -> IO Bool
- flushFileBuffers :: HANDLE -> IO ()
- getFileInformationByHandle :: HANDLE -> IO BY_HANDLE_FILE_INFORMATION
- getLogicalDrives :: IO DWORD
- lockFile :: HANDLE -> LockMode -> DWORD64 -> DWORD64 -> IO BOOL
- setEndOfFile :: HANDLE -> IO ()
- setFilePointerEx :: HANDLE -> LARGE_INTEGER -> FilePtrDirection -> IO LARGE_INTEGER
- unlockFile :: HANDLE -> DWORD64 -> DWORD64 -> IO BOOL
- win32_ReadFile :: HANDLE -> Ptr a -> DWORD -> Maybe LPOVERLAPPED -> IO DWORD
- win32_WriteFile :: HANDLE -> Ptr a -> DWORD -> Maybe LPOVERLAPPED -> IO DWORD
- aCCESS_SYSTEM_SECURITY :: AccessMode
- areFileApisANSI :: IO Bool
- cREATE_ALWAYS :: CreateMode
- cREATE_NEW :: CreateMode
- dDD_EXACT_MATCH_ON_REMOVE :: DefineDosDeviceFlags
- dDD_RAW_TARGET_PATH :: DefineDosDeviceFlags
- dDD_REMOVE_DEFINITION :: DefineDosDeviceFlags
- dELETE :: AccessMode
- dRIVE_CDROM :: DriveType
- dRIVE_FIXED :: DriveType
- dRIVE_NO_ROOT_DIR :: DriveType
- dRIVE_RAMDISK :: DriveType
- dRIVE_REMOTE :: DriveType
- dRIVE_REMOVABLE :: DriveType
- dRIVE_UNKNOWN :: DriveType
- fILE_ADD_FILE :: AccessMode
- fILE_ADD_SUBDIRECTORY :: AccessMode
- fILE_ALL_ACCESS :: AccessMode
- fILE_APPEND_DATA :: AccessMode
- fILE_ATTRIBUTE_ARCHIVE :: FileAttributeOrFlag
- fILE_ATTRIBUTE_COMPRESSED :: FileAttributeOrFlag
- fILE_ATTRIBUTE_DIRECTORY :: FileAttributeOrFlag
- fILE_ATTRIBUTE_HIDDEN :: FileAttributeOrFlag
- fILE_ATTRIBUTE_NORMAL :: FileAttributeOrFlag
- fILE_ATTRIBUTE_READONLY :: FileAttributeOrFlag
- fILE_ATTRIBUTE_REPARSE_POINT :: FileAttributeOrFlag
- fILE_ATTRIBUTE_SYSTEM :: FileAttributeOrFlag
- fILE_ATTRIBUTE_TEMPORARY :: FileAttributeOrFlag
- fILE_BEGIN :: FilePtrDirection
- fILE_CREATE_PIPE_INSTANCE :: AccessMode
- fILE_CURRENT :: FilePtrDirection
- fILE_DELETE_CHILD :: AccessMode
- fILE_END :: FilePtrDirection
- fILE_EXECUTE :: AccessMode
- fILE_FLAG_BACKUP_SEMANTICS :: FileAttributeOrFlag
- fILE_FLAG_DELETE_ON_CLOSE :: FileAttributeOrFlag
- fILE_FLAG_NO_BUFFERING :: FileAttributeOrFlag
- fILE_FLAG_OVERLAPPED :: FileAttributeOrFlag
- fILE_FLAG_POSIX_SEMANTICS :: FileAttributeOrFlag
- fILE_FLAG_RANDOM_ACCESS :: FileAttributeOrFlag
- fILE_FLAG_SEQUENTIAL_SCAN :: FileAttributeOrFlag
- fILE_FLAG_WRITE_THROUGH :: FileAttributeOrFlag
- fILE_LIST_DIRECTORY :: AccessMode
- fILE_NOTIFY_CHANGE_ATTRIBUTES :: FileNotificationFlag
- fILE_NOTIFY_CHANGE_DIR_NAME :: FileNotificationFlag
- fILE_NOTIFY_CHANGE_FILE_NAME :: FileNotificationFlag
- fILE_NOTIFY_CHANGE_LAST_WRITE :: FileNotificationFlag
- fILE_NOTIFY_CHANGE_SECURITY :: FileNotificationFlag
- fILE_NOTIFY_CHANGE_SIZE :: FileNotificationFlag
- fILE_READ_ATTRIBUTES :: AccessMode
- fILE_READ_DATA :: AccessMode
- fILE_READ_EA :: AccessMode
- fILE_SHARE_DELETE :: ShareMode
- fILE_SHARE_NONE :: ShareMode
- fILE_SHARE_READ :: ShareMode
- fILE_SHARE_WRITE :: ShareMode
- fILE_TRAVERSE :: AccessMode
- fILE_TYPE_CHAR :: FileType
- fILE_TYPE_DISK :: FileType
- fILE_TYPE_PIPE :: FileType
- fILE_TYPE_REMOTE :: FileType
- fILE_TYPE_UNKNOWN :: FileType
- fILE_WRITE_ATTRIBUTES :: AccessMode
- fILE_WRITE_DATA :: AccessMode
- fILE_WRITE_EA :: AccessMode
- gENERIC_ALL :: AccessMode
- gENERIC_EXECUTE :: AccessMode
- gENERIC_NONE :: AccessMode
- gENERIC_READ :: AccessMode
- gENERIC_WRITE :: AccessMode
- getFileType :: HANDLE -> IO FileType
- lOCKFILE_EXCLUSIVE_LOCK :: LockMode
- lOCKFILE_FAIL_IMMEDIATELY :: LockMode
- mAXIMUM_ALLOWED :: AccessMode
- mOVEFILE_COPY_ALLOWED :: MoveFileFlag
- mOVEFILE_DELAY_UNTIL_REBOOT :: MoveFileFlag
- mOVEFILE_REPLACE_EXISTING :: MoveFileFlag
- oPEN_ALWAYS :: CreateMode
- oPEN_EXISTING :: CreateMode
- rEAD_CONTROL :: AccessMode
- sCS_32BIT_BINARY :: BinaryType
- sCS_DOS_BINARY :: BinaryType
- sCS_OS216_BINARY :: BinaryType
- sCS_PIF_BINARY :: BinaryType
- sCS_POSIX_BINARY :: BinaryType
- sCS_WOW_BINARY :: BinaryType
- sECURITY_ANONYMOUS :: FileAttributeOrFlag
- sECURITY_CONTEXT_TRACKING :: FileAttributeOrFlag
- sECURITY_DELEGATION :: FileAttributeOrFlag
- sECURITY_EFFECTIVE_ONLY :: FileAttributeOrFlag
- sECURITY_IDENTIFICATION :: FileAttributeOrFlag
- sECURITY_IMPERSONATION :: FileAttributeOrFlag
- sECURITY_SQOS_PRESENT :: FileAttributeOrFlag
- sECURITY_VALID_SQOS_FLAGS :: FileAttributeOrFlag
- sPECIFIC_RIGHTS_ALL :: AccessMode
- sTANDARD_RIGHTS_ALL :: AccessMode
- sTANDARD_RIGHTS_EXECUTE :: AccessMode
- sTANDARD_RIGHTS_READ :: AccessMode
- sTANDARD_RIGHTS_REQUIRED :: AccessMode
- sTANDARD_RIGHTS_WRITE :: AccessMode
- sYNCHRONIZE :: AccessMode
- setFileApisToANSI :: IO ()
- setFileApisToOEM :: IO ()
- setHandleCount :: UINT -> IO UINT
- tRUNCATE_EXISTING :: CreateMode
- wRITE_DAC :: AccessMode
- wRITE_OWNER :: AccessMode
- type AccessMode = UINT
- data BY_HANDLE_FILE_INFORMATION = BY_HANDLE_FILE_INFORMATION {}
- type BinaryType = DWORD
- type CreateMode = UINT
- type DefineDosDeviceFlags = DWORD
- type DriveType = UINT
- type FileAttributeOrFlag = UINT
- type FileNotificationFlag = DWORD
- type FilePtrDirection = DWORD
- type FileType = DWORD
- data FindData
- data GET_FILEEX_INFO_LEVELS
- type LPOVERLAPPED = Ptr OVERLAPPED
- type LPSECURITY_ATTRIBUTES = Ptr SECURITY_ATTRIBUTES
- type LockMode = DWORD
- type MbLPOVERLAPPED = Maybe LPOVERLAPPED
- type MbLPSECURITY_ATTRIBUTES = Maybe LPSECURITY_ATTRIBUTES
- type MoveFileFlag = DWORD
- data OVERLAPPED = OVERLAPPED {}
- type PSECURITY_ATTRIBUTES = Ptr SECURITY_ATTRIBUTES
- data SECURITY_ATTRIBUTES = SECURITY_ATTRIBUTES {
- nLength :: !DWORD
- lpSecurityDescriptor :: !LPVOID
- bInheritHandle :: !BOOL
- type ShareMode = UINT
- data WIN32_FILE_ATTRIBUTE_DATA = WIN32_FILE_ATTRIBUTE_DATA {}
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 #
closeHandle :: HANDLE -> IO () Source #
createFile_NoRetry :: String -> AccessMode -> ShareMode -> Maybe LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> Maybe HANDLE -> IO HANDLE Source #
Like createFile, but does not use failIfWithRetry. If another process has the same file open, this will fail.
failIfWithRetry :: (a -> Bool) -> String -> IO a -> IO a Source #
like failIf, but retried on sharing violations. This is necessary for many file operations; see https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/316609
findCloseChangeNotification :: HANDLE -> IO () Source #
findNextChangeNotification :: HANDLE -> IO () Source #
flushFileBuffers :: HANDLE -> 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.
setEndOfFile :: HANDLE -> IO () Source #
setFilePointerEx :: HANDLE -> LARGE_INTEGER -> FilePtrDirection -> IO LARGE_INTEGER Source #
:: HANDLE | CreateFile handle |
-> DWORD64 | Size of region to unlock |
-> DWORD64 | Beginning offset of file to unlock |
-> IO BOOL | Indicates if unlocking was successful, if not query getLastError. |
Unlocks a given range in a file handle, To unlock an entire file use 0xFFFFFFFFFFFFFFFF for size and 0 for offset.
win32_ReadFile :: HANDLE -> Ptr a -> DWORD -> Maybe LPOVERLAPPED -> IO DWORD Source #
win32_WriteFile :: HANDLE -> Ptr a -> DWORD -> Maybe LPOVERLAPPED -> IO DWORD Source #
areFileApisANSI :: IO Bool Source #
dELETE :: AccessMode Source #
setFileApisToANSI :: IO () Source #
setFileApisToOEM :: IO () Source #
type AccessMode = UINT Source #
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 # alignment :: BY_HANDLE_FILE_INFORMATION -> Int # peekElemOff :: Ptr BY_HANDLE_FILE_INFORMATION -> Int -> IO BY_HANDLE_FILE_INFORMATION # pokeElemOff :: Ptr BY_HANDLE_FILE_INFORMATION -> Int -> BY_HANDLE_FILE_INFORMATION -> IO () # peekByteOff :: Ptr b -> Int -> IO BY_HANDLE_FILE_INFORMATION # pokeByteOff :: Ptr b -> Int -> BY_HANDLE_FILE_INFORMATION -> IO () # peek :: Ptr BY_HANDLE_FILE_INFORMATION -> IO BY_HANDLE_FILE_INFORMATION # poke :: Ptr BY_HANDLE_FILE_INFORMATION -> BY_HANDLE_FILE_INFORMATION -> IO () # | |
Show BY_HANDLE_FILE_INFORMATION Source # | |
Defined in System.Win32.File.Internal showsPrec :: Int -> BY_HANDLE_FILE_INFORMATION -> ShowS # show :: BY_HANDLE_FILE_INFORMATION -> String # showList :: [BY_HANDLE_FILE_INFORMATION] -> ShowS # |
type BinaryType = DWORD Source #
type CreateMode = UINT Source #
type DefineDosDeviceFlags = DWORD Source #
type FileAttributeOrFlag = UINT Source #
type FileNotificationFlag = DWORD Source #
type FilePtrDirection = DWORD Source #
data GET_FILEEX_INFO_LEVELS Source #
Instances
type LPOVERLAPPED = Ptr OVERLAPPED Source #
type MbLPOVERLAPPED = Maybe LPOVERLAPPED Source #
type MoveFileFlag = DWORD Source #
data OVERLAPPED Source #
OVERLAPPED | |
|
Instances
Storable OVERLAPPED Source # | |
Defined in System.Win32.File.Internal sizeOf :: OVERLAPPED -> Int # alignment :: OVERLAPPED -> Int # peekElemOff :: Ptr OVERLAPPED -> Int -> IO OVERLAPPED # pokeElemOff :: Ptr OVERLAPPED -> Int -> OVERLAPPED -> IO () # peekByteOff :: Ptr b -> Int -> IO OVERLAPPED # pokeByteOff :: Ptr b -> Int -> OVERLAPPED -> IO () # peek :: Ptr OVERLAPPED -> IO OVERLAPPED # poke :: Ptr OVERLAPPED -> OVERLAPPED -> IO () # | |
Show OVERLAPPED Source # | |
Defined in System.Win32.File.Internal showsPrec :: Int -> OVERLAPPED -> ShowS # show :: OVERLAPPED -> String # showList :: [OVERLAPPED] -> ShowS # |
data SECURITY_ATTRIBUTES Source #
Instances
Storable SECURITY_ATTRIBUTES Source # | |
Defined in System.Win32.File.Internal sizeOf :: SECURITY_ATTRIBUTES -> Int # alignment :: SECURITY_ATTRIBUTES -> Int # peekElemOff :: Ptr SECURITY_ATTRIBUTES -> Int -> IO SECURITY_ATTRIBUTES # pokeElemOff :: Ptr SECURITY_ATTRIBUTES -> Int -> SECURITY_ATTRIBUTES -> IO () # peekByteOff :: Ptr b -> Int -> IO SECURITY_ATTRIBUTES # pokeByteOff :: Ptr b -> Int -> SECURITY_ATTRIBUTES -> IO () # peek :: Ptr SECURITY_ATTRIBUTES -> IO SECURITY_ATTRIBUTES # poke :: Ptr SECURITY_ATTRIBUTES -> SECURITY_ATTRIBUTES -> IO () # | |
Show SECURITY_ATTRIBUTES Source # | |
Defined in System.Win32.File.Internal showsPrec :: Int -> SECURITY_ATTRIBUTES -> ShowS # show :: SECURITY_ATTRIBUTES -> String # showList :: [SECURITY_ATTRIBUTES] -> ShowS # |
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 # alignment :: WIN32_FILE_ATTRIBUTE_DATA -> Int # peekElemOff :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> Int -> IO WIN32_FILE_ATTRIBUTE_DATA # pokeElemOff :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> Int -> WIN32_FILE_ATTRIBUTE_DATA -> IO () # peekByteOff :: Ptr b -> Int -> IO WIN32_FILE_ATTRIBUTE_DATA # pokeByteOff :: Ptr b -> Int -> WIN32_FILE_ATTRIBUTE_DATA -> IO () # peek :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO WIN32_FILE_ATTRIBUTE_DATA # poke :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> WIN32_FILE_ATTRIBUTE_DATA -> IO () # | |
Show WIN32_FILE_ATTRIBUTE_DATA Source # | |
Defined in System.Win32.File.Internal showsPrec :: Int -> WIN32_FILE_ATTRIBUTE_DATA -> ShowS # show :: WIN32_FILE_ATTRIBUTE_DATA -> String # showList :: [WIN32_FILE_ATTRIBUTE_DATA] -> ShowS # |