Whisk together sugar, cornstarch, salt and yolks in a large saucepan until combined well, then slowly add milk. Bring to a boil over moderate heat, continue whisking, then reduce heat and simmer for one minute. Filling will be thick.
Just before serving, beat cream with sugar and vanilla in a bowl using an electric hand mixer until it just holds stiff peaks, then spoon on top of pie. Sprinkle chocolate shavings, chocolate chips or cocoa powder over whipped cream as garnish.