io: fix for win32-error not throwing on zero.
							parent
							
								
									1eb7dbe6d2
								
							
						
					
					
						commit
						ca1612cc57
					
				| 
						 | 
				
			
			@ -31,7 +31,7 @@ ERROR: file-delete-failed path error ;
 | 
			
		|||
: (delete-file) ( path -- )
 | 
			
		||||
    dup DeleteFile 0 = [
 | 
			
		||||
        GetLastError ERROR_ACCESS_DENIED =
 | 
			
		||||
        [ delete-read-only-file ] [ win32-error ] if
 | 
			
		||||
        [ delete-read-only-file ] [ drop win32-error ] if
 | 
			
		||||
    ] [ drop ] if ;
 | 
			
		||||
 | 
			
		||||
M: windows delete-file ( path -- )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,7 +19,7 @@ TUPLE: windows-file-info < file-info-tuple attributes ;
 | 
			
		|||
 | 
			
		||||
: get-compressed-file-size ( path -- n )
 | 
			
		||||
    { DWORD } [ GetCompressedFileSize ] with-out-parameters
 | 
			
		||||
    over INVALID_FILE_SIZE = [ win32-error ] [ >64bit ] if ;
 | 
			
		||||
    over INVALID_FILE_SIZE = [ win32-error ] when >64bit ;
 | 
			
		||||
 | 
			
		||||
: set-windows-size-on-disk ( file-info path -- file-info )
 | 
			
		||||
    over attributes>> +compressed+ swap member? [
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -117,7 +117,7 @@ M: windows init-io ( -- )
 | 
			
		|||
: handle>file-size ( handle -- n/f )
 | 
			
		||||
    (handle>file-size) [
 | 
			
		||||
        GetLastError ERROR_INVALID_FUNCTION =
 | 
			
		||||
        [ f ] [ win32-error ] if
 | 
			
		||||
        [ win32-error ] unless f
 | 
			
		||||
    ] unless* ;
 | 
			
		||||
 | 
			
		||||
ERROR: seek-before-start n ;
 | 
			
		||||
| 
						 | 
				
			
			@ -405,7 +405,7 @@ M: windows home
 | 
			
		|||
    0
 | 
			
		||||
    [ FindFirstStream ] keepd
 | 
			
		||||
    over INVALID_HANDLE_VALUE = [
 | 
			
		||||
        2drop win32-error
 | 
			
		||||
        2drop win32-error f
 | 
			
		||||
    ] [
 | 
			
		||||
        1vector swap file-streams-rest
 | 
			
		||||
    ] if ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ M: openssl ssl-certificate-verification-supported? f ;
 | 
			
		|||
 | 
			
		||||
: load-windows-cert-store ( string -- HCERTSTORE )
 | 
			
		||||
    [ f ] dip CertOpenSystemStore
 | 
			
		||||
    [ win32-error ] when-zero ;
 | 
			
		||||
    [ win32-error f ] when-zero ;
 | 
			
		||||
 | 
			
		||||
: X509-NAME. ( X509_NAME -- )
 | 
			
		||||
    f 0 X509_NAME_oneline
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue