阅读:783回复:0
紧急求救:不能虚拟化DMA通道(为什么)
各位大侠请指点:
为什么我在编写DMA的VXD程序时(用VTOOLSD),调试的时候(用VTOOLSD自带的DEBUG)总是出现DMA不能 虚拟化的消息.有时出现:同样的代码,虚拟同样的DMA通道只是文件名不一样,但是在一个程序中能虚拟化,在 另一个却不能的情况。有时出现调试时,先出现蓝屏,手动回到WINDOWS后,再次调试才虚拟成功。下面是我的程序 请指教,万分感谢! ////CPP文件 #define DEVICE_MAIN #include \"dmano.h\" Declare_Virtual_Device(DMANO) #undef DEVICE_MAIN DmanoDMAChannel* pchannel; DmanoVM::DmanoVM(VMHANDLE hVM) : VVirtualMachine(hVM) {} DmanoThread::DmanoThread(THREADHANDLE hThread) : VThread(hThread) {} BOOL DmanoDevice::OnSysDynamicDeviceInit() { pchannel=new DmanoDMAChannel(); if(pchannel->hook()) { dout<<\"hook success\"<<endl; } else return FALSE; return TRUE; } BOOL DmanoDevice::OnSysDynamicDeviceExit() { if(pchannel) { pchannel->unhook(); dout<<\"unhook success\"<<endl; delete pchannel; } return TRUE; } void DmanoDMAChannel::handler(VMHANDLE hVM) { dout<<\"I am a college student\"; } DmanoDMAChannel::DmanoDMAChannel(): VDMAChannel(1) { } ////H文件 // DMANO.h - include file for VxD DMANO #include <vtoolscp.h> #define DEVICE_CLASS DmanoDevice #define DMANO_DeviceID UNDEFINED_DEVICE_ID #define DMANO_Init_Order UNDEFINED_INIT_ORDER #define DMANO_Major 1 #define DMANO_Minor 0 class DmanoDevice : public VDevice { public: virtual BOOL OnSysDynamicDeviceInit(); virtual BOOL OnSysDynamicDeviceExit(); }; class DmanoVM : public VVirtualMachine { public: DmanoVM(VMHANDLE hVM); }; class DmanoThread : public VThread { public: DmanoThread(THREADHANDLE hThread); }; class DmanoDMAChannel:public VDMAChannel { public: DmanoDMAChannel(); void handler(VMHANDLE hVM); }; |
|