public Dictionary <string, string> GetPrivateSection(string section) { uint bufSize = 0; uint returnSize; byte[] buf; do { bufSize += BuffSizeStep; buf = new byte[bufSize]; returnSize = _native.IniReadSection(_filePointer, section, buf, bufSize); } while (buf[buf.Length - 3] != 0 && bufSize < BufSizeLimit); var significantBytes = new byte[returnSize]; Array.Copy(buf, significantBytes, returnSize); return(EncodingUtil.Win1251BytesToUtf8(significantBytes) .Split(new[] { '\0' }, StringSplitOptions.RemoveEmptyEntries) .Select(x => x.Split('=')) .ToDictionary(x => x[0], x => x[1])); }