Exemple #1
0
 internal static extern IntPtr SFileFindFirstFile(IntPtr hMPQ, String szMask, ref SFILE_FIND_DATA lpFindFileData, IntPtr szListFile);
Exemple #2
0
 internal static extern bool SFileFindNextFile(IntPtr hFind, ref SFILE_FIND_DATA lpFindFileData);
Exemple #3
0
        public List<string> FindFile(string mask)
        {
            IntPtr szListFile = IntPtr.Zero;
            List<string> v_Files = new List<string>();

            mpq.SFILE_FIND_DATA wf = new SFILE_FIND_DATA();
            foreach (IntPtr handle in mpqHandles.Values)
            {
                IntPtr rc = IntPtr.Zero;
                bool bNext = true;
                rc = iWrapper.SFileFindFirstFile(handle, mask, ref wf, IntPtr.Zero);
                while (rc != IntPtr.Zero && bNext)
                {
                    string fileName = new string(wf.cFileName);
                    fileName = fileName.Remove(fileName.IndexOf('\0'));
                    v_Files.Add(fileName);
                    bNext = iWrapper.SFileFindNextFile(rc, ref wf);
                }
                iWrapper.SFileFindClose(rc);
            }

            return v_Files;
        }