Melt butter in a medium saucepan and lightly saute mushrooms, ham, shallots, onions and garlic. When onion is golden brown, add the flour, salt, pepper and cayenne, then brown well, about 7-10 min. Blend in the stock and wine and simmer over low heat for 35 min.