After researching the issue more, I've tracked down the problem to the _IP_ADAPTER_INFO function.
my $size = $PTR_SIZE + 636 + 8 + 4 + 4;
#Added 8 to position to align correctly
($pos, @{ $hash{'IpAddressList'} }) = _IP_ADDR_STRING($buffer, $pos+8);
#Added 4 to position to align correctly
($pos, @{ $hash{'GatewayList'} }) = _IP_ADDR_STRING($buffer, $pos+4);
#Added 4 to position to align correctly
($pos, @{ $hash{'DhcpServer'} }) = _IP_ADDR_STRING($buffer, $pos+4);
This correctly aligns the position variable so that the IpAddressList, GatewayList, and DhcpServer are returned correctly without crashing the program.
Doug
Show quoted text________________________________
From: Bugs in Win32-IPHelper via RT [bug-Win32-IPHelper@rt.cpan.org]
Sent: Friday, September 30, 2016 11:32 AM
To: Tanner, Douglas C CIV SPAWARSYSCEN-ATLANTIC, 59320
Subject: [Non-DoD Source] [rt.cpan.org #118169] AutoReply: GetAdaptersInfo causing program to crash
Greetings,
This message has been automatically generated in response to the
creation of a trouble ticket regarding:
"GetAdaptersInfo causing program to crash",
a summary of which appears below.
There is no need to reply to this message right now. Your ticket has been
assigned an ID of [rt.cpan.org #118169]. Your ticket is accessible
on the web at:
https://rt.cpan.org/Ticket/Display.html?id=118169
Please include the string:
[rt.cpan.org #118169]
in the subject line of all future correspondence about this issue. To do so,
you may reply to this message.
Thank you,
bug-Win32-IPHelper@rt.cpan.org
-------------------------------------------------------------------------
I am running a program on 64-bit windows using 64-bit perl. My program is crashing when I call
Win32::IPHelper::GetAdaptersInfo(\@IP_ADAPTER_INFO);
It appears the buffer size or something is off b/c if I use 32-bit perl it runs fine. Specifically, it is crashing in _shiftunpack at line
my @values = unpack($element, $buf);
If I print out $buf prior to the crash it is holding "255.255". My assumption here is that it is trying to get the netmask but the position or buffer size was previously incorrect.
Any help would be greatly appreciated.
Doug