The attached patch is the first step towards supporting safedisc, it adds code sent from Marcus a few months ago to the current dlls/ntdll/virtual.c It allows us to successfully load the secdrv.sys file into memory. It has been tested with the copy of safedisc that comes with Age of Empires 2. I've just checked that it compiles without warnings and loads the file, there may be room for improvement, so I'm posting it here for review. The next step will be to merge Marcus's implementation of ntloskrnl.exe, that is needed because safedisc imports some functions from that file.
Ivan.