summaryrefslogtreecommitdiff
path: root/ui/win32
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-06-17 16:44:09 +0000
committerGuy Harris <guy@alum.mit.edu>2012-06-17 16:44:09 +0000
commit2bd813507a5a42c298d09ac8d83ca1eebd8db277 (patch)
treea3082031a16fbc243f696cf378ab53b9030238c1 /ui/win32
parent4ad0bf65f2ebecf1b501ba7733063d9c0f8e3f1d (diff)
downloadwireshark-2bd813507a5a42c298d09ac8d83ca1eebd8db277.tar.gz
Export a wtap_dump_can_write_encaps() routine from Wiretap; it takes a
file type and a GArray of encapsulation types and returns TRUE if a capture with all those encapsulation types can be written to a file in that file type and FALSE otherwise. Use it where appropriate. svn path=/trunk/; revision=43315
Diffstat (limited to 'ui/win32')
-rw-r--r--ui/win32/file_dlg_win32.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/ui/win32/file_dlg_win32.c b/ui/win32/file_dlg_win32.c
index 7b17b1792f..a1093b985d 100644
--- a/ui/win32/file_dlg_win32.c
+++ b/ui/win32/file_dlg_win32.c
@@ -1503,19 +1503,6 @@ open_file_hook_proc(HWND of_hwnd, UINT msg, WPARAM w_param, LPARAM l_param) {
return 0;
}
-/* XXX - Copied verbatim from ui/gtk/capture_file_dlg.c. Perhaps it
- * should be in wiretap instead?
- */
-
-static gboolean
-can_save_with_wiretap(int ft)
-{
- /* To save a file with Wiretap, Wiretap has to handle that format,
- and its code to handle that format must be able to write a file
- with this file's encapsulation type. */
- return wtap_dump_can_open(ft) && wtap_dump_can_write_encap(ft, cfile.lnk_t);
-}
-
/* Generate a list of the file types we can save this file as.
"filetype" is the type it has now.
@@ -1651,7 +1638,7 @@ build_file_format_list(HWND sf_hwnd) {
if (!packet_range_process_all(&g_range) || ft != cfile.cd_t) {
/* not all unfiltered packets or a different file type. We have to use Wiretap. */
- if (!can_save_with_wiretap(ft))
+ if (!wtap_can_save_with_wiretap(ft, cfile.linktypes))
continue; /* We can't. */
}
@@ -1707,7 +1694,7 @@ save_as_file_hook_proc(HWND sf_hwnd, UINT msg, WPARAM w_param, LPARAM l_param) {
new_filetype = SendMessage(cur_ctrl, CB_GETITEMDATA, (WPARAM) index, 0);
if (new_filetype != CB_ERR) {
if (filetype != new_filetype) {
- if (can_save_with_wiretap(new_filetype)) {
+ if (wtap_can_save_with_wiretap(new_filetype, cfile.linktypes)) {
cur_ctrl = GetDlgItem(sf_hwnd, EWFD_CAPTURED_BTN);
EnableWindow(cur_ctrl, TRUE);
cur_ctrl = GetDlgItem(sf_hwnd, EWFD_DISPLAYED_BTN);
@@ -1810,7 +1797,7 @@ export_specified_packets_file_hook_proc(HWND sf_hwnd, UINT msg, WPARAM w_param,
new_filetype = SendMessage(cur_ctrl, CB_GETITEMDATA, (WPARAM) index, 0);
if (new_filetype != CB_ERR) {
if (filetype != new_filetype) {
- if (can_save_with_wiretap(new_filetype)) {
+ if (wtap_can_save_with_wiretap(new_filetype, cfile.linktypes)) {
cur_ctrl = GetDlgItem(sf_hwnd, EWFD_CAPTURED_BTN);
EnableWindow(cur_ctrl, TRUE);
cur_ctrl = GetDlgItem(sf_hwnd, EWFD_DISPLAYED_BTN);