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 |
Language | Haskell2010 |
A collection of FFI declarations for interfacing with Win32.
Synopsis
- type AccessMode = UINT
- 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
- type ShareMode = UINT
- fILE_SHARE_NONE :: ShareMode
- fILE_SHARE_READ :: ShareMode
- fILE_SHARE_WRITE :: ShareMode
- fILE_SHARE_DELETE :: ShareMode
- type CreateMode = UINT
- cREATE_NEW :: CreateMode
- cREATE_ALWAYS :: CreateMode
- oPEN_EXISTING :: CreateMode
- oPEN_ALWAYS :: CreateMode
- tRUNCATE_EXISTING :: CreateMode
- type FileAttributeOrFlag = UINT
- 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
- sECURITY_ANONYMOUS :: FileAttributeOrFlag
- fILE_FLAG_OVERLAPPED :: FileAttributeOrFlag
- sECURITY_IDENTIFICATION :: FileAttributeOrFlag
- fILE_FLAG_NO_BUFFERING :: FileAttributeOrFlag
- sECURITY_IMPERSONATION :: FileAttributeOrFlag
- fILE_FLAG_RANDOM_ACCESS :: FileAttributeOrFlag
- sECURITY_DELEGATION :: FileAttributeOrFlag
- fILE_FLAG_SEQUENTIAL_SCAN :: FileAttributeOrFlag
- sECURITY_CONTEXT_TRACKING :: FileAttributeOrFlag
- fILE_FLAG_DELETE_ON_CLOSE :: FileAttributeOrFlag
- sECURITY_EFFECTIVE_ONLY :: FileAttributeOrFlag
- fILE_FLAG_BACKUP_SEMANTICS :: FileAttributeOrFlag
- sECURITY_SQOS_PRESENT :: FileAttributeOrFlag
- fILE_FLAG_POSIX_SEMANTICS :: FileAttributeOrFlag
- type MoveFileFlag = DWORD
- sECURITY_VALID_SQOS_FLAGS :: FileAttributeOrFlag
- mOVEFILE_REPLACE_EXISTING :: MoveFileFlag
- mOVEFILE_COPY_ALLOWED :: MoveFileFlag
- mOVEFILE_DELAY_UNTIL_REBOOT :: MoveFileFlag
- type FilePtrDirection = DWORD
- fILE_BEGIN :: FilePtrDirection
- fILE_CURRENT :: FilePtrDirection
- fILE_END :: FilePtrDirection
- type DriveType = UINT
- dRIVE_UNKNOWN :: DriveType
- dRIVE_NO_ROOT_DIR :: DriveType
- dRIVE_REMOVABLE :: DriveType
- dRIVE_FIXED :: DriveType
- dRIVE_REMOTE :: DriveType
- dRIVE_CDROM :: DriveType
- type DefineDosDeviceFlags = DWORD
- dRIVE_RAMDISK :: DriveType
- dDD_RAW_TARGET_PATH :: DefineDosDeviceFlags
- dDD_REMOVE_DEFINITION :: DefineDosDeviceFlags
- dDD_EXACT_MATCH_ON_REMOVE :: DefineDosDeviceFlags
- type BinaryType = DWORD
- sCS_32BIT_BINARY :: BinaryType
- sCS_DOS_BINARY :: BinaryType
- sCS_WOW_BINARY :: BinaryType
- sCS_PIF_BINARY :: BinaryType
- sCS_POSIX_BINARY :: BinaryType
- sCS_OS216_BINARY :: BinaryType
- type FileNotificationFlag = DWORD
- 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
- type FileType = DWORD
- fILE_TYPE_UNKNOWN :: FileType
- fILE_TYPE_DISK :: FileType
- fILE_TYPE_CHAR :: FileType
- fILE_TYPE_PIPE :: FileType
- fILE_TYPE_REMOTE :: FileType
- type LockMode = DWORD
- lOCKFILE_EXCLUSIVE_LOCK :: LockMode
- lOCKFILE_FAIL_IMMEDIATELY :: LockMode
- newtype GET_FILEEX_INFO_LEVELS = GET_FILEEX_INFO_LEVELS Word32
- getFileExInfoStandard :: GET_FILEEX_INFO_LEVELS
- getFileExMaxInfoLevel :: GET_FILEEX_INFO_LEVELS
- type LPSECURITY_ATTRIBUTES = Ptr ()
- type MbLPSECURITY_ATTRIBUTES = Maybe LPSECURITY_ATTRIBUTES
- data BY_HANDLE_FILE_INFORMATION = BY_HANDLE_FILE_INFORMATION {}
- data WIN32_FILE_ATTRIBUTE_DATA = WIN32_FILE_ATTRIBUTE_DATA {}
- failIfWithRetry :: (a -> Bool) -> String -> IO a -> IO a
- failIfWithRetry_ :: (a -> Bool) -> String -> IO a -> IO ()
- failIfFalseWithRetry_ :: String -> IO Bool -> IO ()
- deleteFile :: String -> IO ()
- c_DeleteFile :: LPCTSTR -> IO Bool
- copyFile :: String -> String -> Bool -> IO ()
- c_CopyFile :: LPCTSTR -> LPCTSTR -> Bool -> IO Bool
- moveFile :: String -> String -> IO ()
- c_MoveFile :: LPCTSTR -> LPCTSTR -> IO Bool
- moveFileEx :: String -> Maybe String -> MoveFileFlag -> IO ()
- c_MoveFileEx :: LPCTSTR -> LPCTSTR -> MoveFileFlag -> IO Bool
- setCurrentDirectory :: String -> IO ()
- c_SetCurrentDirectory :: LPCTSTR -> IO Bool
- createDirectory :: String -> Maybe LPSECURITY_ATTRIBUTES -> IO ()
- c_CreateDirectory :: LPCTSTR -> LPSECURITY_ATTRIBUTES -> IO Bool
- createDirectoryEx :: String -> String -> Maybe LPSECURITY_ATTRIBUTES -> IO ()
- c_CreateDirectoryEx :: LPCTSTR -> LPCTSTR -> LPSECURITY_ATTRIBUTES -> IO Bool
- removeDirectory :: String -> IO ()
- c_RemoveDirectory :: LPCTSTR -> IO Bool
- getBinaryType :: String -> IO BinaryType
- c_GetBinaryType :: LPCTSTR -> Ptr DWORD -> IO Bool
- createFile :: String -> AccessMode -> ShareMode -> Maybe LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> Maybe HANDLE -> IO HANDLE
- c_CreateFile :: LPCTSTR -> AccessMode -> ShareMode -> LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> HANDLE -> IO HANDLE
- closeHandle :: HANDLE -> IO ()
- c_CloseHandle :: HANDLE -> IO Bool
- c_CloseHandleFinaliser :: FunPtr (Ptr a -> IO ())
- getFileType :: HANDLE -> IO FileType
- flushFileBuffers :: HANDLE -> IO ()
- c_FlushFileBuffers :: HANDLE -> IO Bool
- setEndOfFile :: HANDLE -> IO ()
- c_SetEndOfFile :: HANDLE -> IO Bool
- setFileAttributes :: String -> FileAttributeOrFlag -> IO ()
- c_SetFileAttributes :: LPCTSTR -> FileAttributeOrFlag -> IO Bool
- getFileAttributes :: String -> IO FileAttributeOrFlag
- c_GetFileAttributes :: LPCTSTR -> IO FileAttributeOrFlag
- getFileAttributesExStandard :: String -> IO WIN32_FILE_ATTRIBUTE_DATA
- c_GetFileAttributesEx :: LPCTSTR -> GET_FILEEX_INFO_LEVELS -> Ptr a -> IO BOOL
- getFileInformationByHandle :: HANDLE -> IO BY_HANDLE_FILE_INFORMATION
- c_GetFileInformationByHandle :: HANDLE -> Ptr BY_HANDLE_FILE_INFORMATION -> IO BOOL
- data OVERLAPPED = OVERLAPPED {}
- type LPOVERLAPPED = Ptr OVERLAPPED
- type MbLPOVERLAPPED = Maybe LPOVERLAPPED
- win32_ReadFile :: HANDLE -> Ptr a -> DWORD -> Maybe LPOVERLAPPED -> IO DWORD
- c_ReadFile :: HANDLE -> Ptr a -> DWORD -> Ptr DWORD -> LPOVERLAPPED -> IO Bool
- win32_WriteFile :: HANDLE -> Ptr a -> DWORD -> Maybe LPOVERLAPPED -> IO DWORD
- c_WriteFile :: HANDLE -> Ptr a -> DWORD -> Ptr DWORD -> LPOVERLAPPED -> IO Bool
- setFilePointerEx :: HANDLE -> LARGE_INTEGER -> FilePtrDirection -> IO LARGE_INTEGER
- c_SetFilePointerEx :: HANDLE -> LARGE_INTEGER -> Ptr LARGE_INTEGER -> FilePtrDirection -> IO Bool
- findFirstChangeNotification :: String -> Bool -> FileNotificationFlag -> IO HANDLE
- c_FindFirstChangeNotification :: LPCTSTR -> Bool -> FileNotificationFlag -> IO HANDLE
- findNextChangeNotification :: HANDLE -> IO ()
- c_FindNextChangeNotification :: HANDLE -> IO Bool
- findCloseChangeNotification :: HANDLE -> IO ()
- c_FindCloseChangeNotification :: HANDLE -> IO Bool
- type WIN32_FIND_DATA = ()
- newtype FindData = FindData (ForeignPtr WIN32_FIND_DATA)
- getFindDataFileName :: FindData -> IO FilePath
- findFirstFile :: String -> IO (HANDLE, FindData)
- c_FindFirstFile :: LPCTSTR -> Ptr WIN32_FIND_DATA -> IO HANDLE
- findNextFile :: HANDLE -> FindData -> IO Bool
- c_FindNextFile :: HANDLE -> Ptr WIN32_FIND_DATA -> IO BOOL
- findClose :: HANDLE -> IO ()
- c_FindClose :: HANDLE -> IO BOOL
- defineDosDevice :: DefineDosDeviceFlags -> String -> Maybe String -> IO ()
- c_DefineDosDevice :: DefineDosDeviceFlags -> LPCTSTR -> LPCTSTR -> IO Bool
- areFileApisANSI :: IO Bool
- setFileApisToOEM :: IO ()
- setFileApisToANSI :: IO ()
- setHandleCount :: UINT -> IO UINT
- getLogicalDrives :: IO DWORD
- c_GetLogicalDrives :: IO DWORD
- getDiskFreeSpace :: Maybe String -> IO (DWORD, DWORD, DWORD, DWORD)
- c_GetDiskFreeSpace :: LPCTSTR -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> IO Bool
- setVolumeLabel :: Maybe String -> Maybe String -> IO ()
- c_SetVolumeLabel :: LPCTSTR -> LPCTSTR -> IO Bool
- lockFile :: HANDLE -> LockMode -> DWORD64 -> DWORD64 -> IO BOOL
- c_LockFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> DWORD -> LPOVERLAPPED -> IO BOOL
- unlockFile :: HANDLE -> DWORD64 -> DWORD64 -> IO BOOL
- c_UnlockFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> LPOVERLAPPED -> IO BOOL
Documentation
type AccessMode = UINT Source #
dELETE :: AccessMode Source #
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 #
newtype GET_FILEEX_INFO_LEVELS Source #
Instances
type LPSECURITY_ATTRIBUTES = Ptr () Source #
data BY_HANDLE_FILE_INFORMATION Source #
Instances
Show BY_HANDLE_FILE_INFORMATION Source # | |
Defined in System.Win32.File | |
Storable BY_HANDLE_FILE_INFORMATION Source # | |
Defined in System.Win32.File 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 # |
data WIN32_FILE_ATTRIBUTE_DATA Source #
Instances
Show WIN32_FILE_ATTRIBUTE_DATA Source # | |
Defined in System.Win32.File | |
Storable WIN32_FILE_ATTRIBUTE_DATA Source # | |
Defined in System.Win32.File 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 # |
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
deleteFile :: String -> IO () Source #
moveFileEx :: String -> Maybe String -> MoveFileFlag -> IO () Source #
c_MoveFileEx :: LPCTSTR -> LPCTSTR -> MoveFileFlag -> IO Bool Source #
setCurrentDirectory :: String -> IO () Source #
createDirectory :: String -> Maybe LPSECURITY_ATTRIBUTES -> IO () Source #
c_CreateDirectory :: LPCTSTR -> LPSECURITY_ATTRIBUTES -> IO Bool Source #
createDirectoryEx :: String -> String -> Maybe LPSECURITY_ATTRIBUTES -> IO () Source #
c_CreateDirectoryEx :: LPCTSTR -> LPCTSTR -> LPSECURITY_ATTRIBUTES -> IO Bool Source #
removeDirectory :: String -> IO () Source #
getBinaryType :: String -> IO BinaryType Source #
createFile :: String -> AccessMode -> ShareMode -> Maybe LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> Maybe HANDLE -> IO HANDLE Source #
c_CreateFile :: LPCTSTR -> AccessMode -> ShareMode -> LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> HANDLE -> IO HANDLE Source #
closeHandle :: HANDLE -> IO () Source #
flushFileBuffers :: HANDLE -> IO () Source #
setEndOfFile :: HANDLE -> IO () Source #
setFileAttributes :: String -> FileAttributeOrFlag -> IO () Source #
c_SetFileAttributes :: LPCTSTR -> FileAttributeOrFlag -> IO Bool Source #
c_GetFileAttributesEx :: LPCTSTR -> GET_FILEEX_INFO_LEVELS -> Ptr a -> IO BOOL Source #
data OVERLAPPED Source #
OVERLAPPED | |
|
Instances
Show OVERLAPPED Source # | |
Defined in System.Win32.File | |
Storable OVERLAPPED Source # | |
Defined in System.Win32.File 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 # |
type LPOVERLAPPED = Ptr OVERLAPPED Source #
type MbLPOVERLAPPED = Maybe LPOVERLAPPED 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 #
c_SetFilePointerEx :: HANDLE -> LARGE_INTEGER -> Ptr LARGE_INTEGER -> FilePtrDirection -> IO Bool Source #
findFirstChangeNotification :: String -> Bool -> FileNotificationFlag -> IO HANDLE Source #
c_FindFirstChangeNotification :: LPCTSTR -> Bool -> FileNotificationFlag -> IO HANDLE Source #
findNextChangeNotification :: HANDLE -> IO () Source #
findCloseChangeNotification :: HANDLE -> IO () Source #
type WIN32_FIND_DATA = () Source #
c_FindFirstFile :: LPCTSTR -> Ptr WIN32_FIND_DATA -> IO HANDLE Source #
c_FindNextFile :: HANDLE -> Ptr WIN32_FIND_DATA -> IO BOOL Source #
defineDosDevice :: DefineDosDeviceFlags -> String -> Maybe String -> IO () Source #
c_DefineDosDevice :: DefineDosDeviceFlags -> LPCTSTR -> LPCTSTR -> IO Bool Source #
areFileApisANSI :: IO Bool Source #
setFileApisToOEM :: IO () Source #
setFileApisToANSI :: IO () Source #
c_GetDiskFreeSpace :: LPCTSTR -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> IO Bool 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.
:: 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.
c_UnlockFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> LPOVERLAPPED -> IO BOOL Source #