std::string RenderingDebugger::Message::ToReportString(const std::string& reportTypeName) const { std::string s; s += reportTypeName; s += ": "; if (!GetGroupName().empty()) { s += "during '"; s += GetGroupName(); s += "': "; } if (!GetSource().empty()) { s += "in '"; s += GetSource(); s += "': "; } s += GetText(); return s; }
/*! @brief ユーザ情報の表示 */ void CUserInfoDlg::ExecUserInfo() { TCHAR szUserName[UNLEN + 1]; DWORD nUserNameSize = sizeof(szUserName) / sizeof(TCHAR); GetUserName(szUserName, &nUserNameSize); m_strUserName = szUserName; TCHAR szDomainName[DNLEN + 1]; DWORD nDomainNameSize = sizeof(szDomainName) / sizeof(TCHAR); GetComputerNameEx(ComputerNameDnsDomain, szDomainName, & nDomainNameSize); m_strDomainName = szDomainName; TCHAR szFullUserName[UNLEN + 1]; ZeroMemory(szFullUserName, sizeof(szFullUserName)); GetFullName(szUserName, szDomainName, szFullUserName); m_strFullUserName = szFullUserName; m_bAdminUser = IsUserAnAdmin(); TCHAR szGroupName[(GNLEN + 1) * 5]; ZeroMemory(szGroupName, sizeof(szGroupName)); GetGroupName(szUserName, szGroupName); m_strGroupName = szGroupName; m_strGroupName.TrimLeft(_T(',')); UpdateData(FALSE); }
void COMF::DumpSymbols() { // Dump public, external and communal names records uint32 i; // Record index uint32 xn = 0; // External name index char * string; uint32 TypeIndex; uint32 Group; uint32 Segment; uint32 BaseFrame; uint32 Offset; for (i = 0; i < NumRecords; i++) { if (Records[i].Type2 == OMF_EXTDEF) { // EXTDEF record. Records[i].Index = 3; printf("\n\nExternal names:"); // Loop through strings in record while (Records[i].Index < Records[i].End) { string = Records[i].GetString(); TypeIndex = Records[i].GetIndex(); printf("\n %2i %s, Type %i", ++xn, string, TypeIndex); } if (Records[i].Index != Records[i].End) err.submit(1203); // Check for consistency } if (Records[i].Type2 == OMF_PUBDEF) { // PUBDEF record. printf("\n\nPublic names:"); Records[i].Index = 3; Group = Records[i].GetIndex(); Segment = Records[i].GetIndex(); BaseFrame = 0; if (Segment == 0) BaseFrame = Records[i].GetWord(); // Loop through strings in record while (Records[i].Index < Records[i].End) { string = Records[i].GetString(); Offset = Records[i].GetNumeric(); TypeIndex = Records[i].GetIndex(); printf("\n %s, Segment %s, Group %s, Offset 0x%X, Type %i", string, GetSegmentName(Segment), GetGroupName(Group), Offset, TypeIndex); if (BaseFrame) printf(", Frame %i", BaseFrame); } if (Records[i].Index != Records[i].End) err.submit(1203); // Check for consistency } if (Records[i].Type2 == OMF_CEXTDEF) { // CEXTDEF record. printf("\n\nCommunal names:"); Records[i].Index = 3; while (Records[i].Index < Records[i].End) { uint32 LIndex = Records[i].GetIndex(); // Index into preceding LNAMES uint32 Type = Records[i].GetIndex(); // Type index. Ignored printf("\n %2i %s, Type %i", ++xn, GetLocalName(LIndex), Type); } if (Records[i].Index != Records[i].End) err.submit(1203); // Check for consistency } } }
void CSiteGroupsTree::OnGetDispInfo(NMHDR *header, LRESULT *result) { NMTVDISPINFO *info = reinterpret_cast<NMTVDISPINFO *>(header); ASSERT((info->item.mask & TVIF_SELECTEDIMAGE) == 0); ASSERT((info->item.mask & TVIF_CHILDREN) == 0); if (info->item.mask & TVIF_TEXT) { WebWatch::SiteItemGroup & group = GetGroupFromItem(info->item.hItem); const std::string & name = GetGroupName(group); strncpy(info->item.pszText, name.c_str(), info->item.cchTextMax - 2); info->item.pszText[info->item.cchTextMax - 1] = '\0'; } }
GroupId AdminCache::GetAdminGroup(AdminId id, unsigned int index, const char **name) { AdminUser *pUser = (AdminUser *)m_pMemory->GetAddress(id); if (!pUser || pUser->magic != USR_MAGIC_SET || index >= pUser->grp_count) { return INVALID_GROUP_ID; } int *table = (int *)m_pMemory->GetAddress(pUser->grp_table); GroupId gid = table[index]; if (name) { *name = GetGroupName(gid); } return gid; }
void ParmLinkMgr::SetParm( bool flagA, int comp_ind, int group_ind, int parm_ind ) { vector< Geom* > compVec = aircraftPtr->getGeomVec(); compVec.push_back( aircraftPtr->getUserGeom() ); if ( compVec.size() == 0 ) { m_WorkingParmLink.SetParmA( NULL ); m_WorkingParmLink.SetParmB( NULL ); return; } if ( comp_ind >= (int)compVec.size() ) comp_ind = 0; Geom* gPtr = compVec[comp_ind]; string group_name = GetGroupName( gPtr, group_ind ); vector< Parm* > parmVec = GetParmVec( gPtr, group_name ); if ( parmVec.size() == 0 ) { if ( flagA ) m_WorkingParmLink.SetParmA( NULL ); else m_WorkingParmLink.SetParmB( NULL ); return; } if ( parm_ind >= (int)parmVec.size() ) parm_ind = 0; if ( flagA ) m_WorkingParmLink.SetParmA( parmVec[parm_ind] ); else m_WorkingParmLink.SetParmB( parmVec[parm_ind] ); m_WorkingParmLink.InitOffsetScale(); }
void COMF::DumpRelocations() { // Dump all LEDATA, LIDATA, COMDAT and FIXUPP records uint32 LastDataRecord = 0; // Index to the data record that relocations refer to uint32 LastDataRecordSize = 0; // Size of the data record that relocations refer to int8 * LastDataRecordPointer = 0; // Pointer to data in the data record that relocations refer to uint32 i; // Loop counter uint32 Segment, Offset, Size; // Contents of LEDATA or LIDATA record uint32 LastOffset = 0; // Offset of last LEDATA or LIDATA record uint32 Frame, Target, TargetDisplacement; // Contents of FIXUPP record uint8 byte1, byte2; // First two bytes of subrecord // Bitfields in subrecords OMF_SLocat Locat; // Structure of first two bytes of FIXUP subrecord swapped = Locat field OMF_SFixData FixData; // Structure of FixData field in FIXUP subrecord of FIXUPP record OMF_STrdDat TrdDat; // Structure of Thread Data field in THREAD subrecord of FIXUPP record printf("\n\nLEDATA, LIDATA, COMDAT and FIXUPP records:"); for (i = 0; i < NumRecords; i++) { if (Records[i].Type2 == OMF_LEDATA) { // LEDATA record Segment = Records[i].GetIndex(); // Read segment and offset Offset = Records[i].GetNumeric(); Size = Records[i].End - Records[i].Index; // Calculate size of data LastDataRecord = i; // Save for later FIXUPP that refers to this record LastDataRecordSize = Size; LastDataRecordPointer = Records[i].buffer + Records[i].FileOffset + Records[i].Index; if (Segment < 0x4000) { printf("\n LEDATA: segment %s, Offset 0x%X, Size 0x%X", // Dump segment, offset, size GetSegmentName(Segment), Offset, Size); LastOffset = Offset; } else { // Undocumented Borland communal section printf("\n LEDATA communal section %i, Offset 0x%X, Size 0x%X", // Dump segment, offset, size (Segment & ~0x4000), Offset, Size); LastOffset = Offset; } } if (Records[i].Type2 == OMF_LIDATA) { // LIDATA record Segment = Records[i].GetIndex(); Offset = Records[i].GetNumeric(); LastDataRecord = i; LastDataRecordSize = Records[i].End - Records[i].Index; // Size before expansion of repeat blocks LastDataRecordPointer = Records[i].buffer + Records[i].FileOffset + Records[i].Index; printf("\n LIDATA: segment %s, Offset 0x%X, Size ", GetSegmentName(Segment), Offset); // Call recursive function to interpret repeat data block Size = Records[i].InterpretLIDATABlock(); printf(" = 0x%X", Size); LastOffset = Offset; } if (Records[i].Type2 == OMF_COMDAT) { // COMDAT record uint32 Flags = Records[i].GetByte(); // 1 = continuation, 2 = iterated, 4 = local, 8 = data in code segment uint32 Attributes = Records[i].GetByte(); uint32 Base = 0; // 0 = explicit, 1 = far code, 2 = far data, 3 = code32, 4 = data32 // 0x00 = no match, 0x10 = pick any, 0x20 = same size, 0x30 = exact match uint32 Align = Records[i].GetByte(); // Alignment Offset = Records[i].GetNumeric(); // Offset uint32 TypeIndex = Records[i].GetIndex(); // Type index if ((Attributes & 0x0F) == 0) { Base = Records[i].GetIndex(); // Public base } uint32 NameIndex = Records[i].GetIndex(); // LNAMES index Size = Records[i].End - Records[i].Index; // Calculate size of data printf("\n COMDAT: name %s, Offset 0x%X, Size 0x%X, Attrib 0x%02X, Align %i, Type %i, Base %i", GetLocalName(NameIndex), Offset, Size, Attributes, Align, TypeIndex, Base); LastOffset = Offset; } if (Records[i].Type2 == OMF_FIXUPP) { // FIXUPP record printf("\n FIXUPP:"); Records[i].Index = 3; // Loop through entries in record while (Records[i].Index < Records[i].End) { // Read first byte byte1 = Records[i].GetByte(); if (byte1 & 0x80) { // This is a FIXUP subrecord Frame = 0; Target = 0; TargetDisplacement = 0; // read second byte byte2 = Records[i].GetByte(); // swap bytes and put into byte12 bitfield Locat.bytes[1] = byte1; Locat.bytes[0] = byte2; // Read FixData FixData.b = Records[i].GetByte(); // print mode and location printf("\n %s %s, Offset 0x%X", Lookup(OMFRelocationModeNames, Locat.s.M), Lookup(OMFFixupLocationNames, Locat.s.Location), Locat.s.Offset + LastOffset); // Read conditional fields if (FixData.s.F == 0) { if (FixData.s.Frame < 4) { Frame = Records[i].GetIndex(); } else Frame = 0; switch (FixData.s.Frame) { // Frame method case 0: // F0: segment printf(", segment %s", GetSegmentName(Frame)); break; case 1: // F1: group printf(", group %s", GetGroupName(Frame)); break; case 2: // F2: external symbol printf(", external frame %s", GetSymbolName(Frame)); break; case 4: // F4: frame = source, // or Borland floating point emulation record (undocumented?) printf(", frame = source; or Borland f.p. emulation record"); break; case 5: // F5: frame = target printf(", frame = target"); break; default: printf(", target frame %i method F%i", Frame, FixData.s.Frame); } } else { printf(", frame uses thread %i", FixData.s.Frame); } if (FixData.s.T == 0) { // Target specified Target = Records[i].GetIndex(); uint32 TargetMethod = FixData.s.Target + FixData.s.P * 4; switch (FixData.s.Target) { // = Target method modulo 4 case 0: // T0 and T4: Target = segment case 1: // T1 and T5: Target = segment group printf(". Segment %s (T%i)", GetSegmentName(Target), TargetMethod); break; case 2: // T2 and T6: Target = external symbol printf(". Symbol %s (T%i)", GetSymbolName(Target), TargetMethod); break; default: // Unknown method printf(", target %i unknown method T%i", Target, TargetMethod); } } else { // Target specified in previous thread printf(", target uses thread %i", FixData.s.Target); } if (FixData.s.P == 0) { TargetDisplacement = Records[i].GetNumeric(); printf("\n target displacement %i", TargetDisplacement); } // Get inline addend if (LastDataRecordPointer && Locat.s.Offset < LastDataRecordSize) { int8 * inlinep = LastDataRecordPointer + Locat.s.Offset; switch (Locat.s.Location) { case 0: case 4: // 8 bit printf(", inline 0x%X", *inlinep); break; case 1: case 2: case 5: // 16 bit printf(", inline 0x%X", *(int16*)inlinep); break; case 3: // 16+16 bit printf(", inline 0x%X:0x%X", *(int16*)(inlinep+2), *(int16*)inlinep); break; case 9: case 13: // 32 bit printf(", inline 0x%X", *(int32*)inlinep); break; case 6: case 11: // 16+32 bit printf(", inline 0x%X:0x%X", *(int16*)(inlinep+4), *(int32*)inlinep); break; } } } else { // This is a THREAD subrecord TrdDat.b = byte1; // Put byte into bitfield uint32 Index = 0; if (TrdDat.s.Method < 4) { Index = Records[i].GetIndex(); // has index field if method < 4 ? } printf("\n %s Thread %i. Method %s%i, index %i", (TrdDat.s.D ? "Frame" : "Target"), TrdDat.s.Thread, (TrdDat.s.D ? "F" : "T"), TrdDat.s.Method, Index); } } // Finished loop through subrecords if (Records[i].Index != Records[i].End) err.submit(1203); // Check for consistency } } // Finished loop through records }