In a 9-inch skillet melt butter and lightly sauté the mushrooms, ham, shallots, onion and garlic. When the onion is golden brown, add the flour, salt, pepper and cayenne. Brown well, about 7 to 10 minutes. Blend in the stock and the wine and simmer over low heat for 35 to 45 minutes