diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-26 03:45:39 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-26 03:45:39 +0300 |
commit | 202e1a58d5228e4efd6bafbe7b755d7bd192f516 (patch) | |
tree | d23d9b3d219eecdf48ee8f81415043e6fd5232ed /src/WindowsEnv/Registry.hs | |
parent | rename directories (diff) | |
download | windows-env-202e1a58d5228e4efd6bafbe7b755d7bd192f516.tar.gz windows-env-202e1a58d5228e4efd6bafbe7b755d7bd192f516.zip |
fix x86 builds
Diffstat (limited to '')
-rw-r--r-- | src/WindowsEnv/Registry.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/WindowsEnv/Registry.hs b/src/WindowsEnv/Registry.hs index da889d4..6eb52ca 100644 --- a/src/WindowsEnv/Registry.hs +++ b/src/WindowsEnv/Registry.hs @@ -8,6 +8,8 @@ -- -- Lower-level functions for reading and writing registry values. +{-# LANGUAGE CPP #-} + module WindowsEnv.Registry ( IsKeyPath(..) , RootKey(..) @@ -148,13 +150,15 @@ decodeString (_, bytes) = T.unpack dropLastZero | otherwise = T.takeWhile (/= '\0') text text = decodeUtf16LE bytes -foreign import ccall unsafe "Windows.h RegQueryValueExW" +#include "ccall.h" + +foreign import WINDOWS_ENV_CCALL unsafe "Windows.h RegQueryValueExW" c_RegQueryValueEx :: WinAPI.PKEY -> WinAPI.LPCTSTR -> WinAPI.LPDWORD -> WinAPI.LPDWORD -> WinAPI.LPBYTE -> WinAPI.LPDWORD -> IO WinAPI.ErrCode -foreign import ccall unsafe "Windows.h RegSetValueExW" +foreign import WINDOWS_ENV_CCALL unsafe "Windows.h RegSetValueExW" c_RegSetValueEx :: WinAPI.PKEY -> WinAPI.LPCTSTR -> WinAPI.DWORD -> WinAPI.DWORD -> WinAPI.LPBYTE -> WinAPI.DWORD -> IO WinAPI.ErrCode -foreign import ccall unsafe "Windows.h RegGetValueW" +foreign import WINDOWS_ENV_CCALL unsafe "Windows.h RegGetValueW" c_RegGetValue :: WinAPI.PKEY -> WinAPI.LPCTSTR -> WinAPI.LPCTSTR -> WinAPI.DWORD -> WinAPI.LPDWORD -> WinAPI.LPBYTE -> WinAPI.LPDWORD -> IO WinAPI.ErrCode queryValue :: IsKeyPath a => a -> ValueName -> ExceptT IOError IO ValueData |