mirror of
https://github.com/yuanyuanxiang/SimpleRemoter.git
synced 2026-01-22 07:14:15 +08:00
Fix #266: CloseHandle close an invalid handle
This commit is contained in:
@@ -98,7 +98,7 @@ public:
|
||||
}
|
||||
|
||||
// <20>ر<EFBFBD><D8B1>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
||||
CloseHandle(hFile);
|
||||
SAFE_CLOSE_HANDLE(hFile);
|
||||
|
||||
LeaveCriticalSection(&m_cs);
|
||||
return true;
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
// д<><D0B4><EFBFBD>ļ<EFBFBD>
|
||||
DWORD bytesActuallyWritten = 0;
|
||||
if (!WriteFile(hFile, buffer, bufferSize, &bytesActuallyWritten, NULL)) {
|
||||
CloseHandle(hFile);
|
||||
SAFE_CLOSE_HANDLE(hFile);
|
||||
LeaveCriticalSection(&m_cs);
|
||||
delete[] buffer;
|
||||
return false; // д<><D0B4>ʧ<EFBFBD><CAA7>
|
||||
@@ -215,7 +215,7 @@ public:
|
||||
delete[] buffer;
|
||||
|
||||
// <20>ر<EFBFBD><D8B1>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
||||
CloseHandle(hFile);
|
||||
SAFE_CLOSE_HANDLE(hFile);
|
||||
LeaveCriticalSection(&m_cs);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user