internal static extern IntPtr SFileFindFirstFile(IntPtr hMPQ, String szMask, ref SFILE_FIND_DATA lpFindFileData, IntPtr szListFile);
internal static extern bool SFileFindNextFile(IntPtr hFind, ref SFILE_FIND_DATA lpFindFileData);
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; }