Element FileSearch Vars Self#.StrExt dd ? Self#.Buffer dd ? Self#.Count dd ? Self#.FileSize dd ? Create mov [Self#.StrExt],Self#.prop.Ext mov [Self#.Buffer],0 Destroy lea edx,[Self#.StrExt] call __strclear lea edx,[Self#.Buffer] call __strclear LocalProc local fdloop,fdexit,fdexit1,fdloop2,fdexit2 proc Self#.DoSearch locals pName dd ? hFind dd ? fd FINDDATA endl mov eax,[Self#.Buffer] call __strlen add eax,[Self#.Buffer] dec eax cmp byte [eax-1],'\' je @f mov byte [eax],'\' inc eax @@:mov [pName],eax mov word [eax],'*.' add eax,2 mov edx,[Self#.StrExt] call __strcpy lea ecx,[fd] invoke FindFirstFile,[Self#.Buffer],ecx mov [hFind],eax cmp eax,INVALID_HANDLE_VALUE jne @f jmp fdexit1 fdloop: lea ecx,[fd] invoke FindNextFile,[hFind],ecx or eax,eax jne @f jmp fdexit @@:cmp byte [fd.cFileName],'.' je fdloop if Self#.prop.Include eq 0 test [fd.dwFileAttributes],FILE_ATTRIBUTE_DIRECTORY jne fdloop else if Self#.prop.Include eq 1 test [fd.dwFileAttributes],FILE_ATTRIBUTE_DIRECTORY je fdloop end if if Self#.prop.FullName eq 1 mov eax,[pName] lea edx,[fd.cFileName] call __strcpy mov eax,[Self#.Buffer] else lea eax,[fd.cFileName] end if lea edx,[__rtl_temp_str] call __strpcopy inc [Self#.Count] mov eax,[fd.nFileSizeLow] mov [Self#.FileSize],eax Self#.onSearch [__rtl_temp_str],data_str jmp fdloop fdexit: invoke FindClose,[hFind] fdexit1: if Self#.prop.SubDir eq 0 mov eax,[pName] mov dword [eax],'*.*' lea ecx,[fd] invoke FindFirstFile,[Self#.Buffer],ecx mov [hFind],eax cmp eax,INVALID_HANDLE_VALUE jne @f ret fdloop2: lea ecx,[fd] invoke FindNextFile,[hFind],ecx or eax,eax jne @f jmp fdexit2 @@:cmp byte [fd.cFileName],'.' je fdloop2 test [fd.dwFileAttributes],FILE_ATTRIBUTE_DIRECTORY je fdloop2 mov eax,[pName] lea edx,[fd.cFileName] call __strcpy call Self#.DoSearch jmp fdloop2 fdexit2: invoke FindClose,[hFind] end if ret endp PointWork doSearch \local ext,dir ReadStr ext,data,data.type,Self#.Ext,Self#.prop.Ext mov_ex eax,ext lea edx,[Self#.StrExt] call __strdup ReadStr dir,data,data.type,Self#.Dir,Self#.prop.Dir mov_ex eax,dir lea edx,[Self#.Buffer] call __strdup mov eax,512 lea edx,[Self#.Buffer] call __strsetlength mov [Self#.Count],0 stdcall Self#.DoSearch Self#.onEndSearch 0,data_null EndPoint PointVar Count,data_int result equ [Self#.Count] EndPoint PointVar Size,data_int result equ [Self#.FileSize] EndPoint EndElement