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
- getTempFileName :: WindowsString -> WindowsString -> Maybe UINT -> IO (WindowsString, UINT)
- 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
- data FindData
- type MbLPOVERLAPPED = Maybe LPOVERLAPPED
- type LPOVERLAPPED = Ptr OVERLAPPED
- data OVERLAPPED = OVERLAPPED {}
- data WIN32_FILE_ATTRIBUTE_DATA = WIN32_FILE_ATTRIBUTE_DATA {}
- data BY_HANDLE_FILE_INFORMATION = BY_HANDLE_FILE_INFORMATION {}
- type MbLPSECURITY_ATTRIBUTES = Maybe LPSECURITY_ATTRIBUTES
- type LPSECURITY_ATTRIBUTES = Ptr SECURITY_ATTRIBUTES
- type PSECURITY_ATTRIBUTES = Ptr SECURITY_ATTRIBUTES
- data SECURITY_ATTRIBUTES = SECURITY_ATTRIBUTES {
- nLength :: !DWORD
- lpSecurityDescriptor :: !LPVOID
- bInheritHandle :: !BOOL
- data GET_FILEEX_INFO_LEVELS
- type LockMode = DWORD
- type FileType = DWORD
- type FileNotificationFlag = DWORD
- type BinaryType = DWORD
- type DefineDosDeviceFlags = DWORD
- type DriveType = UINT
- type FilePtrDirection = DWORD
- type MoveFileFlag = DWORD
- type FileAttributeOrFlag = UINT
- type CreateMode = UINT
- type ShareMode = UINT
- type AccessMode = UINT
- setHandleCount :: UINT -> IO UINT
- setFileApisToANSI :: IO ()
- setFileApisToOEM :: IO ()
- areFileApisANSI :: IO Bool
- getFileType :: HANDLE -> IO FileType
- 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 ()
- createFile_NoRetry :: String -> AccessMode -> ShareMode -> Maybe LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> Maybe HANDLE -> IO HANDLE
- closeHandle :: HANDLE -> IO ()
- 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 ()
- 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 #
getBinaryType :: WindowsString -> IO BinaryType Source #
createFile :: WindowsString -> AccessMode -> ShareMode -> Maybe LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> Maybe HANDLE -> IO HANDLE Source #
setFileAttributes :: WindowsString -> FileAttributeOrFlag -> IO () Source #
:: WindowsString | directory for the temporary file (must be at most MAX_PATH - 14 characters long) |
-> WindowsString | prefix for the temporary file name |
-> Maybe UINT | if |
-> IO (WindowsString, UINT) |
Get a unique temporary filename.
Calls GetTempFileNameW
.
findFirstChangeNotification :: WindowsString -> Bool -> FileNotificationFlag -> IO HANDLE Source #
getFindDataFileName :: FindData -> IO WindowsString 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 MbLPOVERLAPPED = Maybe LPOVERLAPPED Source #
type LPOVERLAPPED = Ptr OVERLAPPED Source #
data OVERLAPPED Source #
OVERLAPPED | |
|
Instances
Show OVERLAPPED Source # | |
Defined in System.Win32.File.Internal showsPrec :: Int -> OVERLAPPED -> ShowS show :: OVERLAPPED -> String showList :: [OVERLAPPED] -> ShowS | |
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 () |
data WIN32_FILE_ATTRIBUTE_DATA Source #
Instances
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 | |
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 () |
data BY_HANDLE_FILE_INFORMATION Source #
Instances
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 | |
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 () |
type MbLPSECURITY_ATTRIBUTES = Maybe LPSECURITY_ATTRIBUTES Source #
type LPSECURITY_ATTRIBUTES = Ptr SECURITY_ATTRIBUTES Source #
type PSECURITY_ATTRIBUTES = Ptr SECURITY_ATTRIBUTES Source #
data SECURITY_ATTRIBUTES Source #
Instances
Show SECURITY_ATTRIBUTES Source # | |
Defined in System.Win32.File.Internal showsPrec :: Int -> SECURITY_ATTRIBUTES -> ShowS show :: SECURITY_ATTRIBUTES -> String showList :: [SECURITY_ATTRIBUTES] -> ShowS | |
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 () |
data GET_FILEEX_INFO_LEVELS Source #
Instances
Eq GET_FILEEX_INFO_LEVELS Source # | |
Defined in System.Win32.File.Internal (==) :: GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS -> Bool (/=) :: GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS -> Bool | |
Ord GET_FILEEX_INFO_LEVELS Source # | |
Defined in System.Win32.File.Internal compare :: GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS -> Ordering (<) :: GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS -> Bool (<=) :: GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS -> Bool (>) :: GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS -> Bool (>=) :: GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS -> Bool max :: GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS min :: GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS -> GET_FILEEX_INFO_LEVELS |
type FileNotificationFlag = DWORD Source #
type BinaryType = DWORD Source #
type DefineDosDeviceFlags = DWORD Source #
type FilePtrDirection = DWORD Source #
type MoveFileFlag = DWORD Source #
type FileAttributeOrFlag = UINT Source #
type CreateMode = UINT Source #
type AccessMode = UINT Source #
setHandleCount :: UINT -> IO UINT Source #
setFileApisToANSI :: IO () Source #
setFileApisToOEM :: IO () Source #
areFileApisANSI :: IO Bool Source #
getFileType :: HANDLE -> IO FileType Source #
dELETE :: AccessMode Source #
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
failIfWithRetry_ :: (a -> Bool) -> String -> IO a -> IO () Source #
failIfFalseWithRetry_ :: String -> IO Bool -> 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.
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 #
findNextFile :: HANDLE -> FindData -> IO Bool Source #
getLogicalDrives :: IO DWORD 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.