From: Doug Coleman Date: Fri, 3 Jan 2020 19:03:10 +0000 (-0600) Subject: Revert "Replace "win32-error-string throw" with windows-error instance throwing" X-Git-Tag: 0.99~3609 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=7f395ba7f0e3e0bf24d902f3193c0e65ba0a2527 Revert "Replace "win32-error-string throw" with windows-error instance throwing" This reverts commit 2dfb3b3a73bd2ac1200b9f5f7161a2510a98cebc. --- diff --git a/basis/alien/libraries/windows/windows.factor b/basis/alien/libraries/windows/windows.factor index 03a2e8b8d4..249bcff57a 100644 --- a/basis/alien/libraries/windows/windows.factor +++ b/basis/alien/libraries/windows/windows.factor @@ -1,9 +1,8 @@ -USING: alien.libraries io.pathnames system windows.errors -windows.kernel32 ; +USING: alien.libraries io.pathnames system windows.errors ; IN: alien.libraries.windows M: windows >deployed-library-path file-name ; M: windows dlerror ( -- message ) - GetLastError n>win32-error-string ; + win32-error-string ; diff --git a/basis/calendar/windows/windows.factor b/basis/calendar/windows/windows.factor index f866fe81fa..80253ea91b 100644 --- a/basis/calendar/windows/windows.factor +++ b/basis/calendar/windows/windows.factor @@ -31,7 +31,7 @@ IN: calendar.windows M: windows gmt-offset ( -- hours minutes seconds ) TIME_ZONE_INFORMATION dup GetTimeZoneInformation { - { TIME_ZONE_ID_INVALID [ win32-error ] } + { TIME_ZONE_ID_INVALID [ win32-error-string throw ] } { TIME_ZONE_ID_UNKNOWN [ Bias>> ] } { TIME_ZONE_ID_STANDARD [ Bias>> ] } { TIME_ZONE_ID_DAYLIGHT [ [ Bias>> ] [ DaylightBias>> ] bi + ] } diff --git a/basis/io/files/info/windows/windows.factor b/basis/io/files/info/windows/windows.factor index 99eccd1c0f..90d17a03d5 100644 --- a/basis/io/files/info/windows/windows.factor +++ b/basis/io/files/info/windows/windows.factor @@ -19,7 +19,7 @@ TUPLE: windows-file-info < file-info-tuple attributes ; : get-compressed-file-size ( path -- n ) { DWORD } [ GetCompressedFileSize ] with-out-parameters - over INVALID_FILE_SIZE = [ win32-error ] [ >64bit ] if ; + over INVALID_FILE_SIZE = [ win32-error-string throw ] [ >64bit ] if ; : set-windows-size-on-disk ( file-info path -- file-info ) over attributes>> +compressed+ swap member? [ @@ -183,7 +183,7 @@ CONSTANT: names-buf-length 16384 [ path-length FindNextVolume ] with-out-parameters swap 0 = [ GetLastError ERROR_NO_MORE_FILES = - [ drop f ] [ win32-error ] if + [ drop f ] [ win32-error-string throw ] if ] [ alien>native-string ] if ; : find-volumes ( -- array ) diff --git a/basis/io/sockets/secure/windows/windows.factor b/basis/io/sockets/secure/windows/windows.factor index c1b8e3936d..59eccfed19 100644 --- a/basis/io/sockets/secure/windows/windows.factor +++ b/basis/io/sockets/secure/windows/windows.factor @@ -14,7 +14,7 @@ M: openssl ssl-certificate-verification-supported? f ; : load-windows-cert-store ( string -- HCERTSTORE ) [ f ] dip CertOpenSystemStore - [ win32-error ] when-zero ; + [ win32-error-string throw ] when-zero ; : X509-NAME. ( X509_NAME -- ) f 0 X509_NAME_oneline diff --git a/basis/windows/errors/errors.factor b/basis/windows/errors/errors.factor index f5e5314e2f..5679a62eba 100644 --- a/basis/windows/errors/errors.factor +++ b/basis/windows/errors/errors.factor @@ -717,6 +717,9 @@ CONSTANT: FORMAT_MESSAGE_MAX_WIDTH_MASK 0x000000FF [ drop "Unknown error 0x" id 0xffff,ffff bitand >hex append ] [ alien>native-string [ blank? ] trim ] if ; +: win32-error-string ( -- str ) + GetLastError n>win32-error-string ; + ERROR: windows-error n string ; : (win32-error) ( n -- ) diff --git a/extra/talks/tc-lisp-talk/tc-lisp-talk.factor b/extra/talks/tc-lisp-talk/tc-lisp-talk.factor index c0353a3e40..8a6b5d97e5 100644 --- a/extra/talks/tc-lisp-talk/tc-lisp-talk.factor +++ b/extra/talks/tc-lisp-talk/tc-lisp-talk.factor @@ -456,7 +456,7 @@ xyz \"TIME_ZONE_INFORMATION\" dup GetTimeZoneInformation { { TIME_ZONE_ID_INVALID [ - win32-error + win32-error-string throw ] } { TIME_ZONE_ID_STANDARD [ TIME_ZONE_INFORMATION-Bias