ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] How does this not blow up?

From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Fri, 11 Dec 2020 11:01:53 +0100
Not sure why there would be a difference, file_dlg_win32.c is the same between master and release-3.4.
OTOH, format_handle_wm_initdialog() is only called from export_file_hook_proc() on WM_INITDIALOG, but win32_export_file() has already setup print_args to print_dissections_as_displayed, so I can’t see a user following this code path. Still going to fix the code though.

Thanks,
Jaap

On 11 Dec 2020, at 00:15, chuck c <bubbasnmp@xxxxxxxxx> wrote:

It does "blow up" with 3.5.0rc0. Not sure why it works with 3.4.1.


On Thu, Dec 10, 2020 at 4:06 PM Jaap Keuter <jaap.keuter@xxxxxxxxx> wrote:
Hi,

In "ui/win32/file_dlg_win32.c"

static void
format_handle_wm_initdialog(HWND dlg_hwnd, print_args_t *args) {
    HWND cur_ctrl;
...
    switch (args->print_dissections) {
        case print_dissections_none:
        case print_dissections_collapsed:
            SendMessage(cur_ctrl, CB_SETCURSEL, 0, 0);
            break;
        case print_dissections_as_displayed:
            SendMessage(cur_ctrl, CB_SETCURSEL, 1, 0);
            break;
        case print_dissections_expanded:
            SendMessage(cur_ctrl, CB_SETCURSEL, 2, 0);
>> No break statement??
        default:
            g_assert_not_reached();
    }