Jan 282011

So I’ve written about hiding information before.  But now let’s consider the grocer who gives responses that instead of being empty and devoid of assistance actually send you in the wrong direction.  Have you any potatoes?  “Oh yeah, there’s heaps of them ’round back”.

I’ve just dealt with this again while writing some code.  First the app says “Out of Memory”.  But I’m wise enough to that to know that some COM library is old and is missing a few methods I’m trying to use.  Next, I’m trying to do a ping, by calling IcmpSendEcho.  The error code resolves to “Invalid QOS provider specific buffer”.  WTF.

I’m just trying to ping a device on the network to make sure it’s on and connected.  What does this have to do with a QOS provider?  I didn’t even make a buffer for this provider.

Turns out, after 40 minutes of searching Google, and by the way finding absolutely nothing useful, that the problem was that the IP address wasn’t properly initialized and I was using an empty string.  Was equivalent to ping

So why the obscure error code?

 Posted by at 12:19 am

  3 Responses to “Meaningful error messages”

  1. So I now know why “out of memory” is the error message that comes up for the COM component that’s missing some key methods. I was debugging some other COM issues and stepped into the Microsoft ATL code, and the default error if it can’t instantiate the component is “out of memory”. Unless something provides a better reason for instantation to fail, that’s what you get!

  2. And now I have the answer to my other mystery: WSA_QOS_EPROVSPECBUF (Invalid QOS provider-specific buffer.) has the same error code 0x11018 as IP_BAD_DESTINATION, which is the reasonable response to get when you try to ping

    Using the FormatMessage API to get a meaningful error string is apparently the wrong thing to do for ICMPSendEcho.

  3. Perhaps it would be more helpful for those looking for the answer to these problems if you were to edit your original post, a la StackOverflow? I was expecting witty banter from friends and well-wishers! 🙂 Of course, that’s assuming your posts appear on Google search results…which a cursory test indicates yes, albeit on the second page.