Cook the shallots or onions for 1 to 2 minutes in the butter without browning. Add garlic and cook 30 seconds more.
Then add the wine and stock and boil rapidly until liquid has reduced to 3 or 4 tablespoons.
Blend the cornstarch with 2 tablespoons of the cream, then stir in half of the remaining cream. Pour it into the wine and shallots and simmer, stirring, for 2 minutes. Add more cream by spoonfuls to thin the sauce—it should coat a spoon fairly heavily.
Stir in the cheese and simmer, stirring, until the cheese has melted and the sauce is smooth and creamy. Add more spoonfuls of cream if necessary. Correct seasoning, set aside, and reheat when needed.
Prepare the eggs and canapés.
Shortly before serving, preheat broiler to very hot. Place a cold drained egg on each canapé, spoon the sauce over, sprinkle with cheese and butter. Run for about a minute under the hot broiler to reheat the eggs but not to overcook them, and to brown the top of the sauce lightly. Serve on a platter or on serving plates.