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;
        }
Exemple #2
0
        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;     //字窗口输出
        }