1 ! Copyright (C) 2010 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors destructors kernel windows.errors
4 windows.kernel32 windows.types ;
7 TUPLE: win32-handle < disposable handle ;
9 : set-inherit ( handle ? -- )
10 [ handle>> HANDLE_FLAG_INHERIT ] dip
11 >BOOLEAN SetHandleInformation win32-error=0/f ;
13 : new-win32-handle ( handle class -- win32-handle )
14 new-disposable swap >>handle
17 : <win32-handle> ( handle -- win32-handle )
18 win32-handle new-win32-handle ;
20 M: win32-handle dispose*
21 handle>> CloseHandle win32-error=0/f ;