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;
}