We were reading the components of FILETIME as CLong, when they should
be unsigned. Word32 seems to be the correct type here.
where
ft2psecs :: Ptr FILETIME -> IO Integer
ft2psecs ft = do
- high <- (#peek FILETIME,dwHighDateTime) ft :: IO CLong
- low <- (#peek FILETIME,dwLowDateTime) ft :: IO CLong
+ high <- (#peek FILETIME,dwHighDateTime) ft :: IO Word32
+ low <- (#peek FILETIME,dwLowDateTime) ft :: IO Word32
-- Convert 100-ns units to picosecs (10^-12)
-- => multiply by 10^5.
return (((fromIntegral high) * (2^32) + (fromIntegral low)) * 100000)