-USING: alien alien.c-types alien.data alien.syntax arrays assocs
-combinators continuations destructors io io.backend io.ports
-io.timeouts io.backend.windows io.files.windows
-io.files.windows.nt io.files io.pathnames io.buffers
-io.streams.c io.streams.null libc kernel math namespaces
-sequences threads windows windows.errors windows.kernel32
-strings splitting ascii system accessors locals classes.struct
-combinators.short-circuit ;
+USING: accessors alien alien.c-types alien.data alien.syntax
+arrays assocs classes.struct combinators
+combinators.short-circuit destructors io io.backend
+io.backend.windows io.buffers io.files.windows io.ports
+io.streams.c io.streams.null io.timeouts kernel libc locals
+math namespaces sequences system threads windows.errors
+windows.handles windows.kernel32 ;
IN: io.backend.windows.nt
! Global variable with assoc mapping overlapped to threads
-! Copyright (C) 2004, 2008 Mackenzie Straight, Doug Coleman.
+! Copyright (C) 2004, 2010 Mackenzie Straight, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types arrays destructors io io.backend
-io.buffers io.files io.ports io.binary io.timeouts system
-strings kernel math namespaces sequences windows.errors
-windows.kernel32 windows.shell32 windows.types splitting
-continuations math.bitwise accessors init sets assocs
-classes.struct classes literals ;
+USING: accessors alien.c-types classes.struct destructors
+io.backend kernel literals windows.errors windows.handles
+windows.kernel32 ;
IN: io.backend.windows
-TUPLE: win32-handle < disposable handle ;
-
-: set-inherit ( handle ? -- )
- [ handle>> HANDLE_FLAG_INHERIT ] dip
- >BOOLEAN SetHandleInformation win32-error=0/f ;
-
-: new-win32-handle ( handle class -- win32-handle )
- new-disposable swap >>handle
- dup f set-inherit ;
-
-: <win32-handle> ( handle -- win32-handle )
- win32-handle new-win32-handle ;
-
-M: win32-handle dispose* ( handle -- )
- handle>> CloseHandle win32-error=0/f ;
-
-TUPLE: win32-file < win32-handle ptr ;
-
-: <win32-file> ( handle -- win32-file )
- win32-file new-win32-handle ;
-
-M: win32-file dispose
- [ cancel-operation ] [ call-next-method ] bi ;
-
HOOK: CreateFile-flags io-backend ( DWORD -- DWORD )
HOOK: FileArgs-overlapped io-backend ( port -- overlapped/f )
HOOK: add-completion io-backend ( port -- )
FILE_SHARE_WRITE
FILE_SHARE_DELETE
}
-
+
: default-security-attributes ( -- obj )
SECURITY_ATTRIBUTES <struct>
SECURITY_ATTRIBUTES heap-size >>nLength ;
! Copyright (C) 2007, 2008 Doug Coleman, Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types arrays continuations destructors io
-io.backend.windows libc io.ports io.pipes windows.types math
-windows.kernel32 windows namespaces make io.launcher kernel
-sequences windows.errors assocs splitting system strings
-io.launcher.windows io.files.windows io.backend io.files
-io.files.private combinators shuffle accessors locals ;
+USING: accessors alien.c-types combinators destructors
+io.backend io.backend.windows io.files.windows io.launcher
+io.launcher.windows io.pipes io.ports kernel locals strings
+system windows.errors windows.handles windows.kernel32
+windows.types ;
IN: io.launcher.windows.nt
: duplicate-handle ( handle -- handle' )
-USING: alien alien.c-types arrays destructors generic io.mmap
-io.ports io.backend.windows io.files.windows io.backend.windows.privileges
-io.mmap.private kernel libc math math.bitwise namespaces quotations sequences
-windows windows.advapi32 windows.kernel32 io.backend system
-accessors locals windows.errors literals ;
+USING: accessors destructors io.backend.windows.privileges
+io.files.windows io.mmap io.mmap.private kernel literals locals
+math math.bitwise system windows.errors windows.handles
+windows.kernel32 ;
IN: io.mmap.windows
: create-file-mapping ( hFile lpAttributes flProtect dwMaximumSizeHigh dwMaximumSizeLow lpName -- HANDLE )
! Copyright (C) 2007, 2009 Slava Pestov, Doug Coleman.\r
! See http://factorcode.org/license.txt for BSD license.\r
-USING: kernel accessors io.sockets io.sockets.private\r
-io.backend.windows io.backend windows.winsock system destructors\r
-alien.c-types classes.struct combinators ;\r
+USING: accessors alien.c-types classes.struct combinators\r
+destructors io.backend io.backend.windows io.sockets\r
+io.sockets.private kernel system windows.handles\r
+windows.winsock ;\r
FROM: namespaces => get ;\r
IN: io.sockets.windows\r
\r
-USING: accessors alien.c-types alien.data byte-arrays
-combinators.short-circuit continuations destructors init kernel
-locals namespaces random windows.advapi32 windows.errors
-windows.kernel32 windows.types math.bitwise sequences fry
-literals io.backend.windows ;
+USING: accessors alien.data byte-arrays continuations
+destructors init kernel literals locals namespaces random
+sequences windows.advapi32 windows.errors windows.handles
+windows.types ;
IN: random.windows
TUPLE: windows-crypto-context < win32-handle provider type ;
--- /dev/null
+Doug Coleman
--- /dev/null
+! Copyright (C) 2010 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors destructors io.timeouts kernel windows.errors
+windows.kernel32 windows.types ;
+IN: windows.handles
+
+TUPLE: win32-handle < disposable handle ;
+
+: set-inherit ( handle ? -- )
+ [ handle>> HANDLE_FLAG_INHERIT ] dip
+ >BOOLEAN SetHandleInformation win32-error=0/f ;
+
+: new-win32-handle ( handle class -- win32-handle )
+ new-disposable swap >>handle
+ dup f set-inherit ;
+
+: <win32-handle> ( handle -- win32-handle )
+ win32-handle new-win32-handle ;
+
+M: win32-handle dispose* ( handle -- )
+ handle>> CloseHandle win32-error=0/f ;
+
+TUPLE: win32-file < win32-handle ptr ;
+
+: <win32-file> ( handle -- win32-file )
+ win32-file new-win32-handle ;
+
+M: win32-file dispose
+ [ cancel-operation ] [ call-next-method ] bi ;
! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types kernel math windows.errors
windows.kernel32 windows.types namespaces calendar math.bitwise
-accessors classes.struct ;
+accessors classes.struct windows.handles ;
IN: windows.time
: >64bit ( lo hi -- n )