前些天写补丁时间遇到的
读取一个寄存器的一个地址
地址的内容是宽字节
转换了好大一会儿
记录代码如下
char* WcharToChar(wchar_t* wc)
{
int len= WideCharToMultiByte(CP_ACP,0,wc,wcslen(wc),NULL,0,NULL,NULL);
char* m_char=new char[len+1];
WideCharToMultiByte(CP_ACP,0,wc,wcslen(wc),m_char,len,NULL,NULL);
m_char[len]='\0';
return m_char;
}