Sauté the garlic and the shallots in 4-5 tablespoons of oil. Add the chestnuts (only if they’re not precooked, otherwise wait until the end, to keep them from getting mushy). Cook for about 5 minutes, then add the mushrooms and the rosemary and cook for a few more minutes.