On 2020-01-18 21:49, ToddAndMargo via perl6-users wrote:
On 2020-01-18 21:42, Paul Procacci wrote:
Sorry. Not a WINAPI expert, nor do I want to be. ;)
No Welcome to the Dar Side for you!!!
:-)
The $nSize variable looks fishy. Can it ever contain a value that's
<= 2?
The buffer always has some size to it. Maybe not.
This is is what it looks like when yuo send it a
bogus error to decode
Oh poop, now I have to troubleshoot this:
K:\Windows\NtUtil>perl6 -I. -e "use lib '.'; use WinErr
:WinFormatMessage; say WinFormatMessage( 0xF789, True );"
chr codepoint cannot be negative
in sub WinFormatMessage at K:\Windows\NtUtil\WinErr.pm6 (WinErr) line
118
in block <unit> at -e line 1
I does not like 0xFFFF as the first word.
Life in the fast lane.
:-)
Go it fixed.
$nSize starts as the size of the buffer, so
it will be 1024 is nothing gets returned.
A bad error code
K:\Windows\NtUtil>perl6 -I. -e "use lib '.'; use WinErr
:WinFormatMessage; say WinFormatMessage( 0xF789, True );"
WinFormatMessage: Debug:
WinGetLastError 317
Error Number 63369
nSize 1024
RtnCode 0
Error String Characters 14
ErrorString <Bad Error Code>
Bad Error Code
A good error code:
K:\Windows\NtUtil>perl6 -I. -e "use lib '.'; use WinErr
:WinFormatMessage; say WinFormatMessage( 0x789, True );"
WinFormatMessage: Debug:
WinGetLastError 0
Error Number 1929
nSize 1024
RtnCode 41
Error String Characters 39
ErrorString <The group element could not be removed.>
The group element could not be removed.