From: Hans Leidekker hans@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56871 --- dlls/wpcap/unixlib.c | 52 +++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 13 deletions(-)
diff --git a/dlls/wpcap/unixlib.c b/dlls/wpcap/unixlib.c index 4f5c2337b10..6db4800d16b 100644 --- a/dlls/wpcap/unixlib.c +++ b/dlls/wpcap/unixlib.c @@ -145,13 +145,25 @@ static NTSTATUS wrap_datalink_val_to_name( void *args ) static NTSTATUS wrap_dump( void *args ) { const struct dump_params *params = args; - struct pcap_pkthdr hdr_unix;
- hdr_unix.ts.tv_sec = params->hdr->ts.tv_sec; - hdr_unix.ts.tv_usec = params->hdr->ts.tv_usec; - hdr_unix.caplen = params->hdr->caplen; - hdr_unix.len = params->hdr->len; - pcap_dump( params->user, &hdr_unix, params->packet ); + if (sizeof(void *) == 4) + { + struct pcap_pkthdr_win32 hdr32; + hdr32.ts.tv_sec = params->hdr->ts.tv_sec; + hdr32.ts.tv_usec = params->hdr->ts.tv_usec; + hdr32.caplen = params->hdr->caplen; + hdr32.len = params->hdr->len; + pcap_dump( params->user, (const struct pcap_pkthdr *)&hdr32, params->packet ); + } + else + { + struct pcap_pkthdr hdr64; + hdr64.ts.tv_sec = params->hdr->ts.tv_sec; + hdr64.ts.tv_usec = params->hdr->ts.tv_usec; + hdr64.caplen = params->hdr->caplen; + hdr64.len = params->hdr->len; + pcap_dump( params->user, &hdr64, params->packet ); + } return STATUS_SUCCESS; }
@@ -300,16 +312,30 @@ static NTSTATUS wrap_minor_version( void *args ) static NTSTATUS wrap_next_ex( void *args ) { struct next_ex_params *params = args; - struct pcap_pkthdr *hdr_unix; int ret;
- if ((ret = pcap_next_ex( (pcap_t *)(ULONG_PTR)params->handle, &hdr_unix, params->data )) == 1) + if (sizeof(void *) == 4) { - if (hdr_unix->ts.tv_sec > INT_MAX || hdr_unix->ts.tv_usec > INT_MAX) WARN( "truncating timeval values(s)\n" ); - params->hdr->ts.tv_sec = hdr_unix->ts.tv_sec; - params->hdr->ts.tv_usec = hdr_unix->ts.tv_usec; - params->hdr->caplen = hdr_unix->caplen; - params->hdr->len = hdr_unix->len; + struct pcap_pkthdr_win32 *hdr32; + if ((ret = pcap_next_ex( (pcap_t *)(ULONG_PTR)params->handle, (struct pcap_pkthdr **)&hdr32, params->data )) == 1) + { + params->hdr->ts.tv_sec = hdr32->ts.tv_sec; + params->hdr->ts.tv_usec = hdr32->ts.tv_usec; + params->hdr->caplen = hdr32->caplen; + params->hdr->len = hdr32->len; + } + } + else + { + struct pcap_pkthdr *hdr64; + if ((ret = pcap_next_ex( (pcap_t *)(ULONG_PTR)params->handle, &hdr64, params->data )) == 1) + { + if (hdr64->ts.tv_sec > INT_MAX || hdr64->ts.tv_usec > INT_MAX) WARN( "truncating timeval values(s)\n" ); + params->hdr->ts.tv_sec = hdr64->ts.tv_sec; + params->hdr->ts.tv_usec = hdr64->ts.tv_usec; + params->hdr->caplen = hdr64->caplen; + params->hdr->len = hdr64->len; + } } return ret; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=146622
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:5855: Test failed: got pos (49,51) input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000036C00EA, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032