]> gitweb.factorcode.org Git - factor.git/blob - basis/io/backend/windows/windows.factor
Move win32-handle to windows.handles and update using lists to avoid pulling in the...
[factor.git] / basis / io / backend / windows / windows.factor
1 ! Copyright (C) 2004, 2010 Mackenzie Straight, Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors alien.c-types classes.struct destructors
4 io.backend kernel literals windows.errors windows.handles
5 windows.kernel32 ;
6 IN: io.backend.windows
7
8 HOOK: CreateFile-flags io-backend ( DWORD -- DWORD )
9 HOOK: FileArgs-overlapped io-backend ( port -- overlapped/f )
10 HOOK: add-completion io-backend ( port -- )
11
12 : opened-file ( handle -- win32-file )
13     dup invalid-handle?
14     <win32-file> |dispose
15     dup add-completion ;
16
17 CONSTANT: share-mode
18     flags{
19         FILE_SHARE_READ
20         FILE_SHARE_WRITE
21         FILE_SHARE_DELETE
22     }
23     
24 : default-security-attributes ( -- obj )
25     SECURITY_ATTRIBUTES <struct>
26     SECURITY_ATTRIBUTES heap-size >>nLength ;