Yep got it!
Supposed to AND FileAttributes with FILE_ATTRIBUTE_DIRECTORY

Thanks a bunch