diff --git a/headers/private/app/RegistrarDefs.h b/headers/private/app/RegistrarDefs.h index e58216951b..240f3909d4 100644 --- a/headers/private/app/RegistrarDefs.h +++ b/headers/private/app/RegistrarDefs.h @@ -180,9 +180,15 @@ enum { // a flat app_info -- to be found in B_REG_APP_INFO_TYPE message fields struct flat_app_info { - app_info info; + thread_id thread; + team_id team; + port_id port; + uint32 flags; + dev_t ref_device; + ino_t ref_directory; + char signature[B_MIME_TYPE_LENGTH]; char ref_name[B_FILE_NAME_LENGTH + 1]; -}; +} _PACKED; } // namespace BPrivate diff --git a/src/kits/app/Roster.cpp b/src/kits/app/Roster.cpp index f8c5103cca..af586c349e 100644 --- a/src/kits/app/Roster.cpp +++ b/src/kits/app/Roster.cpp @@ -101,8 +101,14 @@ find_message_app_info(BMessage* message, app_info* info) // unflatten the flat info if (error == B_OK) { if (size == sizeof(flat_app_info)) { - memcpy(info, &flatInfo->info, sizeof(app_info)); + info->thread = flatInfo->thread; + info->team = flatInfo->team; + info->port = flatInfo->port; + info->flags = flatInfo->flags; + info->ref.device = flatInfo->ref_device; + info->ref.directory = flatInfo->ref_directory; info->ref.name = NULL; + memcpy(info->signature, flatInfo->signature, B_MIME_TYPE_LENGTH); if (strlen(flatInfo->ref_name) > 0) info->ref.set_name(flatInfo->ref_name); } else diff --git a/src/servers/registrar/TRoster.cpp b/src/servers/registrar/TRoster.cpp index ac91c421b2..3df55f9bbd 100644 --- a/src/servers/registrar/TRoster.cpp +++ b/src/servers/registrar/TRoster.cpp @@ -1629,10 +1629,15 @@ TRoster::_AddMessageAppInfo(BMessage* message, const app_info* info) // An app_info is not completely flat. The entry_ref contains a string // pointer. Therefore we flatten the info. flat_app_info flatInfo; - flatInfo.info = *info; + flatInfo.thread = info->thread; + flatInfo.team = info->team; + flatInfo.port = info->port; + flatInfo.flags = info->flags; + flatInfo.ref_device = info->ref.device; + flatInfo.ref_directory = info->ref.directory; + memcpy(flatInfo.signature, info->signature, B_MIME_TYPE_LENGTH); // set the ref name to NULL and copy it into the flat structure - flatInfo.info.ref.name = NULL; flatInfo.ref_name[0] = '\0'; if (info->ref.name) strcpy(flatInfo.ref_name, info->ref.name);