1 USING: alien alien.c-types combinators io io.backend io.buffers
2 io.files io.ports io.windows kernel libc math namespaces
3 prettyprint sequences strings threads threads.private
4 windows windows.kernel32 io.windows.ce.backend system ;
7 ! M: wince normalize-path ( string -- string )
8 ! dup 1 tail* CHAR: \\ = [ "*" append ] [ "\\*" append ] if ;
10 M: wince CreateFile-flags ( DWORD -- DWORD )
11 FILE_ATTRIBUTE_NORMAL bitor ;
12 M: wince FileArgs-overlapped ( port -- f ) drop f ;
14 : finish-read ( port status bytes-ret -- )
15 swap [ drop port-errored ] [ swap n>buffer ] if ;
17 M: win32-file wince-read
19 dup make-FileArgs dup setup-read ReadFile zero?
20 swap FileArgs-lpNumberOfBytesRet *uint dup zero? [
21 2drop t swap set-port-eof?
26 M: win32-file wince-write ( port port-handle -- )
27 drop dup make-FileArgs dup setup-write WriteFile zero? [
30 FileArgs-lpNumberOfBytesRet *uint