private void TraceLog(BOOL bIsRead, wdc_err status) { string sData = ""; string sInfo = ""; if (status == wdc_err.WD_STATUS_SUCCESS) { sData = (bIsRead? "R: " : "W: ") + diag_lib.DisplayHexBuffer(m_obj, m_dwBytes, m_mode); sInfo = (bIsRead ? " from " : " to ") + "offset " + m_dwOffset.ToString("X") + " on BAR " + m_dwBar.ToString() + "(" + m_device.ToString(false) + ")"; Log.TraceLog("AddrSpaceTransferForm: " + sData + sInfo); } else { sData = "failed to " + (bIsRead? "read from" : "write to") + " offset " + m_dwOffset.ToString("X") + " on BAR " + m_dwBar.ToString() + "status 0x" + status.ToString("X") + ": " + utils.Stat2Str((DWORD)status); sInfo = "(" + m_device.ToString(false) + ")"; Log.ErrLog("AddrSpaceTransferForm: " + sData + sInfo); } txtData.Text += sData + Environment.NewLine; }
private void TraceLog(BOOL bIsRead, wdc_err status)//状态输出 { string sData = ""; string sInfo = ""; if (status == wdc_err.WD_STATUS_SUCCESS) { sData = (bIsRead? "R: " : "W: ") + diag_lib.DisplayHexBuffer(m_buff, m_dwBytes);//数据装换成字符串 sInfo = (bIsRead? " from " : " to ") + "offset " + m_dwOffset.ToString("X") + "(" + m_device.ToString(false) + ")"; Log.TraceLog("CfgTransfersForm: " + sData + sInfo);//在主窗口输出 } else { sData = "failed to " + (bIsRead? "read from" : "write to") + " offset " + m_dwOffset.ToString("X") + " status 0x" + status.ToString("X") + ": " + utils.Stat2Str((DWORD)status); sInfo = "(" + m_device.ToString(false) + ")"; Log.ErrLog("CfgTransfersForm: " + sData + sInfo); } txtData.Text += sData + Environment.NewLine; //字窗口输出 }
private void TraceLog(string str, wdc_err status) { txtData.Text += str + Environment.NewLine; string sForm = (m_regType == ACTION_TYPE.CFG)? "CFG Registers R/W Form: " : "RT Registers R/W Form: "; if (m_direction == RW.READ_ALL) { Log.TraceLog(sForm + str); return; } string sMsg = sForm + str + " (" + m_device.ToString(false) + ")"; if (status == wdc_err.WD_STATUS_SUCCESS) { Log.TraceLog(sMsg); } else { Log.ErrLog(sMsg); } }