Exemple #1
0
        // Token: 0x06000017 RID: 23 RVA: 0x000026B0 File Offset: 0x000008B0
        public static string[] INIGetAllSectionNames(string iniFile)
        {
            uint MAX_BUFFER = 32767u;

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

            if (bytesReturned != 0u)
            {
                string local     = Marshal.PtrToStringAuto(pReturnedString, (int)bytesReturned).ToString();
                string text      = local;
                char[] separator = new char[1];
                sections = text.Split(separator, StringSplitOptions.RemoveEmptyEntries);
            }
            Marshal.FreeCoTaskMem(pReturnedString);
            return(sections);
        }