Home page Home page Home page Home page
Pixel
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel
Pixel
By Sprezz | Friday, 22 January 2016 16:30 | 0 Comments
One of our clients started having issues recently when an online payment system that had worked for well over a decade suddenly started to fail. The error returned from the third party payment DLL was less than useful.

In its entirety it read "".

We spoke to the company's tech support and expressed some surprise that the routine did not return discrete meaningful error messages for all failure points and they basically confirmed that from their perspective - embarrassed cough - this was a valid way of dealing with errors. Well at least they didn't modify the payload parameter to return an error string - small mercies and all that. So we set about debugging this ourselves.

Our first port of call was to instantiate an Msxml2.ServerXMLHTTP object and open the API URL for a POST payload. This worked well and oleStatus() indicated that all was well. But when it came time to deliver the payload using a SEND method things weren't quite so copacetic. Instead of a zero, oleStatus returned a somewhat large negative integer, "-2147012894" to be precise.

Googling this got us nowhere. Unsurprisingly because what is actually being returned is a 32 bit unsigned integer which is being interpreted by OI as a 32 bit SIGNED integer. What does that mean in real life?

Well take the binary string 10000000000000000000000000000001. If this is a signed integer then the bit at the beginning is used to indicate whether the integer is positive (0) or negative (1), leaving 31 bits to represent the integer. In this case the above number is -1. If this is an unsigned integer then the bit at the beginning is part of the integer itself so there are 32 bits to represent the integer. In this case the above number is 2,147,483,649.

The reason that Google searches failed to bring up any useful information on this error is straightforward. Windows errors (HRESULT values) are expressed as hexadecimal numbers. So we need to convert this value into an unsigned 32 bit integer and get the hex value. Fortunately the Windows 10 calculator makes this easy. Simply invoke the calculator and change to Programmer mode.


Now paste in your error value and click on QWORD to make it DWORD


Note the hex value and search for HRESULT 0xhexResult
 

Armed with this information we were in a much better position to track down the culprit - in this case a tightening up of firewall rules!

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home

Pixel
Pixel Footer R1 C1 Pixel
Pixel
Pixel
Pixel