private static bool IsExceptionMessageLong(int errorCode)
{
StringBuilder sb = new StringBuilder(FirstPassBufferSize); // Buffer length in the first pass in the implementation.
int result = FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_ARGUMENT_ARRAY,
IntPtr.Zero, (uint)errorCode, 0, sb, sb.Capacity,
null);
if (result == 0)
{
return (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER);
}
return false;
}