{ [ dup integer? ] [ ] }
{ [ dup array? ] [
first dup eof?
- [ drop 0 ] [ n>win32-error-string throw ] if
+ [ drop 0 ] [ throw-windows-error ] if
] }
} cond
] with-timeout ;
GetLastError {
{ [ dup expected-io-error? ] [ drop f ] }
{ [ dup eof? ] [ drop t ] }
- [ n>win32-error-string throw ]
+ [ throw-windows-error ]
} cond
] [ f ] if ;
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
key value-name ptr1 lpType buffer
grow-buffer reg-query-value-ex
] [
- ret n>win32-error-string throw
+ ret throw-windows-error
] if
] if ;