Win32 2.11.1.0 → 2.12.0.0
raw patch · 20 files changed
+769/−73 lines, 20 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- System.Win32.Automation.Input: c_SendInput :: UINT -> LPINPUT -> Int -> IO UINT
- System.Win32.Console.Title: c_GetConsoleTitle :: LPTSTR -> DWORD -> IO DWORD
- System.Win32.Console.Title: c_SetConsoleTitle :: LPCTSTR -> IO BOOL
- System.Win32.DLL: c_DisableThreadLibraryCalls :: HMODULE -> IO Bool
- System.Win32.DLL: c_FreeLibrary :: HMODULE -> IO Bool
- System.Win32.DLL: c_FreeLibraryFinaliser :: FunPtr (HMODULE -> IO ())
- System.Win32.DLL: c_GetModuleFileName :: HMODULE -> LPTSTR -> Int -> IO Bool
- System.Win32.DLL: c_GetModuleHandle :: LPCTSTR -> IO HMODULE
- System.Win32.DLL: c_GetProcAddress :: HMODULE -> LPCSTR -> IO Addr
- System.Win32.DLL: c_LoadLibrary :: LPCTSTR -> IO HINSTANCE
- System.Win32.DLL: c_LoadLibraryEx :: LPCTSTR -> HANDLE -> LoadLibraryFlags -> IO HINSTANCE
- System.Win32.DLL: c_SetDllDirectory :: LPTSTR -> IO BOOL
- System.Win32.DebugApi: c_ContinueDebugEvent :: DWORD -> DWORD -> DWORD -> IO BOOL
- System.Win32.DebugApi: c_DebugActiveProcess :: DWORD -> IO Bool
- System.Win32.DebugApi: c_GetThreadContext :: THANDLE -> Ptr () -> IO BOOL
- System.Win32.DebugApi: c_OutputDebugString :: LPTSTR -> IO ()
- System.Win32.DebugApi: c_ReadProcessMemory :: PHANDLE -> Ptr () -> Ptr Word8 -> DWORD -> Ptr DWORD -> IO BOOL
- System.Win32.DebugApi: c_ResumeThread :: THANDLE -> IO DWORD
- System.Win32.DebugApi: c_SetThreadContext :: THANDLE -> Ptr () -> IO BOOL
- System.Win32.DebugApi: c_SuspendThread :: THANDLE -> IO DWORD
- System.Win32.DebugApi: c_WaitForDebugEvent :: Ptr () -> DWORD -> IO BOOL
- System.Win32.DebugApi: c_WriteProcessMemory :: PHANDLE -> Ptr () -> Ptr Word8 -> DWORD -> Ptr DWORD -> IO BOOL
- System.Win32.DebugApi: peekDebugEvent :: Ptr a -> IO DebugEvent
- System.Win32.Event: c_CreateEvent :: LPSECURITY_ATTRIBUTES -> BOOL -> BOOL -> LPCTSTR -> IO HANDLE
- System.Win32.Event: c_DuplicateHandle :: HANDLE -> HANDLE -> HANDLE -> Ptr HANDLE -> DWORD -> BOOL -> DWORD -> IO BOOL
- System.Win32.Event: c_OpenEvent :: DWORD -> BOOL -> LPCTSTR -> IO HANDLE
- System.Win32.Event: c_PulseEvent :: HANDLE -> IO Bool
- System.Win32.Event: c_ResetEvent :: HANDLE -> IO Bool
- System.Win32.Event: c_SetEvent :: HANDLE -> IO Bool
- System.Win32.Event: c_SignalObjectAndWait :: HANDLE -> HANDLE -> DWORD -> BOOL -> IO DWORD
- System.Win32.Event: c_WaitForMultipleObjects :: DWORD -> Ptr HANDLE -> BOOL -> DWORD -> IO DWORD
- System.Win32.Event: c_WaitForMultipleObjectsEx :: DWORD -> Ptr HANDLE -> BOOL -> DWORD -> BOOL -> IO DWORD
- System.Win32.Event: c_WaitForSingleObject :: HANDLE -> DWORD -> IO DWORD
- System.Win32.Event: c_WaitForSingleObjectEx :: HANDLE -> DWORD -> BOOL -> IO DWORD
- System.Win32.File: FindData :: ForeignPtr WIN32_FIND_DATA -> FindData
- System.Win32.File: GET_FILEEX_INFO_LEVELS :: Word32 -> GET_FILEEX_INFO_LEVELS
- System.Win32.File: c_CloseHandle :: HANDLE -> IO Bool
- System.Win32.File: c_CloseHandleFinaliser :: FunPtr (Ptr a -> IO ())
- System.Win32.File: c_CopyFile :: LPCTSTR -> LPCTSTR -> Bool -> IO Bool
- System.Win32.File: c_CreateDirectory :: LPCTSTR -> LPSECURITY_ATTRIBUTES -> IO Bool
- System.Win32.File: c_CreateDirectoryEx :: LPCTSTR -> LPCTSTR -> LPSECURITY_ATTRIBUTES -> IO Bool
- System.Win32.File: c_CreateFile :: LPCTSTR -> AccessMode -> ShareMode -> LPSECURITY_ATTRIBUTES -> CreateMode -> FileAttributeOrFlag -> HANDLE -> IO HANDLE
- System.Win32.File: c_DefineDosDevice :: DefineDosDeviceFlags -> LPCTSTR -> LPCTSTR -> IO Bool
- System.Win32.File: c_DeleteFile :: LPCTSTR -> IO Bool
- System.Win32.File: c_FindClose :: HANDLE -> IO BOOL
- System.Win32.File: c_FindCloseChangeNotification :: HANDLE -> IO Bool
- System.Win32.File: c_FindFirstChangeNotification :: LPCTSTR -> Bool -> FileNotificationFlag -> IO HANDLE
- System.Win32.File: c_FindFirstFile :: LPCTSTR -> Ptr WIN32_FIND_DATA -> IO HANDLE
- System.Win32.File: c_FindNextChangeNotification :: HANDLE -> IO Bool
- System.Win32.File: c_FindNextFile :: HANDLE -> Ptr WIN32_FIND_DATA -> IO BOOL
- System.Win32.File: c_FlushFileBuffers :: HANDLE -> IO Bool
- System.Win32.File: c_GetBinaryType :: LPCTSTR -> Ptr DWORD -> IO Bool
- System.Win32.File: c_GetDiskFreeSpace :: LPCTSTR -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> IO Bool
- System.Win32.File: c_GetFileAttributes :: LPCTSTR -> IO FileAttributeOrFlag
- System.Win32.File: c_GetFileAttributesEx :: LPCTSTR -> GET_FILEEX_INFO_LEVELS -> Ptr a -> IO BOOL
- System.Win32.File: c_GetFileInformationByHandle :: HANDLE -> Ptr BY_HANDLE_FILE_INFORMATION -> IO BOOL
- System.Win32.File: c_GetLogicalDrives :: IO DWORD
- System.Win32.File: c_LockFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> DWORD -> LPOVERLAPPED -> IO BOOL
- System.Win32.File: c_MoveFile :: LPCTSTR -> LPCTSTR -> IO Bool
- System.Win32.File: c_MoveFileEx :: LPCTSTR -> LPCTSTR -> MoveFileFlag -> IO Bool
- System.Win32.File: c_ReadFile :: HANDLE -> Ptr a -> DWORD -> Ptr DWORD -> LPOVERLAPPED -> IO Bool
- System.Win32.File: c_RemoveDirectory :: LPCTSTR -> IO Bool
- System.Win32.File: c_SetCurrentDirectory :: LPCTSTR -> IO Bool
- System.Win32.File: c_SetEndOfFile :: HANDLE -> IO Bool
- System.Win32.File: c_SetFileAttributes :: LPCTSTR -> FileAttributeOrFlag -> IO Bool
- System.Win32.File: c_SetFilePointerEx :: HANDLE -> LARGE_INTEGER -> Ptr LARGE_INTEGER -> FilePtrDirection -> IO Bool
- System.Win32.File: c_SetVolumeLabel :: LPCTSTR -> LPCTSTR -> IO Bool
- System.Win32.File: c_UnlockFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> LPOVERLAPPED -> IO BOOL
- System.Win32.File: c_WriteFile :: HANDLE -> Ptr a -> DWORD -> Ptr DWORD -> LPOVERLAPPED -> IO Bool
- System.Win32.File: newtype FindData
- System.Win32.File: newtype GET_FILEEX_INFO_LEVELS
- System.Win32.File: type WIN32_FIND_DATA = ()
- System.Win32.FileMapping: c_CreateFileMapping :: HANDLE -> Ptr () -> DWORD -> DWORD -> DWORD -> LPCTSTR -> IO HANDLE
- System.Win32.FileMapping: c_MapViewOfFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> SIZE_T -> Ptr a -> IO (Ptr b)
- System.Win32.FileMapping: c_OpenFileMapping :: DWORD -> BOOL -> LPCTSTR -> IO HANDLE
- System.Win32.FileMapping: c_UnmapViewOfFile :: Ptr a -> IO BOOL
- System.Win32.FileMapping: c_UnmapViewOfFileFinaliser :: FunPtr (Ptr a -> IO ())
- System.Win32.HardLink: c_CreateHardLink :: LPCTSTR -> LPCTSTR -> LPSECURITY_ATTRIBUTES -> IO BOOL
- System.Win32.Info: c_GetFullPathName :: LPCTSTR -> DWORD -> LPTSTR -> Ptr LPTSTR -> IO DWORD
- System.Win32.Info: c_GetLongPathName :: LPCTSTR -> LPTSTR -> DWORD -> IO DWORD
- System.Win32.Info: c_GetShortPathName :: LPCTSTR -> LPTSTR -> DWORD -> IO DWORD
- System.Win32.Info: c_GetSystemInfo :: Ptr SYSTEM_INFO -> IO ()
- System.Win32.Info: c_GetUserName :: LPTSTR -> LPDWORD -> IO Bool
- System.Win32.Info: c_SearchPath :: LPCTSTR -> LPCTSTR -> LPCTSTR -> DWORD -> LPTSTR -> Ptr LPTSTR -> IO DWORD
- System.Win32.Info: c_getCurrentDirectory :: DWORD -> LPTSTR -> IO UINT
- System.Win32.Info: c_getSystemDirectory :: LPTSTR -> UINT -> IO UINT
- System.Win32.Info: c_getTempPath :: DWORD -> LPTSTR -> IO UINT
- System.Win32.Info: c_getWindowsDirectory :: LPTSTR -> UINT -> IO UINT
- System.Win32.Mem: c_GlobalAlloc :: GlobalAllocFlags -> DWORD -> IO HGLOBAL
- System.Win32.Mem: c_GlobalFlags :: HGLOBAL -> IO GlobalAllocFlags
- System.Win32.Mem: c_GlobalFree :: HGLOBAL -> IO HGLOBAL
- System.Win32.Mem: c_GlobalHandle :: Addr -> IO HGLOBAL
- System.Win32.Mem: c_GlobalLock :: HGLOBAL -> IO Addr
- System.Win32.Mem: c_GlobalReAlloc :: HGLOBAL -> DWORD -> GlobalAllocFlags -> IO HGLOBAL
- System.Win32.Mem: c_GlobalSize :: HGLOBAL -> IO DWORD
- System.Win32.Mem: c_GlobalUnlock :: HGLOBAL -> IO Bool
- System.Win32.Mem: c_HeapAlloc :: HANDLE -> HeapAllocFlags -> DWORD -> IO Addr
- System.Win32.Mem: c_HeapCompact :: HANDLE -> HeapAllocFlags -> IO UINT
- System.Win32.Mem: c_HeapCreate :: HeapAllocFlags -> DWORD -> DWORD -> IO HANDLE
- System.Win32.Mem: c_HeapDestroy :: HANDLE -> IO Bool
- System.Win32.Mem: c_HeapFree :: HANDLE -> HeapAllocFlags -> Addr -> IO Bool
- System.Win32.Mem: c_HeapLock :: HANDLE -> IO Bool
- System.Win32.Mem: c_HeapReAlloc :: HANDLE -> HeapAllocFlags -> Addr -> DWORD -> IO Addr
- System.Win32.Mem: c_HeapSize :: HANDLE -> HeapAllocFlags -> Addr -> IO DWORD
- System.Win32.Mem: c_HeapUnlock :: HANDLE -> IO Bool
- System.Win32.Mem: c_VirtualAlloc :: Addr -> DWORD -> DWORD -> DWORD -> IO Addr
- System.Win32.Mem: c_VirtualAllocEx :: HANDLE -> Addr -> DWORD -> DWORD -> DWORD -> IO Addr
- System.Win32.Mem: c_VirtualFree :: Addr -> DWORD -> FreeFlags -> IO Bool
- System.Win32.Mem: c_VirtualFreeEx :: HANDLE -> Addr -> DWORD -> FreeFlags -> IO Bool
- System.Win32.Mem: c_VirtualLock :: Addr -> DWORD -> IO Bool
- System.Win32.Mem: c_VirtualProtect :: Addr -> DWORD -> DWORD -> Ptr DWORD -> IO Bool
- System.Win32.Mem: c_VirtualProtectEx :: HANDLE -> Addr -> DWORD -> DWORD -> Ptr DWORD -> IO Bool
- System.Win32.Mem: c_VirtualQueryEx :: HANDLE -> LPVOID -> Ptr MEMORY_BASIC_INFORMATION -> SIZE_T -> IO DWORD
- System.Win32.Mem: c_VirtualUnlock :: Addr -> DWORD -> IO Bool
- System.Win32.Process: c_CreateToolhelp32Snapshot :: Th32SnapFlags -> ProcessId -> IO Th32SnapHandle
- System.Win32.Process: c_GetCurrentProcess :: IO ProcessHandle
- System.Win32.Process: c_GetCurrentProcessId :: IO ProcessId
- System.Win32.Process: c_GetProcessId :: ProcessHandle -> IO ProcessId
- System.Win32.Process: c_Module32First :: Th32SnapHandle -> Ptr ModuleEntry32 -> IO BOOL
- System.Win32.Process: c_Module32Next :: Th32SnapHandle -> Ptr ModuleEntry32 -> IO BOOL
- System.Win32.Process: c_OpenProcess :: ProcessAccessRights -> BOOL -> ProcessId -> IO ProcessHandle
- System.Win32.Process: c_Process32First :: Th32SnapHandle -> Ptr ProcessEntry32 -> IO BOOL
- System.Win32.Process: c_Process32Next :: Th32SnapHandle -> Ptr ProcessEntry32 -> IO BOOL
- System.Win32.Process: c_TerminateProcess :: ProcessHandle -> CUInt -> IO Bool
- System.Win32.Process: peekModuleEntry32 :: Ptr ModuleEntry32 -> IO ModuleEntry32
- System.Win32.Process: peekProcessEntry32 :: Ptr ProcessEntry32 -> IO ProcessEntry32
- System.Win32.Registry: c_RegCloseKey :: PKEY -> IO ErrCode
- System.Win32.Registry: c_RegConnectRegistry :: LPCTSTR -> PKEY -> Ptr PKEY -> IO ErrCode
- System.Win32.Registry: c_RegCreateKey :: PKEY -> LPCTSTR -> Ptr PKEY -> IO ErrCode
- System.Win32.Registry: c_RegCreateKeyEx :: PKEY -> LPCTSTR -> DWORD -> LPCTSTR -> RegCreateOptions -> REGSAM -> LPSECURITY_ATTRIBUTES -> Ptr PKEY -> Ptr DWORD -> IO ErrCode
- System.Win32.Registry: c_RegDeleteKey :: PKEY -> LPCTSTR -> IO ErrCode
- System.Win32.Registry: c_RegDeleteValue :: PKEY -> LPCTSTR -> IO ErrCode
- System.Win32.Registry: c_RegEnumKey :: PKEY -> DWORD -> LPTSTR -> DWORD -> IO ErrCode
- System.Win32.Registry: c_RegEnumValue :: PKEY -> DWORD -> LPTSTR -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> LPBYTE -> Ptr DWORD -> IO ErrCode
- System.Win32.Registry: c_RegFlushKey :: PKEY -> IO ErrCode
- System.Win32.Registry: c_RegGetValue :: PKEY -> LPCTSTR -> LPCTSTR -> DWORD -> LPDWORD -> LPVOID -> LPDWORD -> IO ErrCode
- System.Win32.Registry: c_RegLoadKey :: PKEY -> LPCTSTR -> LPCTSTR -> IO ErrCode
- System.Win32.Registry: c_RegNotifyChangeKeyValue :: PKEY -> Bool -> RegNotifyOptions -> HANDLE -> Bool -> IO ErrCode
- System.Win32.Registry: c_RegOpenKey :: PKEY -> LPCTSTR -> Ptr PKEY -> IO ErrCode
- System.Win32.Registry: c_RegOpenKeyEx :: PKEY -> LPCTSTR -> DWORD -> REGSAM -> Ptr PKEY -> IO ErrCode
- System.Win32.Registry: c_RegQueryInfoKey :: PKEY -> LPTSTR -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> Ptr DWORD -> Ptr FILETIME -> IO ErrCode
- System.Win32.Registry: c_RegQueryValue :: PKEY -> LPCTSTR -> LPTSTR -> Ptr LONG -> IO ErrCode
- System.Win32.Registry: c_RegQueryValueEx :: PKEY -> LPCTSTR -> Ptr DWORD -> Ptr DWORD -> LPBYTE -> Ptr DWORD -> IO ErrCode
- System.Win32.Registry: c_RegReplaceKey :: PKEY -> LPCTSTR -> LPCTSTR -> LPCTSTR -> IO ErrCode
- System.Win32.Registry: c_RegRestoreKey :: PKEY -> LPCTSTR -> RegRestoreFlags -> IO ErrCode
- System.Win32.Registry: c_RegSaveKey :: PKEY -> LPCTSTR -> LPSECURITY_ATTRIBUTES -> IO ErrCode
- System.Win32.Registry: c_RegSetValue :: PKEY -> LPCTSTR -> DWORD -> LPCTSTR -> Int -> IO ErrCode
- System.Win32.Registry: c_RegSetValueEx :: PKEY -> LPCTSTR -> DWORD -> RegValueType -> LPTSTR -> Int -> IO ErrCode
- System.Win32.Registry: c_RegUnLoadKey :: PKEY -> LPCTSTR -> IO ErrCode
- System.Win32.Registry: eRROR_NO_MORE_ITEMS :: ErrCode
- System.Win32.Registry: mallocWideChars :: Int -> IO (Ptr a)
- System.Win32.SymbolicLink: c_CreateSymbolicLink :: LPTSTR -> LPTSTR -> SymbolicLinkFlags -> IO BOOL
- System.Win32.Thread: c_GetCurrentThreadId :: IO TID
- System.Win32.Thread: c_GetThreadId :: THANDLE -> IO TID
- System.Win32.Thread: c_ResumeThread :: THANDLE -> IO DWORD
- System.Win32.Thread: c_SuspendThread :: THANDLE -> IO DWORD
- System.Win32.Time: LASTINPUTINFO :: DWORD -> LASTINPUTINFO
- System.Win32.Time: c_FileTimeToLocalFileTime :: Ptr FILETIME -> Ptr FILETIME -> IO BOOL
- System.Win32.Time: c_FileTimeToSystemTime :: Ptr FILETIME -> Ptr SYSTEMTIME -> IO BOOL
- System.Win32.Time: c_GetFileTime :: HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO BOOL
- System.Win32.Time: c_GetLastInputInfo :: Ptr LASTINPUTINFO -> IO Bool
- System.Win32.Time: c_GetLocalTime :: Ptr SYSTEMTIME -> IO ()
- System.Win32.Time: c_GetSystemTime :: Ptr SYSTEMTIME -> IO ()
- System.Win32.Time: c_GetSystemTimeAdjustment :: Ptr DWORD -> Ptr DWORD -> Ptr BOOL -> IO BOOL
- System.Win32.Time: c_GetSystemTimeAsFileTime :: Ptr FILETIME -> IO ()
- System.Win32.Time: c_GetTimeFormat :: LCID -> GetTimeFormatFlags -> Ptr SYSTEMTIME -> LPCTSTR -> LPTSTR -> CInt -> IO CInt
- System.Win32.Time: c_GetTimeFormatEx :: LPCWSTR -> GetTimeFormatFlags -> Ptr SYSTEMTIME -> LPCWSTR -> LPWSTR -> CInt -> IO CInt
- System.Win32.Time: c_GetTimeZoneInformation :: Ptr TIME_ZONE_INFORMATION -> IO DWORD
- System.Win32.Time: c_LocalFileTimeToFileTime :: Ptr FILETIME -> Ptr FILETIME -> IO BOOL
- System.Win32.Time: c_QueryPerformanceCounter :: Ptr LARGE_INTEGER -> IO BOOL
- System.Win32.Time: c_QueryPerformanceFrequency :: Ptr LARGE_INTEGER -> IO BOOL
- System.Win32.Time: c_SetFileTime :: HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO BOOL
- System.Win32.Time: c_SetLocalTime :: Ptr SYSTEMTIME -> IO BOOL
- System.Win32.Time: c_SetSystemTime :: Ptr SYSTEMTIME -> IO BOOL
- System.Win32.Time: c_SetSystemTimeAdjustment :: DWORD -> BOOL -> IO BOOL
- System.Win32.Time: c_SystemTimeToFileTime :: Ptr SYSTEMTIME -> Ptr FILETIME -> IO BOOL
- System.Win32.Time: data LASTINPUTINFO
+ System.Win32.Event: type AccessMode = UINT
+ System.Win32.File: data FindData
+ System.Win32.File: data GET_FILEEX_INFO_LEVELS
+ System.Win32.FileMapping: fILE_SHARE_WRITE :: ShareMode
+ System.Win32.Registry: type HKEY = ForeignHANDLE
+ System.Win32.SimpleMAPI: c_FreeLibraryFinaliser :: FunPtr (HMODULE -> IO ())
+ System.Win32.Time: invalidFileTime :: FILETIME
- System.Win32.Time: setFileTime :: HANDLE -> FILETIME -> FILETIME -> FILETIME -> IO ()
+ System.Win32.Time: setFileTime :: HANDLE -> Maybe FILETIME -> Maybe FILETIME -> Maybe FILETIME -> IO ()
Files
- System/Win32/Automation/Input.hsc +10/−1
- System/Win32/Console/HWND.hs +1/−1
- System/Win32/Console/Title.hsc +4/−1
- System/Win32/DLL.hsc +14/−5
- System/Win32/DebugApi.hsc +53/−1
- System/Win32/Event.hsc +31/−1
- System/Win32/File.hsc +220/−5
- System/Win32/FileMapping.hsc +27/−1
- System/Win32/HardLink.hs +3/−1
- System/Win32/Info.hsc +112/−1
- System/Win32/Info/Version.hsc +1/−0
- System/Win32/Mem.hsc +84/−1
- System/Win32/Process.hsc +43/−1
- System/Win32/Registry.hsc +96/−37
- System/Win32/SimpleMAPI.hsc +8/−4
- System/Win32/SymbolicLink.hsc +8/−1
- System/Win32/Thread.hs +0/−4
- System/Win32/Time.hsc +46/−5
- Win32.cabal +1/−1
- changelog.md +7/−1
System/Win32/Automation/Input.hsc view
@@ -11,7 +11,16 @@ Provide sendInput function and INPUT types. -} module System.Win32.Automation.Input - ( module System.Win32.Automation.Input + ( sendInput + , sendInputPtr + , makeKeyboardInput + , PINPUT + , LPINPUT + , INPUT(..) + , PHARDWAREINPUT + , HARDWAREINPUT(..) + , getMessageExtraInfo + , setMessageExtraInfo , module System.Win32.Automation.Input.Key , module System.Win32.Automation.Input.Mouse ) where
System/Win32/Console/HWND.hs view
@@ -9,7 +9,7 @@ Get the handle of the current console window. -} -module System.Win32.Console.HWND where +module System.Win32.Console.HWND (getConsoleHWND) where import Control.Concurrent ( threadDelay ) import Control.Exception ( bracket ) import Foreign.Ptr ( nullPtr )
System/Win32/Console/Title.hsc view
@@ -10,7 +10,10 @@ Get/Set the title for the current console window. -} -module System.Win32.Console.Title where +module System.Win32.Console.Title + ( getConsoleTitle + , setConsoleTitle + ) where import System.Win32.String ( LPTSTR, LPCTSTR , withTStringBufferLen, withTString, peekTStringLen )
System/Win32/DLL.hsc view
@@ -17,7 +17,19 @@ -- ----------------------------------------------------------------------------- -module System.Win32.DLL where+module System.Win32.DLL+ ( disableThreadLibraryCalls+ , freeLibrary+ , getModuleFileName+ , getModuleHandle+ , getProcAddress+ , loadLibrary+ , loadLibraryEx+ , setDllDirectory+ , LoadLibraryFlags+ , lOAD_LIBRARY_AS_DATAFILE+ , lOAD_WITH_ALTERED_SEARCH_PATH+ ) where import System.Win32.Types @@ -41,10 +53,6 @@ foreign import WINDOWS_CCONV unsafe "windows.h FreeLibrary" c_FreeLibrary :: HMODULE -> IO Bool -{-# CFILES cbits/HsWin32.c #-}-foreign import ccall "HsWin32.h &FreeLibraryFinaliser"- c_FreeLibraryFinaliser :: FunPtr (HMODULE -> IO ())- getModuleFileName :: HMODULE -> IO String getModuleFileName hmod = allocaArray 512 $ \ c_str -> do@@ -64,6 +72,7 @@ getProcAddress hmod procname = withCAString procname $ \ c_procname -> failIfNull "GetProcAddress" $ c_GetProcAddress hmod c_procname+ foreign import WINDOWS_CCONV unsafe "windows.h GetProcAddress" c_GetProcAddress :: HMODULE -> LPCSTR -> IO Addr
System/Win32/DebugApi.hsc view
@@ -16,7 +16,59 @@ -- A collection of FFI declarations for using Windows DebugApi. -- ------------------------------------------------------------------------------module System.Win32.DebugApi where+module System.Win32.DebugApi+ ( PID, TID, DebugEventId, ForeignAddress+ , PHANDLE, THANDLE+ , ThreadInfo+ , ImageInfo+ , ExceptionInfo+ , Exception(..)+ , DebugEventInfo(..)+ , DebugEvent++ , debugBreak+ , isDebuggerPresent++ -- * Debug events+ , waitForDebugEvent+ , getDebugEvents+ , continueDebugEvent++ -- * Debugging another process+ , debugActiveProcess+ , peekProcessMemory+ , readProcessMemory+ , pokeProcessMemory+ , withProcessMemory+ , peekP+ , pokeP++ -- * Thread control+ , suspendThread+ , resumeThread+ , withSuspendedThread++ -- * Thread register control+ , getThreadContext+ , setThreadContext+ , useAllRegs+ , withThreadContext++#if __i386__+ , eax, ebx, ecx, edx, esi, edi, ebp, eip, esp+#elif __x86_64__+ , rax, rbx, rcx, rdx, rsi, rdi, rbp, rip, rsp+#endif+ , segCs, segDs, segEs, segFs, segGs+ , eFlags+ , dr+ , setReg, getReg, modReg+ , makeModThreadContext+ , modifyThreadContext++ -- * Sending debug output to another process+ , outputDebugString+ ) where import Control.Exception( bracket_ ) import Data.Word ( Word8, Word32 )
System/Win32/Event.hsc view
@@ -12,7 +12,37 @@ -- processes. -- ------------------------------------------------------------------------------module System.Win32.Event where+module System.Win32.Event+ ( -- * Duplicate options+ DuplicateOption+ , dUPLICATE_CLOSE_SOURCE+ , dUPLICATE_SAME_ACCESS+ -- * Access modes+ , AccessMode+ , eVENT_ALL_ACCESS+ , eVENT_MODIFY_STATE+ -- * Wait results+ , WaitResult+ , wAIT_ABANDONED+ , wAIT_IO_COMPLETION+ , wAIT_OBJECT_0+ , wAIT_TIMEOUT+ , wAIT_FAILED+ -- * Managing events+ , openEvent+ , createEvent+ , duplicateHandle+ , setEvent+ , resetEvent+ , pulseEvent+ -- * Signalling objects+ , signalObjectAndWait+ -- * Waiting on objects+ , waitForSingleObject+ , waitForSingleObjectEx+ , waitForMultipleObjects+ , waitForMultipleObjectsEx+ ) where import Foreign.Marshal.Alloc ( alloca ) import Foreign.Marshal.Array ( withArrayLen )
System/Win32/File.hsc view
@@ -17,8 +17,227 @@ -- ----------------------------------------------------------------------------- -module System.Win32.File where+module System.Win32.File+ ( -- * Access modes+ AccessMode+ , gENERIC_NONE+ , gENERIC_READ+ , gENERIC_WRITE+ , gENERIC_EXECUTE+ , gENERIC_ALL+ , dELETE+ , rEAD_CONTROL+ , wRITE_DAC+ , wRITE_OWNER+ , sYNCHRONIZE+ , sTANDARD_RIGHTS_REQUIRED+ , sTANDARD_RIGHTS_READ+ , sTANDARD_RIGHTS_WRITE+ , sTANDARD_RIGHTS_EXECUTE+ , sTANDARD_RIGHTS_ALL+ , sPECIFIC_RIGHTS_ALL+ , aCCESS_SYSTEM_SECURITY+ , mAXIMUM_ALLOWED+ , fILE_ADD_FILE+ , fILE_ADD_SUBDIRECTORY+ , fILE_ALL_ACCESS+ , fILE_APPEND_DATA+ , fILE_CREATE_PIPE_INSTANCE+ , fILE_DELETE_CHILD+ , fILE_EXECUTE+ , fILE_LIST_DIRECTORY+ , fILE_READ_ATTRIBUTES+ , fILE_READ_DATA+ , fILE_READ_EA+ , fILE_TRAVERSE+ , fILE_WRITE_ATTRIBUTES+ , fILE_WRITE_DATA+ , fILE_WRITE_EA + -- * Sharing modes+ , ShareMode+ , fILE_SHARE_NONE+ , fILE_SHARE_READ+ , fILE_SHARE_WRITE+ , fILE_SHARE_DELETE++ -- * Creation modes+ , CreateMode+ , cREATE_NEW+ , cREATE_ALWAYS+ , oPEN_EXISTING+ , oPEN_ALWAYS+ , tRUNCATE_EXISTING++ -- * File attributes and flags+ , FileAttributeOrFlag+ , fILE_ATTRIBUTE_READONLY+ , fILE_ATTRIBUTE_HIDDEN+ , fILE_ATTRIBUTE_SYSTEM+ , fILE_ATTRIBUTE_DIRECTORY+ , fILE_ATTRIBUTE_ARCHIVE+ , fILE_ATTRIBUTE_NORMAL+ , fILE_ATTRIBUTE_TEMPORARY+ , fILE_ATTRIBUTE_COMPRESSED+ , fILE_ATTRIBUTE_REPARSE_POINT+ , fILE_FLAG_WRITE_THROUGH+ , fILE_FLAG_OVERLAPPED+ , fILE_FLAG_NO_BUFFERING+ , fILE_FLAG_RANDOM_ACCESS+ , fILE_FLAG_SEQUENTIAL_SCAN+ , fILE_FLAG_DELETE_ON_CLOSE+ , fILE_FLAG_BACKUP_SEMANTICS+ , fILE_FLAG_POSIX_SEMANTICS+#ifndef __WINE_WINDOWS_H+ , sECURITY_ANONYMOUS+ , sECURITY_IDENTIFICATION+ , sECURITY_IMPERSONATION+ , sECURITY_DELEGATION+ , sECURITY_CONTEXT_TRACKING+ , sECURITY_EFFECTIVE_ONLY+ , sECURITY_SQOS_PRESENT+ , sECURITY_VALID_SQOS_FLAGS+#endif++ -- * Move file flags+ , MoveFileFlag+ , mOVEFILE_REPLACE_EXISTING+ , mOVEFILE_COPY_ALLOWED+ , mOVEFILE_DELAY_UNTIL_REBOOT++ -- * File pointer directions+ , FilePtrDirection+ , fILE_BEGIN+ , fILE_CURRENT+ , fILE_END++ -- * Drive types+ , DriveType+ , dRIVE_UNKNOWN+ , dRIVE_NO_ROOT_DIR+ , dRIVE_REMOVABLE+ , dRIVE_FIXED+ , dRIVE_REMOTE+ , dRIVE_CDROM+ , dRIVE_RAMDISK++ -- * Define DOS device flags+ , DefineDosDeviceFlags+ , dDD_RAW_TARGET_PATH+ , dDD_REMOVE_DEFINITION+ , dDD_EXACT_MATCH_ON_REMOVE++ -- * Binary types+ , BinaryType+ , sCS_32BIT_BINARY+ , sCS_DOS_BINARY+ , sCS_WOW_BINARY+ , sCS_PIF_BINARY+ , sCS_POSIX_BINARY+ , sCS_OS216_BINARY++ -- * File notification flags+ , FileNotificationFlag+ , fILE_NOTIFY_CHANGE_FILE_NAME+ , fILE_NOTIFY_CHANGE_DIR_NAME+ , fILE_NOTIFY_CHANGE_ATTRIBUTES+ , fILE_NOTIFY_CHANGE_SIZE+ , fILE_NOTIFY_CHANGE_LAST_WRITE+ , fILE_NOTIFY_CHANGE_SECURITY++ -- * File types+ , FileType+ , fILE_TYPE_UNKNOWN+ , fILE_TYPE_DISK+ , fILE_TYPE_CHAR+ , fILE_TYPE_PIPE+ , fILE_TYPE_REMOTE++ -- * Lock modes+ , LockMode+ , lOCKFILE_EXCLUSIVE_LOCK+ , lOCKFILE_FAIL_IMMEDIATELY++ -- * GetFileEx information levels+ , GET_FILEEX_INFO_LEVELS+ , getFileExInfoStandard+ , getFileExMaxInfoLevel++ -- * Security attributes+ , SECURITY_ATTRIBUTES(..)+ , PSECURITY_ATTRIBUTES+ , LPSECURITY_ATTRIBUTES+ , MbLPSECURITY_ATTRIBUTES++ -- * BY_HANDLE file information+ , BY_HANDLE_FILE_INFORMATION(..)++ -- * Win32 file attribute data+ , WIN32_FILE_ATTRIBUTE_DATA(..)++ -- * Helpers+ , failIfWithRetry+ , failIfWithRetry_+ , failIfFalseWithRetry_+ -- * File operations+ , deleteFile+ , copyFile+ , moveFile+ , moveFileEx+ , setCurrentDirectory+ , createDirectory+ , createDirectoryEx+ , removeDirectory+ , getBinaryType++ -- * HANDLE operations+ , createFile+ , closeHandle+ , getFileType+ , flushFileBuffers+ , setEndOfFile+ , setFileAttributes+ , getFileAttributes+ , getFileAttributesExStandard+ , getFileInformationByHandle++ -- ** Reading/writing+ -- | Some operations below bear the @win32_@ prefix to avoid shadowing+ -- operations from "Prelude".+ , OVERLAPPED(..)+ , LPOVERLAPPED+ , MbLPOVERLAPPED+ , win32_ReadFile+ , win32_WriteFile+ , setFilePointerEx++ -- * File notifications+ , findFirstChangeNotification+ , findNextChangeNotification+ , findCloseChangeNotification++ -- * Directories+ , FindData+ , getFindDataFileName+ , findFirstFile+ , findNextFile+ , findClose++ -- * DOS device flags+ , defineDosDevice+ , areFileApisANSI+ , setFileApisToOEM+ , setFileApisToANSI+ , setHandleCount+ , getLogicalDrives+ , getDiskFreeSpace+ , setVolumeLabel++ -- * File locks+ , lockFile+ , unlockFile+ ) where+ import System.Win32.Types import System.Win32.Time @@ -467,10 +686,6 @@ failIfFalse_ "CloseHandle" $ c_CloseHandle h foreign import WINDOWS_CCONV unsafe "windows.h CloseHandle" c_CloseHandle :: HANDLE -> IO Bool--{-# CFILES cbits/HsWin32.c #-}-foreign import ccall "HsWin32.h &CloseHandleFinaliser"- c_CloseHandleFinaliser :: FunPtr (Ptr a -> IO ()) foreign import WINDOWS_CCONV unsafe "windows.h GetFileType" getFileType :: HANDLE -> IO FileType
System/Win32/FileMapping.hsc view
@@ -16,7 +16,33 @@ -- A collection of FFI declarations for interfacing with Win32 mapped files. -- ------------------------------------------------------------------------------module System.Win32.FileMapping where+module System.Win32.FileMapping+ ( mapFile+ , MappedObject(..)+ , withMappedFile+ , withMappedArea+ -- * Enums+ -- ** Section protection flags+ , ProtectSectionFlags+ , sEC_COMMIT+ , sEC_IMAGE+ , sEC_NOCACHE+ , sEC_RESERVE+ -- ** Access falgs+ , FileMapAccess+ , fILE_MAP_ALL_ACCESS+ , fILE_MAP_COPY+ , fILE_MAP_READ+ , fILE_MAP_WRITE+ , fILE_SHARE_WRITE++ -- * Mapping files+ , createFileMapping+ , openFileMapping+ , mapViewOfFileEx+ , mapViewOfFile+ , unmapViewOfFile+ ) where import System.Win32.Types ( HANDLE, DWORD, BOOL, SIZE_T, LPCTSTR, withTString , failIf, failIfNull, DDWORD, ddwordToDwords
System/Win32/HardLink.hs view
@@ -17,8 +17,10 @@ * ReFS doesn't support hard link currently. -} module System.Win32.HardLink - ( module System.Win32.HardLink + ( createHardLink + , createHardLink' ) where + import System.Win32.File ( LPSECURITY_ATTRIBUTES, failIfFalseWithRetry_ ) import System.Win32.String ( LPCTSTR, withTString ) import System.Win32.Types ( BOOL, nullPtr )
System/Win32/Info.hsc view
@@ -17,8 +17,118 @@ -- ----------------------------------------------------------------------------- -module System.Win32.Info where+module System.Win32.Info+ ( SystemColor+ , cOLOR_SCROLLBAR+ , cOLOR_BACKGROUND+ , cOLOR_ACTIVECAPTION+ , cOLOR_INACTIVECAPTION+ , cOLOR_MENU+ , cOLOR_WINDOW+ , cOLOR_WINDOWFRAME+ , cOLOR_MENUTEXT+ , cOLOR_WINDOWTEXT+ , cOLOR_CAPTIONTEXT+ , cOLOR_ACTIVEBORDER+ , cOLOR_INACTIVEBORDER+ , cOLOR_APPWORKSPACE+ , cOLOR_HIGHLIGHT+ , cOLOR_HIGHLIGHTTEXT+ , cOLOR_BTNFACE+ , cOLOR_BTNSHADOW+ , cOLOR_GRAYTEXT+ , cOLOR_BTNTEXT+ , cOLOR_INACTIVECAPTIONTEXT+ , cOLOR_BTNHIGHLIGHT + -- * Standard directories+ , getSystemDirectory+ , getWindowsDirectory+ , getCurrentDirectory+ , getTemporaryDirectory+ , getFullPathName+ , getLongPathName+ , getShortPathName+ , searchPath++ -- * System information+ , ProcessorArchitecture(..)+ , SYSTEM_INFO(..)+ , getSystemInfo++ -- * System metrics+ , SMSetting+ , sM_ARRANGE+ , sM_CLEANBOOT+ , sM_CMETRICS+ , sM_CMOUSEBUTTONS+ , sM_CXBORDER+ , sM_CYBORDER+ , sM_CXCURSOR+ , sM_CYCURSOR+ , sM_CXDLGFRAME+ , sM_CYDLGFRAME+ , sM_CXDOUBLECLK+ , sM_CYDOUBLECLK+ , sM_CXDRAG+ , sM_CYDRAG+ , sM_CXEDGE+ , sM_CYEDGE+ , sM_CXFRAME+ , sM_CYFRAME+ , sM_CXFULLSCREEN+ , sM_CYFULLSCREEN+ , sM_CXHSCROLL+ , sM_CYVSCROLL+ , sM_CXICON+ , sM_CYICON+ , sM_CXICONSPACING+ , sM_CYICONSPACING+ , sM_CXMAXIMIZED+ , sM_CYMAXIMIZED+ , sM_CXMENUCHECK+ , sM_CYMENUCHECK+ , sM_CXMENUSIZE+ , sM_CYMENUSIZE+ , sM_CXMIN+ , sM_CYMIN+ , sM_CXMINIMIZED+ , sM_CYMINIMIZED+ , sM_CXMINTRACK+ , sM_CYMINTRACK+ , sM_CXSCREEN+ , sM_CYSCREEN+ , sM_CXSIZE+ , sM_CYSIZE+ , sM_CXSIZEFRAME+ , sM_CYSIZEFRAME+ , sM_CXSMICON+ , sM_CYSMICON+ , sM_CXSMSIZE+ , sM_CYSMSIZE+ , sM_CXVSCROLL+ , sM_CYHSCROLL+ , sM_CYVTHUMB+ , sM_CYCAPTION+ , sM_CYKANJIWINDOW+ , sM_CYMENU+ , sM_CYSMCAPTION+ , sM_DBCSENABLED+ , sM_DEBUG+ , sM_MENUDROPALIGNMENT+ , sM_MIDEASTENABLED+ , sM_MOUSEPRESENT+ , sM_NETWORK+ , sM_PENWINDOWS+ , sM_SECURE+ , sM_SHOWSOUNDS+ , sM_SLOWMACHINE+ , sM_SWAPBUTTON++ -- * User name+ , getUserName+ ) where+ import Control.Exception (catch) import Foreign.Marshal.Alloc (alloca) import Foreign.Marshal.Utils (with, maybeWith)@@ -111,6 +221,7 @@ getCurrentDirectory :: IO String getCurrentDirectory = try "GetCurrentDirectory" (flip c_getCurrentDirectory) 512+ getTemporaryDirectory :: IO String getTemporaryDirectory = try "GetTempPath" (flip c_getTempPath) 512
System/Win32/Info/Version.hsc view
@@ -19,6 +19,7 @@ -- * Verify OS version , isVistaOrLater, is7OrLater ) where + import Foreign.Ptr ( Ptr, plusPtr ) import Foreign.Marshal.Alloc ( alloca ) import Foreign.Storable ( Storable(..) )
System/Win32/Mem.hsc view
@@ -17,7 +17,90 @@ -- ----------------------------------------------------------------------------- -module System.Win32.Mem where+module System.Win32.Mem+ ( MEMORY_BASIC_INFORMATION(..)+ , copyMemory+ , moveMemory+ , fillMemory+ , zeroMemory+ , memset+ , getProcessHeap+#ifndef __WINE_WINDOWS_H+ , getProcessHeaps+#endif+ , HGLOBAL+ -- * Global allocation+ , GlobalAllocFlags+ , gMEM_INVALID_HANDLE+ , gMEM_FIXED+ , gMEM_MOVEABLE+ , gPTR+ , gHND+ , gMEM_DDESHARE+ , gMEM_SHARE+ , gMEM_LOWER+ , gMEM_NOCOMPACT+ , gMEM_NODISCARD+ , gMEM_NOT_BANKED+ , gMEM_NOTIFY+ , gMEM_ZEROINIT+ , globalAlloc+ , globalFlags+ , globalFree+ , globalHandle+ , globalLock+ , globalReAlloc+ , globalSize+ , globalUnlock++ -- * Heap allocation+ , HeapAllocFlags+ , hEAP_GENERATE_EXCEPTIONS+ , hEAP_NO_SERIALIZE+ , hEAP_ZERO_MEMORY+ , heapAlloc+ , heapCompact+ , heapCreate+ , heapDestroy+ , heapFree+ , heapLock+ , heapReAlloc+ , heapSize+ , heapUnlock+ , heapValidate++ -- * Virtual allocation+ -- ** Allocation+ , virtualAlloc+ , virtualAllocEx+ , VirtualAllocFlags+ , mEM_COMMIT+ , mEM_RESERVE+ -- ** Locking+ , virtualLock+ , virtualUnlock+ -- ** Protection+ , virtualProtect+ , virtualProtectEx+ , virtualQueryEx+ , ProtectFlags+ , pAGE_READONLY+ , pAGE_READWRITE+ , pAGE_EXECUTE+ , pAGE_EXECUTE_READ+ , pAGE_EXECUTE_READWRITE+ , pAGE_GUARD+ , pAGE_NOACCESS+ , pAGE_NOCACHE+ -- ** Freeing+ , virtualFree+ , virtualFreeEx+ , FreeFlags+ , mEM_DECOMMIT+ , mEM_RELEASE+++ ) where import System.Win32.Types
System/Win32/Process.hsc view
@@ -17,7 +17,49 @@ -- ----------------------------------------------------------------------------- -module System.Win32.Process where+module System.Win32.Process+ ( -- * Sleeping+ iNFINITE+ , sleep+ -- * Processes pperations+ , ProcessId+ , ProcessHandle+ , ProcessAccessRights+ , pROCESS_ALL_ACCESS+ , pROCESS_CREATE_PROCESS+ , pROCESS_CREATE_THREAD+ , pROCESS_DUP_HANDLE+ , pROCESS_QUERY_INFORMATION+ , pROCESS_SET_QUOTA+ , pROCESS_SET_INFORMATION+ , pROCESS_TERMINATE+ , pROCESS_VM_OPERATION+ , pROCESS_VM_READ+ , pROCESS_VM_WRITE+ , openProcess+ , getProcessId+ , getCurrentProcessId+ , getCurrentProcess+ -- * Terminating+ , terminateProcessById+ -- * Toolhelp32+ , Th32SnapHandle+ , Th32SnapFlags+ , tH32CS_SNAPALL+ , tH32CS_SNAPHEAPLIST+ , tH32CS_SNAPMODULE+ , tH32CS_SNAPMODULE32+ , tH32CS_SNAPMODULE64+ , tH32CS_SNAPPROCESS+ , tH32CS_SNAPTHREAD+ , ProcessEntry32+ , ModuleEntry32+ , createToolhelp32Snapshot+ , withTh32Snap+ , th32SnapEnumProcesses+ , th32SnapEnumModules+ ) where+ import Control.Exception ( bracket ) import Control.Monad ( liftM5 ) import Foreign ( Ptr, peekByteOff, allocaBytes, pokeByteOff
System/Win32/Registry.hsc view
@@ -14,43 +14,102 @@ ----------------------------------------------------------------------------- module System.Win32.Registry- ( module System.Win32.Registry- ) where-{- What's really on offer:- (- regCloseKey -- :: HKEY -> IO ()- , regConnectRegistry -- :: Maybe String -> HKEY -> IO HKEY- , regCreateKey -- :: HKEY -> String -> IO HKEY- , regCreateKeyEx -- :: HKEY -> String -> Maybe String- -- -> RegCreateOptions -> REGSAM- -- -> Maybe LPSECURITY_ATTRIBUTES- -- -> IO (HKEY, Bool)- , regDeleteKey -- :: HKEY -> String -> IO ()- , regDeleteValue -- :: HKEY -> String -> IO ()- , regEnumKeys -- :: HKEY -> IO [String]- , regEnumKey -- :: HKEY -> DWORD -> Addr -> DWORD -> IO String- , regEnumKeyValue -- :: HKEY -> DWORD -> Addr -> DWORD -> Addr -> DWORD -> IO String- , regFlushKey -- :: HKEY -> IO ()- , regLoadKey -- :: HKEY -> String -> String -> IO ()- , regNotifyChangeKeyValue -- :: HKEY -> Bool -> RegNotifyOptions- -- -> HANDLE -> Bool -> IO ()- , regOpenKey -- :: HKEY -> String -> IO HKEY- , regOpenKeyEx -- :: HKEY -> String -> REGSAM -> IO HKEY- , regQueryInfoKey -- :: HKEY -> IO RegInfoKey- , regQueryValue -- :: HKEY -> Maybe String -> IO String- , regQueryDefaultValue -- :: HKEY -> String -> IO String- , regQueryValueEx -- :: HKEY -> String -> Addr -> Int -> IO RegValueType- , regReplaceKey -- :: HKEY -> Maybe String -> String -> String -> IO ()- , regRestoreKey -- :: HKEY -> String -> RegRestoreFlags -> IO ()- , regSaveKey -- :: HKEY -> String -> Maybe LPSECURITY_ATTRIBUTES -> IO ()- , regGetValue -- :: HKEY -> Maybe String -> Maybe String -> RegTypeRestriction- -- -> Maybe LPDWORD -> Maybe LPVOID -> Maybe LPDWORD -> IO ()- , regSetValue -- :: HKEY -> String -> String -> IO ()- , regSetValueEx -- :: HKEY -> String -> RegValueType -> LPTSTR -> Int -> IO ()- , regSetStringValue -- :: HKEY -> String -> String -> IO ()- , regUnloadKey -- :: HKEY -> String -> IO ()- ) where--}+ (+ -- * HKEY+ HKEY+ , hKEY_CLASSES_ROOT+ , hKEY_CURRENT_CONFIG+ , hKEY_CURRENT_USER+ , hKEY_LOCAL_MACHINE+ , hKEY_USERS++ -- * Creation options+ , RegCreateOptions+ , rEG_OPTION_NON_VOLATILE+ , rEG_OPTION_VOLATILE++ -- * REGSAM+ , REGSAM+ , kEY_ALL_ACCESS+ , kEY_CREATE_LINK+ , kEY_CREATE_SUB_KEY+ , kEY_ENUMERATE_SUB_KEYS+ , kEY_EXECUTE+ , kEY_NOTIFY+ , kEY_QUERY_VALUE+ , kEY_READ+ , kEY_SET_VALUE+ , kEY_WRITE++ -- * Registry operations+ , regCloseKey+ , regConnectRegistry+ , regCreateKey+ , regCreateKeyEx+ , regDeleteKey+ , regDeleteValue+ , regEnumKeys+ , regEnumKeyVals+ , regEnumKey+ , regEnumValue+ , regFlushKey+ , regLoadKey+ , regUnLoadKey+ , regNotifyChangeKeyValue+ , RegNotifyOptions+ , rEG_NOTIFY_CHANGE_NAME+ , rEG_NOTIFY_CHANGE_ATTRIBUTES+ , rEG_NOTIFY_CHANGE_LAST_SET+ , rEG_NOTIFY_CHANGE_SECURITY++ , regOpenKey+ , regOpenKeyEx+ , regQueryInfoKey+ , RegInfoKey(..)+ , regQueryValue+ , regQueryValueKey+ , regQueryDefaultValue+ , regQueryValueEx+ , regReplaceKey+ , RegRestoreFlags+ , rEG_WHOLE_HIVE_VOLATILE+ , rEG_REFRESH_HIVE+ , rEG_NO_LAZY_FLUSH+ , regRestoreKey+ , regSaveKey+ , regGetValue+ , RegTypeRestriction+ , rRF_RT_ANY+ , rRF_RT_DWORD+ , rRF_RT_QWORD+ , rRF_RT_REG_BINARY+ , rRF_RT_REG_DWORD+ , rRF_RT_REG_EXPAND_SZ+ , rRF_RT_REG_MULTI_SZ+ , rRF_RT_REG_NONE+ , rRF_RT_REG_QWORD+ , rRF_RT_REG_SZ+ , rRF_NOEXPAND+ , rRF_ZEROONFAILURE+ , rRF_SUBKEY_WOW6464KEY+ , rRF_SUBKEY_WOW6432KEY++ , regSetValue+ , regSetValueEx+ , RegValueType+ , rEG_BINARY+ , rEG_DWORD+ , rEG_DWORD_LITTLE_ENDIAN+ , rEG_DWORD_BIG_ENDIAN+ , rEG_EXPAND_SZ+ , rEG_LINK+ , rEG_MULTI_SZ+ , rEG_NONE+ , rEG_RESOURCE_LIST+ , rEG_SZ++ , regSetStringValue -- :: HKEY -> String -> String -> IO ()+ ) where {- Registry API omissions:
System/Win32/SimpleMAPI.hsc view
@@ -35,8 +35,7 @@ -- Apparently, simple MAPI does not support unicode and probably never will, -- so this module will just mangle any Unicode in your strings import Graphics.Win32.GDI.Types ( HWND)-import System.Win32.DLL ( loadLibrary, c_GetProcAddress, freeLibrary- , c_FreeLibraryFinaliser )+import System.Win32.DLL ( loadLibrary, freeLibrary, getProcAddress ) import System.Win32.Types ( DWORD, LPSTR, HMODULE, failIfNull ) ##include "windows_cconv.h"@@ -171,9 +170,9 @@ (loadProc "MAPISendMail" dll mkMapiSendMail) where loadProc :: String -> HMODULE -> (FunPtr a -> a) -> IO a- loadProc name dll' conv = withCAString name $ \name' -> do+ loadProc name dll' conv = do proc <- failIfNull ("loadMapiDll: " ++ dllname ++ ": " ++ name)- $ c_GetProcAddress dll' name'+ $ getProcAddress dll' name return $ conv $ castPtrToFunPtr proc -- | loadMapiDll :: String -> IO (MapiFuncs, HMODULE)@@ -203,6 +202,11 @@ loadOne l = case l of [] -> fail $ "loadMapi: Failed to load any of DLLs: " ++ show dlls x:y -> handleIOException (const $ loadOne y) (loadMapiDll x)+++{-# CFILES cbits/HsWin32.c #-}+foreign import ccall "HsWin32.h &FreeLibraryFinaliser"+ c_FreeLibraryFinaliser :: FunPtr (HMODULE -> IO ()) -- | withMapiLoaded :: MapiLoaded -> (MapiFuncs -> IO a) -> IO a
System/Win32/SymbolicLink.hsc view
@@ -25,7 +25,14 @@ addition to the target and link name to enable this behavior. -} module System.Win32.SymbolicLink - ( module System.Win32.SymbolicLink + ( SymbolicLinkFlags + , sYMBOLIC_LINK_FLAG_FILE + , sYMBOLIC_LINK_FLAG_DIRECTORY + , sYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE + , createSymbolicLink + , createSymbolicLink' + , createSymbolicLinkFile + , createSymbolicLinkDirectory ) where import Data.Bits ((.|.))
System/Win32/Thread.hs view
@@ -15,14 +15,10 @@ ( THANDLE, TID , getCurrentThread , suspendThread - , c_SuspendThread , resumeThread - , c_ResumeThread , withSuspendedThread , getThreadId - , c_GetThreadId , getCurrentThreadId - , c_GetCurrentThreadId ) where import System.Win32.DebugApi
System/Win32/Time.hsc view
@@ -16,7 +16,41 @@ -- A collection of FFI declarations for interfacing with Win32 Time API. -- ------------------------------------------------------------------------------module System.Win32.Time where+module System.Win32.Time+ ( FILETIME(..)+ , SYSTEMTIME(..)+ , TIME_ZONE_INFORMATION(..)+ , TimeZoneId(..)+ , getSystemTime+ , setSystemTime+ , getSystemTimeAsFileTime+ , getLocalTime+ , setLocalTime+ , getSystemTimeAdjustment+ , getTickCount+ , getLastInputInfo+ , getIdleTime+ , setSystemTimeAdjustment+ , getTimeZoneInformation+ , systemTimeToFileTime+ , fileTimeToSystemTime+ , getFileTime+ , setFileTime+ , invalidFileTime+ , fileTimeToLocalFileTime+ , localFileTimeToFileTime+ , queryPerformanceFrequency+ , queryPerformanceCounter+ , GetTimeFormatFlags+ , lOCALE_NOUSEROVERRIDE+ , lOCALE_USE_CP_ACP+ , tIME_NOMINUTESORSECONDS+ , tIME_NOSECONDS+ , tIME_NOTIMEMARKER+ , tIME_FORCE24HOURFORMAT+ , getTimeFormatEx+ , getTimeFormat+ ) where import System.Win32.String ( peekTStringLen, withTString ) import System.Win32.Types ( BOOL, DDWORD, DWORD, HANDLE, LARGE_INTEGER, LCID@@ -255,14 +289,21 @@ failIf_ not "getFileTime: GetFileTime" $ c_GetFileTime h crt acc wrt liftM3 (,,) (peek crt) (peek acc) (peek wrt) +invalidFileTime :: FILETIME+invalidFileTime = FILETIME 0+ foreign import WINDOWS_CCONV "windows.h SetFileTime" c_SetFileTime :: HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO BOOL-setFileTime :: HANDLE -> FILETIME -> FILETIME -> FILETIME -> IO ()-setFileTime h crt acc wrt = with crt $- \c_crt -> with acc $- \c_acc -> with wrt $+setFileTime :: HANDLE -> Maybe FILETIME -> Maybe FILETIME -> Maybe FILETIME -> IO ()+setFileTime h crt acc wrt = withTime crt $+ \c_crt -> withTime acc $+ \c_acc -> withTime wrt $ \c_wrt -> do failIf_ not "setFileTime: SetFileTime" $ c_SetFileTime h c_crt c_acc c_wrt+ where+ withTime :: Maybe FILETIME -> (Ptr FILETIME -> IO a) -> IO a+ withTime Nothing k = k nullPtr+ withTime (Just t) k = with t k foreign import WINDOWS_CCONV "windows.h FileTimeToLocalFileTime" c_FileTimeToLocalFileTime :: Ptr FILETIME -> Ptr FILETIME -> IO BOOL
Win32.cabal view
@@ -1,5 +1,5 @@ name: Win32-version: 2.11.1.0+version: 2.12.0.0 license: BSD3 license-file: LICENSE author: Alastair Reid, shelarcy, Tamar Christina
changelog.md view
@@ -1,8 +1,14 @@ # Changelog for [`Win32` package](http://hackage.haskell.org/package/Win32) -## 2.11.1.0 February 2021+## 2.12.0.0 March 2021 * Win32 for GHC 9.2.x+* Add export lists to all modules, hiding numerous internal `c_` bindings.+* Update the type of `setFileTime` to reflect the fact that the `FILETIME`+ arguments are in fact `Maybe`s.++## 2.11.1.0 February 2021+ * Make `System.Win32.NLS` re-export `CodePage` from `GHC.IO.Encoding.CodePage` in `base` when compiled with `base-4.15` or later.