QString AddressTableModel::purposeForAddress(const QString &address) const { std::string purpose; if (getAddressData(address, /* name= */ nullptr, &purpose)) { return QString::fromStdString(purpose); } return QString(); }
QString AddressTableModel::labelForAddress(const QString &address) const { std::string name; if (getAddressData(address, &name, /* purpose= */ nullptr)) { return QString::fromStdString(name); } return QString(); }
static char* inetAddressToString(char *buf, const size_t len, const CckTransportAddress *address) { memset(buf, 0, len); if((address->family < 0) || (address->family >= TT_FAMILY_MAX)) { CCK_DBG("inetAddressToString: unknown address family %d\n", address->family); return NULL; } if(!inet_ntop(addressFamilyMappings[address->family], getAddressData((CckTransportAddress*)address), buf, (int)len)) { CCK_DBG("inetAddressToString: could not convert %s address to string: %s\n", addressFamilyNames[address->family], strerror(errno)); return NULL; } return buf; }
int CPipeServer::Start(void) { if (pipe!=INVALID_HANDLE_VALUE) { unsigned char command; ULONG bytesread, byteswritten; while (ReadFile(pipe, &command, sizeof(command), &bytesread, NULL)) { switch(command) { case CMD_TARGETPROCESS: if (ReadFile(pipe, &processid, sizeof(processid), &bytesread, NULL)) { BOOL result; result=OpenOrAttachToProcess(); WriteFile(pipe, &result, sizeof(result), &byteswritten, NULL); if (result) { result=(CorDebugProcess5!=NULL); //tell that it supports structure type lookups or not WriteFile(pipe, &result, sizeof(result), &byteswritten, NULL); } } else return 1; break; case CMD_CLOSEPROCESSANDQUIT: return 0; case CMD_RELEASEOBJECTHANDLE: { UINT64 hObject; if (ReadFile(pipe, &hObject, sizeof(hObject), &bytesread, NULL)) releaseObjectHandle(hObject); else return 1; break; } case CMD_ENUMDOMAINS: enumDomains(); break; case CMD_ENUMMODULELIST: { UINT64 hDomain; if (ReadFile(pipe, &hDomain, sizeof(hDomain), &bytesread, NULL)) enumModules(hDomain); else return 1; break; } case CMD_ENUMTYPEDEFS: { UINT64 hModule; if (ReadFile(pipe, &hModule, sizeof(hModule), &bytesread, NULL)) enumTypeDefs(hModule); else return 1; break; } case CMD_GETTYPEDEFMETHODS: { UINT64 hModule; mdTypeDef TypeDef; if (ReadFile(pipe, &hModule, sizeof(hModule), &bytesread, NULL)) { if (ReadFile(pipe, &TypeDef, sizeof(TypeDef), &bytesread, NULL)) enumTypeDefMethods(hModule, TypeDef); else return 1; } else return 1; break; } case CMD_GETADDRESSDATA: { UINT64 Address; if (ReadFile(pipe, &Address, sizeof(Address), &bytesread, NULL)) { getAddressData(Address); } else return 1; break; } } } } return 1; }