         [ ]
     } cleave ;
 
+TUPLE: win32-file-system-info < file-system-info max-component flags device-serial ;
+
 M: winnt file-system-info ( path -- file-system-info )
     normalize-path root-directory
-    dup [ file-system-type ] [ file-system-space ] bi
-    \ file-system-info new
+    ! volume-information ( normalized-path -- volume-name volume-serial max-component flags type )
+    dup [ volume-information ] [ file-system-space ] bi
+    \ win32-file-system-info new
         swap *ulonglong >>free-space
         swap *ulonglong >>total-space
         swap *ulonglong >>available-space
         swap >>type
+        swap *uint >>flags
+        swap *uint >>max-component
+        swap *uint >>device-serial
+        swap >>device-name
         swap >>mount-point
     calculate-file-system-info ;
 

fry alien.strings windows windows.kernel32 windows.time calendar
combinators math.functions sequences namespaces make words
symbols system destructors accessors math.bitwise continuations
windows.errors arrays byte-arrays ;
IN: io.windows.files

: open-file ( path access-mode create-mode flags -- handle )

    ] if ;

: find-first-volume ( -- string handle )
    MAX_PATH 1+ [ <byte-array> ] keep
    dupd
    FindFirstVolume dup win32-error=0/f
    [ utf16n alien>string ] dip ;

: find-next-volume ( handle -- string/f )
    MAX_PATH 1+ [ <byte-array> tuck ] keep
    FindNextVolume 0 = [
        GetLastError ERROR_NO_MORE_FILES =
        [ drop f ] [ win32-error-string throw ] if
    ] [
        utf16n alien>string
    ] if ;
