fix windows bootstrap

db4
Doug Coleman 2008-04-04 12:02:25 -05:00
parent 87a705e782
commit b35ef01860
2 changed files with 11 additions and 9 deletions

View File

@ -1,11 +1,12 @@
! 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
USING: alien alien.c-types arrays continuations io
io.windows io.windows.nt.pipes libc io.nonblocking
io.streams.duplex windows.types math windows.kernel32 windows
namespaces io.launcher kernel sequences windows.errors assocs
io.streams.duplex windows.types math windows.kernel32
namespaces io.launcher kernel sequences windows.errors
splitting system threads init strings combinators
io.backend accessors concurrency.flags io.files ;
io.backend accessors concurrency.flags io.files assocs
io.files.private windows destructors ;
IN: io.windows.launcher
TUPLE: CreateProcess-args

View File

@ -32,7 +32,8 @@ M: windows normalize-directory ( string -- string )
: default-security-attributes ( -- obj )
"SECURITY_ATTRIBUTES" <c-object>
"SECURITY_ATTRIBUTES" heap-size over set-SECURITY_ATTRIBUTES-nLength ;
"SECURITY_ATTRIBUTES" heap-size
over set-SECURITY_ATTRIBUTES-nLength ;
: security-attributes-inherit ( -- obj )
default-security-attributes
@ -47,8 +48,8 @@ M: win32-file close-handle ( handle -- )
! Clean up resources (open handle) if add-completion fails
: open-file ( path access-mode create-mode flags -- handle )
[
>r >r
share-mode security-attributes-inherit r> r> CreateFile-flags f CreateFile
>r >r share-mode security-attributes-inherit r> r>
CreateFile-flags f CreateFile
dup invalid-handle? dup close-later
dup add-completion
] with-destructors ;
@ -95,7 +96,8 @@ M: win32-file close-handle ( handle -- )
>r (open-append) r> 2dup set-file-pointer ;
TUPLE: FileArgs
hFile lpBuffer nNumberOfBytesToRead lpNumberOfBytesRet lpOverlapped ;
hFile lpBuffer nNumberOfBytesToRead
lpNumberOfBytesRet lpOverlapped ;
C: <FileArgs> FileArgs
@ -195,4 +197,3 @@ M: windows addrinfo-error ( n -- )
: tcp-socket ( addrspec -- socket )
protocol-family SOCK_STREAM open-socket ;