summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2020-06-22 16:39:59 +0200
committerBen Gamari <ben@smart-cactus.org>2020-07-15 16:41:03 -0400
commitbd6b8ec1e775441fc943702e93d48ce75f155e9e (patch)
treee9bf19b84edeedecf8b09da97631bc77f5ec2cec
parentd3f94368cc27e124c07f9c3f90e3f9563a7fc55d (diff)
downloadhaskell-bd6b8ec1e775441fc943702e93d48ce75f155e9e.tar.gz
winio: add comment stating failure behaviour for getUniqueFileInfo.
-rw-r--r--libraries/base/GHC/IO/Windows/Handle.hsc4
1 files changed, 4 insertions, 0 deletions
diff --git a/libraries/base/GHC/IO/Windows/Handle.hsc b/libraries/base/GHC/IO/Windows/Handle.hsc
index 4d7e3e393f..7b39691181 100644
--- a/libraries/base/GHC/IO/Windows/Handle.hsc
+++ b/libraries/base/GHC/IO/Windows/Handle.hsc
@@ -951,9 +951,13 @@ foreign import ccall unsafe "lockFile"
foreign import ccall unsafe "unlockFile"
unlockFile :: CUIntPtr -> IO CInt
+-- | Returns -1 on error. Otherwise writes two values representing
+-- the file into the given ptrs.
foreign import ccall unsafe "get_unique_file_info_hwnd"
c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
+-- succeeds.
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do