Remove win32-error-string, because there was only one place it was used in.
-USING: alien.libraries io.pathnames system windows.errors ;
+USING: alien.libraries io.pathnames system windows.errors
+windows.kernel32 ;
IN: alien.libraries.windows
M: windows >deployed-library-path
file-name ;
M: windows dlerror ( -- message )
- win32-error-string ;
+ GetLastError n>win32-error-string ;
M: windows gmt-offset ( -- hours minutes seconds )
TIME_ZONE_INFORMATION <struct>
dup GetTimeZoneInformation {
- { TIME_ZONE_ID_INVALID [ win32-error-string throw ] }
+ { TIME_ZONE_ID_INVALID [ win32-error ] }
{ TIME_ZONE_ID_UNKNOWN [ Bias>> ] }
{ TIME_ZONE_ID_STANDARD [ Bias>> ] }
{ TIME_ZONE_ID_DAYLIGHT [ [ Bias>> ] [ DaylightBias>> ] bi + ] }
: get-compressed-file-size ( path -- n )
{ DWORD } [ GetCompressedFileSize ] with-out-parameters
- over INVALID_FILE_SIZE = [ win32-error-string throw ] [ >64bit ] if ;
+ over INVALID_FILE_SIZE = [ win32-error ] [ >64bit ] if ;
: set-windows-size-on-disk ( file-info path -- file-info )
over attributes>> +compressed+ swap member? [
[ path-length FindNextVolume ] with-out-parameters
swap 0 = [
GetLastError ERROR_NO_MORE_FILES =
- [ drop f ] [ win32-error-string throw ] if
+ [ drop f ] [ win32-error ] if
] [ alien>native-string ] if ;
: find-volumes ( -- array )
: load-windows-cert-store ( string -- HCERTSTORE )
[ f ] dip CertOpenSystemStore
- [ win32-error-string throw ] when-zero ;
+ [ win32-error ] when-zero ;
: X509-NAME. ( X509_NAME -- )
f 0 X509_NAME_oneline
[ 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 -- )
\"TIME_ZONE_INFORMATION\" <c-object>
dup GetTimeZoneInformation {
{ TIME_ZONE_ID_INVALID [
- win32-error-string throw
+ win32-error
] }
{ TIME_ZONE_ID_STANDARD [
TIME_ZONE_INFORMATION-Bias