System.Globalization.CultureTable.ValidateString C# (CSharp) Метод

ValidateString() приватный статический Метод

private static ValidateString ( ushort pDataPool, uint offsetInPool, int poolSize ) : bool
pDataPool ushort
offsetInPool uint
poolSize int
Результат bool
        private unsafe static bool ValidateString(ushort *pDataPool, uint offsetInPool, int poolSize)
        {
            if (offsetInPool + 2 > poolSize)  // string offset + string length + null termination.
                return false;
                
            char* pCharValues = unchecked((char*)(pDataPool + offsetInPool));
            int stringLength = (int) pCharValues[0];
            if (offsetInPool + stringLength + 2 > poolSize) // string length + string + null termination
                return false;

            return true;
        }