谁能用C#帮我翻译以下VC++的代码啊!小弟愿意出200分甚至更多的分数
下面是代码
extern "C" BOOL VirtualCopy( LPVOID lpvDest, LPVOID lpvSrc, DWORD cbSize, DWORD fdwProtect );
unsigned short *RegAddr;
volatile IOPreg *s2440IOP = (IOPreg *)IOP_BASE;
volatile MEMreg *v_pMEMRegs = (MEMreg *)MEMCTRL_BASE;
BOOL CtestDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
//millin: 映射cpld空间,virtual map reg address
RegAddr = (unsigned short *) VirtualAlloc(NULL,0x20,MEM_RESERVE, PAGE_NOACCESS);
if(RegAddr == NULL) {
printf("Reg VirtualAlloc failed!\r\n");
}
else {
if(!VirtualCopy((PVOID)(RegAddr),(PVOID)(regBase),0x20,PAGE_READWRITE | PAGE_NOCACHE )) {
printf("Reg VirtualCopy failed!\r\n");
//ErrorExit(TEXT("VirtualCopy"));
}
}
高手们帮帮我吧!!!
叮当猫咪
红糖糍粑
相关分类