Skip to content

Commit ff8240e

Browse files
committed
Fix some threadding issues
1 parent 86d6a3b commit ff8240e

File tree

3 files changed

+314
-265
lines changed

3 files changed

+314
-265
lines changed

plugins/NetworkTools/nettools.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
// + the number of bytes of data specified in the RequestSize parameter.
5959
// This buffer should also be large enough to also hold 8 more bytes of data (the size of an ICMP error message)
6060
// + space for an IO_STATUS_BLOCK structure.
61-
#define ICMP_BUFFER_SIZE(EchoReplyLength, Buffer) (ULONG)(((EchoReplyLength) + (Buffer)->Length) + 8 + sizeof(IO_STATUS_BLOCK) + MAX_OPT_SIZE)
61+
#define ICMP_BUFFER_SIZE(EchoReplyLength, Buffer) \
62+
(ULONG)(((EchoReplyLength) + (Buffer)->Length) + 8 + sizeof(IO_STATUS_BLOCK) + MAX_OPT_SIZE)
6263

6364
#define BITS_IN_ONE_BYTE 8
6465
#define NDIS_UNIT_OF_MEASUREMENT 100
@@ -93,6 +94,9 @@ typedef enum _PH_NETWORK_ACTION
9394
#define NTM_RECEIVEDWHOIS (WM_APP + NETWORK_ACTION_WHOIS)
9495
#define NTM_RECEIVEDFINISH (WM_APP + NETWORK_ACTION_FINISH)
9596

97+
#define WM_TRACERT_ERROR (WM_APP + NETWORK_ACTION_TRACEROUTE + 1001)
98+
99+
96100
typedef struct _NETWORK_OUTPUT_CONTEXT
97101
{
98102
HWND WindowHandle;

plugins/NetworkTools/output.c

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -191,50 +191,6 @@ INT_PTR CALLBACK NetworkOutputDlgProc(
191191
}
192192
}
193193
break;
194-
case NTM_RECEIVEDTRACE:
195-
{
196-
PPH_STRING inputString;
197-
PH_STRING_BUILDER receivedString;
198-
199-
if (wParam != 0)
200-
{
201-
inputString = (PPH_STRING)wParam;
202-
PPH_STRING windowText = NULL;
203-
204-
PhInitializeStringBuilder(&receivedString, PAGE_SIZE);
205-
206-
// Get the current output text.
207-
windowText = PhGetWindowText(context->OutputHandle);
208-
209-
// Append the current output text to the New string.
210-
if (!PhIsNullOrEmptyString(windowText))
211-
PhAppendStringBuilder(&receivedString, &windowText->sr);
212-
213-
PhAppendFormatStringBuilder(&receivedString, L"%s", inputString->Buffer);
214-
215-
// Remove leading newlines.
216-
if (receivedString.String->Length >= 2 * 2 &&
217-
receivedString.String->Buffer[0] == '\r' &&
218-
receivedString.String->Buffer[1] == '\n')
219-
{
220-
PhRemoveStringBuilder(&receivedString, 0, 2);
221-
}
222-
223-
SetWindowText(context->OutputHandle, receivedString.String->Buffer);
224-
SendMessage(
225-
context->OutputHandle,
226-
EM_SETSEL,
227-
receivedString.String->Length / 2 - 1,
228-
receivedString.String->Length / 2 - 1
229-
);
230-
SendMessage(context->OutputHandle, WM_VSCROLL, SB_BOTTOM, 0);
231-
232-
PhDereferenceObject(windowText);
233-
PhDeleteStringBuilder(&receivedString);
234-
//PhDereferenceObject(&inputString);
235-
}
236-
}
237-
break;
238194
case NTM_RECEIVEDWHOIS:
239195
{
240196
if (lParam != 0)

0 commit comments

Comments
 (0)