Hi, I had the same problem "Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)". Here's what I did to fix it.
1. restore the computer to a previous time that I know the dvd drive was working.
2. Copy all the cd driver and save it to a flash drive.
C:\windows\system32\drivers\cdfs.sys
C:\windows\system32\drivers\cdr4_xp.sys
C:\windows\system32\drivers\cdralw2k.sys
C:\windows\system32\drivers\cdrom.sys
C:\windows\system32\drivers\GEARAspiWDM.sys
C:\windows\system32\drivers\pxhelp20.sys
C:\windows\system32\drivers\tdcmdpst.sys
3. Undo the restore.
4. Copy the cd driver back to the system32 folder, replacing the corrupted ones.
5. In device Manager, disable the dvd drive and then re-enable it again and it's back to normal.