Replace "n>win32-error-string throw" with windows-error instance throwing

flac
Alexander Iljin 2016-06-29 01:20:38 +03:00 committed by Steve Ayerhart
parent 699f8a837d
commit e333278e47
No known key found for this signature in database
GPG Key ID: 5BFD39C5359E967D
2 changed files with 4 additions and 8 deletions

View File

@ -76,7 +76,7 @@ SYMBOL: master-completion-port
{ [ dup integer? ] [ ] }
{ [ dup array? ] [
first dup eof?
[ drop 0 ] [ n>win32-error-string throw ] if
[ drop 0 ] [ throw-windows-error ] if
] }
} cond
] with-timeout ;
@ -147,7 +147,7 @@ M: windows handle-length ( handle -- n/f )
GetLastError {
{ [ dup expected-io-error? ] [ drop f ] }
{ [ dup eof? ] [ drop t ] }
[ n>win32-error-string throw ]
[ throw-windows-error ]
} cond
] [ f ] if ;

View File

@ -45,11 +45,7 @@ CONSTANT: registry-value-max-length 16384
f 0 KEY_ALL_ACCESS f create-key* drop ;
: close-key ( hkey -- )
RegCloseKey dup ERROR_SUCCESS = [
drop
] [
n>win32-error-string throw
] if ;
RegCloseKey n>win32-error-check ;
:: with-open-registry-key ( key subkey mode quot -- )
key subkey mode open-key :> hkey
@ -82,7 +78,7 @@ PRIVATE>
key value-name ptr1 lpType buffer
grow-buffer reg-query-value-ex
] [
ret n>win32-error-string throw
ret throw-windows-error
] if
] if ;