Exemple #1
0
        // Token: 0x06000018 RID: 24 RVA: 0x00002718 File Offset: 0x00000918
        public static string[] INIGetAllItems(string iniFile, string section)
        {
            uint MAX_BUFFER = 32767u;

            string[] items           = new string[0];
            IntPtr   pReturnedString = Marshal.AllocCoTaskMem((int)(MAX_BUFFER * 2u));
            uint     bytesReturned   = Win32API.GetPrivateProfileSection(section, pReturnedString, MAX_BUFFER, iniFile);

            if (bytesReturned != MAX_BUFFER - 2u || bytesReturned == 0u)
            {
                string returnedString = Marshal.PtrToStringAuto(pReturnedString, (int)bytesReturned);
                string text           = returnedString;
                char[] separator      = new char[1];
                items = text.Split(separator, StringSplitOptions.RemoveEmptyEntries);
            }
            Marshal.FreeCoTaskMem(pReturnedString);
            return(items);
        }