mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed the issue that PingPlugin crashes Rainmeter after refresh if offline (no network) or ping timed out in Vista/7.
This commit is contained in:
parent
e0ea862d72
commit
0ffbb7e901
@ -200,7 +200,8 @@ DWORD WINAPI NetworkThreadProc(LPVOID pParam)
|
|||||||
{
|
{
|
||||||
pingData* pData = (pingData*)pParam;
|
pingData* pData = (pingData*)pParam;
|
||||||
|
|
||||||
BYTE reply[sizeof(ICMP_ECHO_REPLY) + 32];
|
const DWORD replySize = sizeof(ICMP_ECHO_REPLY) + 32;
|
||||||
|
BYTE* reply = new BYTE[replySize];
|
||||||
|
|
||||||
HANDLE hIcmpFile;
|
HANDLE hIcmpFile;
|
||||||
hIcmpFile = g_IcmpCreateFile();
|
hIcmpFile = g_IcmpCreateFile();
|
||||||
@ -214,7 +215,7 @@ DWORD WINAPI NetworkThreadProc(LPVOID pParam)
|
|||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
reply,
|
reply,
|
||||||
sizeof(reply),
|
replySize,
|
||||||
pData->timeout);
|
pData->timeout);
|
||||||
|
|
||||||
g_IcmpCloseHandle(hIcmpFile);
|
g_IcmpCloseHandle(hIcmpFile);
|
||||||
@ -231,6 +232,7 @@ DWORD WINAPI NetworkThreadProc(LPVOID pParam)
|
|||||||
pData->value = pReply->RoundTripTime;
|
pData->value = pReply->RoundTripTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete [] reply;
|
||||||
CloseHandle(pData->threadHandle);
|
CloseHandle(pData->threadHandle);
|
||||||
pData->threadHandle = 0;
|
pData->threadHandle = 0;
|
||||||
LeaveCriticalSection(&g_CriticalSection);
|
LeaveCriticalSection(&g_CriticalSection);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user