]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/errors/errors.factor
Make a way to get DNS server ips on Windows
[factor.git] / basis / windows / errors / errors.factor
index 99284bdb8051beeafc40c8bd5a016633f0fc8a95..b90b766883b2d76d12062d089998b5f49e293892 100755 (executable)
@@ -734,6 +734,13 @@ ERROR: windows-error n string ;
 : win32-error<0 ( n -- ) 0 < [ win32-error ] when ;
 : win32-error<>0 ( n -- ) zero? [ win32-error ] unless ;
 
+: n>win32-error-check ( n -- )
+    dup ERROR_SUCCESS = [
+        drop
+    ] [
+        dup n>win32-error-string windows-error
+    ] if ;
+
 : check-invalid-handle ( handle -- handle )
     dup INVALID_HANDLE_VALUE = [ win32-error-string throw ] when ;