include 'win32ax.inc'
.code
start:
stdcall CapetaVaciaOUnidad,"F:"
.if eax = TRUE
invoke MessageBox,0,"La carpeta esta vacia",0,0
.else
invoke MessageBox,0,"La carpeta no esta vacia",0,0
.endif
invoke ExitProcess,0
proc CapetaVaciaOUnidad,ruta
locals
Find WIN32_FIND_DATA ?
HandleBusqueda dd ?
Ruta dd ?
endl
push ebx
invoke GlobalAlloc,GPTR,MAX_PATH+1
mov [Ruta],eax
stdcall Concat,[ruta],"\*", [Ruta]
invoke FindFirstFile,[Ruta] , addr Find
mov [HandleBusqueda],eax
invoke FindNextFile ,eax, addr Find
invoke lstrcpy,[Ruta],addr Find.cFileName
mov ebx,[Ruta]
.if word[ebx] = ".."
invoke FindNextFile, [HandleBusqueda], addr Find
.endif
invoke lstrcpy,[Ruta],addr Find.cFileName
mov ebx,[Ruta]
.if word[ebx] = ".."
invoke GlobalFree,[Ruta]
mov eax,TRUE
.else
.if dword[ebx] = "RECY"
.if dword[ebx+4] = "CLER"
invoke GlobalFree,[Ruta]
mov eax,TRUE
.endif
.else
invoke GlobalFree,[Ruta]
mov eax,FALSE
.endif
.endif
.endif
pop ebx
ret
endp
proc Concat uses esi edi, @AdrSrc1, @AdrSrc2, @AdrDest
mov esi,[@AdrSrc1]
mov edi,[@AdrDest]
.concat_src1:
movsb
cmp byte[esi],0
jne .concat_src1
mov esi,[@AdrSrc2]
.concat_src2:
movsb
cmp byte[esi],0
jne .concat_src2
movsb
ret
endp
.end start