Apparently no one has noticed that the declaration of ObtainUserAgentString on MSDN (http://msdn.microsoft.com/en-us/library/ie/ms775114%28v=vs.85%29.aspx) is completely wrong.  The second arg is a simple non-const null-terminated ascii string pointer, not a const pointer to a string pointer.  IDA at least gets it right.