System.ComponentModel.Tests.Win32ExceptionTestType.IsExceptionMessageLong C# (CSharp) Method

IsExceptionMessageLong() private static method

private static IsExceptionMessageLong ( int errorCode ) : bool
errorCode int
return bool
        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;
        }