]> gitweb.factorcode.org Git - factor.git/commitdiff
Replace "n>win32-error-string throw" with windows-error instance throwing
authorAlexander Iljin <ajsoft@yandex.ru>
Tue, 28 Jun 2016 22:20:38 +0000 (01:20 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 6 Jan 2020 21:18:33 +0000 (13:18 -0800)
basis/io/files/windows/windows.factor
basis/windows/registry/registry.factor

index 9aa45989aaf24321d0ca571a5f8d754d4de60953..19c08cb3a86373882ab7bdbec2005a207b2ddcbd 100644 (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 ;
 
index be9109827605f58e38fb9b0bb72f8b367a152131..932e09d823a5ae5d403b369cf8318e5b9401b0c1 100644 (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 ;