{ [ dup integer? ] [ ] }
{ [ dup array? ] [
first dup eof?
- [ drop 0 ] [ throw-windows-error ] if
+ [ drop 0 ] [ n>win32-error-string throw ] if
] }
} cond
] with-timeout ;
GetLastError {
{ [ dup expected-io-error? ] [ drop f ] }
{ [ dup eof? ] [ drop t ] }
- [ throw-windows-error ]
+ [ n>win32-error-string throw ]
} cond
] [ f ] if ;
f 0 KEY_ALL_ACCESS f create-key* drop ;
: close-key ( hkey -- )
- RegCloseKey n>win32-error-check ;
+ RegCloseKey dup ERROR_SUCCESS = [
+ drop
+ ] [
+ n>win32-error-string throw
+ ] if ;
:: 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 throw-windows-error
+ ret n>win32-error-string throw
] if
] if ;