Skip to content

Commit e70983e

Browse files
committed
Use C++ cast operators.
1 parent b82300c commit e70983e

15 files changed

+109
-109
lines changed

NativeCore/ReClassNET_Plugin.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,5 +260,5 @@ inline void MultiByteToUnicode(const char* src, RC_UnicodeChar* dst, int size)
260260
auto temp = std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>{}.from_bytes(src);
261261
#endif
262262

263-
std::memcpy(dst, temp.c_str(), std::min<int>((int)temp.length(), size) * sizeof(char16_t));
263+
std::memcpy(dst, temp.c_str(), std::min<int>(static_cast<int>(temp.length()), size) * sizeof(char16_t));
264264
}

NativeCore/Unix/ControlRemoteProcess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ extern "C" void ControlRemoteProcess(RC_Pointer handle, ControlRemoteProcessActi
1515
signal = SIGCONT;
1616
}
1717

18-
kill((pid_t)(intptr_t)handle, signal);
18+
kill(static_cast<pid_t>(reinterpret_cast<intptr_t>(handle)), signal);
1919
}

NativeCore/Unix/Debugger.cpp

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int ualarm(unsigned int milliseconds)
1414
{
1515
struct itimerval nval = { 0 };
1616
nval.it_value.tv_sec = milliseconds / 1000;
17-
nval.it_value.tv_usec = (long int)(milliseconds % 1000) * 1000;
17+
nval.it_value.tv_usec = static_cast<long int>(milliseconds % 1000) * 1000;
1818
struct itimerval oval;
1919
if (setitimer(ITIMER_REAL, &nval, &oval) < 0)
2020
return 0;
@@ -55,11 +55,11 @@ extern "C" bool AttachDebuggerToProcess(RC_Pointer id)
5555
{
5656
//TODO: Attach to all threads.
5757

58-
ptrace(PTRACE_ATTACH, (pid_t)(intptr_t)id, nullptr, nullptr);
58+
ptrace(PTRACE_ATTACH, static_cast<pid_t>(reinterpret_cast<intptr_t>(id)), nullptr, nullptr);
5959

6060
waitpid(-1, nullptr, 0);
6161

62-
ptrace(PTRACE_CONT, (pid_t)(intptr_t)id, nullptr, nullptr);
62+
ptrace(PTRACE_CONT, static_cast<pid_t>(reinterpret_cast<intptr_t>(id)), nullptr, nullptr);
6363

6464
return false;
6565
}
@@ -68,7 +68,7 @@ extern "C" void DetachDebuggerFromProcess(RC_Pointer id)
6868
{
6969
//TODO: Detach to all threads.
7070

71-
ptrace(PTRACE_DETACH, (pid_t)(intptr_t)id, nullptr, nullptr);
71+
ptrace(PTRACE_DETACH, static_cast<pid_t>(reinterpret_cast<intptr_t>(id)), nullptr, nullptr);
7272
}
7373

7474
extern "C" bool AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
@@ -87,7 +87,7 @@ extern "C" bool AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
8787

8888
if (tid > 0)
8989
{
90-
evt->ThreadId = (RC_Pointer)(intptr_t)tid;
90+
evt->ThreadId = reinterpret_cast<RC_Pointer>(static_cast<intptr_t>(tid));
9191

9292
siginfo_t si;
9393
if (ptrace(PTRACE_GETSIGINFO, tid, nullptr, &si) == 0)
@@ -125,34 +125,34 @@ extern "C" bool AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
125125
// Copy registers.
126126
auto& reg = evt->ExceptionInfo.Registers;
127127
#ifdef __x86_64__
128-
reg.Rax = (RC_Pointer)regs.rax;
129-
reg.Rbx = (RC_Pointer)regs.rbx;
130-
reg.Rcx = (RC_Pointer)regs.rcx;
131-
reg.Rdx = (RC_Pointer)regs.rdx;
132-
reg.Rdi = (RC_Pointer)regs.rdi;
133-
reg.Rsi = (RC_Pointer)regs.rsi;
134-
reg.Rsp = (RC_Pointer)regs.rsp;
135-
reg.Rbp = (RC_Pointer)regs.rbp;
136-
reg.Rip = (RC_Pointer)regs.rip;
137-
138-
reg.R8 = (RC_Pointer)regs.r8;
139-
reg.R9 = (RC_Pointer)regs.r9;
140-
reg.R10 = (RC_Pointer)regs.r10;
141-
reg.R11 = (RC_Pointer)regs.r11;
142-
reg.R12 = (RC_Pointer)regs.r12;
143-
reg.R13 = (RC_Pointer)regs.r13;
144-
reg.R14 = (RC_Pointer)regs.r14;
145-
reg.R15 = (RC_Pointer)regs.r15;
128+
reg.Rax = static_cast<RC_Pointer>(regs.rax);
129+
reg.Rbx = static_cast<RC_Pointer>(regs.rbx);
130+
reg.Rcx = static_cast<RC_Pointer>(regs.rcx);
131+
reg.Rdx = static_cast<RC_Pointer>(regs.rdx);
132+
reg.Rdi = static_cast<RC_Pointer>(regs.rdi);
133+
reg.Rsi = static_cast<RC_Pointer>(regs.rsi);
134+
reg.Rsp = static_cast<RC_Pointer>(regs.rsp);
135+
reg.Rbp = static_cast<RC_Pointer>(regs.rbp);
136+
reg.Rip = static_cast<RC_Pointer>(regs.rip);
137+
138+
reg.R8 = static_cast<RC_Pointer>(regs.r8);
139+
reg.R9 = static_cast<RC_Pointer>(regs.r9);
140+
reg.R10 = static_cast<RC_Pointer>(regs.r10);
141+
reg.R11 = static_cast<RC_Pointer>(regs.r11);
142+
reg.R12 = static_cast<RC_Pointer>(regs.r12);
143+
reg.R13 = static_cast<RC_Pointer>(regs.r13);
144+
reg.R14 = static_cast<RC_Pointer>(regs.r14);
145+
reg.R15 = static_cast<RC_Pointer>(regs.r15);
146146
#else
147-
reg.Eax = (RC_Pointer)regs.eax;
148-
reg.Ebx = (RC_Pointer)regs.ebx;
149-
reg.Ecx = (RC_Pointer)regs.ecx;
150-
reg.Edx = (RC_Pointer)regs.edx;
151-
reg.Edi = (RC_Pointer)regs.edi;
152-
reg.Esi = (RC_Pointer)regs.esi;
153-
reg.Esp = (RC_Pointer)regs.esp;
154-
reg.Ebp = (RC_Pointer)regs.ebp;
155-
reg.Eip = (RC_Pointer)regs.eip;
147+
reg.Eax = static_cast<RC_Pointer>(regs.eax);
148+
reg.Ebx = static_cast<RC_Pointer>(regs.ebx);
149+
reg.Ecx = static_cast<RC_Pointer>(regs.ecx);
150+
reg.Edx = static_cast<RC_Pointer>(regs.edx);
151+
reg.Edi = static_cast<RC_Pointer>(regs.edi);
152+
reg.Esi = static_cast<RC_Pointer>(regs.esi);
153+
reg.Esp = static_cast<RC_Pointer>(regs.esp);
154+
reg.Ebp = static_cast<RC_Pointer>(regs.ebp);
155+
reg.Eip = static_cast<RC_Pointer>(regs.eip);
156156
#endif
157157

158158
result = true;
@@ -171,7 +171,7 @@ extern "C" bool AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
171171

172172
extern "C" void HandleDebugEvent(DebugEvent* evt)
173173
{
174-
auto tid = (pid_t)(intptr_t)evt->ThreadId;
174+
auto tid = static_cast<pid_t>(reinterpret_cast<intptr_t>(evt->ThreadId));
175175

176176
siginfo_t si;
177177
if (ptrace(PTRACE_GETSIGINFO, tid, 0, &si) == 0)
@@ -204,12 +204,12 @@ extern "C" bool SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, Hardwar
204204
}
205205

206206
intptr_t addressValue = 0;
207-
int accessValue = 0;
208-
int lengthValue = 0;
207+
auto accessValue = 0;
208+
auto lengthValue = 0;
209209

210210
if (set)
211211
{
212-
addressValue = (intptr_t)address;
212+
addressValue = reinterpret_cast<intptr_t>(address);
213213

214214
if (type == HardwareBreakpointTrigger::Execute)
215215
accessValue = 0;
@@ -228,7 +228,7 @@ extern "C" bool SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, Hardwar
228228
lengthValue = 2;
229229
}
230230

231-
auto tasksPath = fs::path("/proc") / std::to_string((intptr_t)id) / "task";
231+
auto tasksPath = fs::path("/proc") / std::to_string(reinterpret_cast<intptr_t>(id)) / "task";
232232
if (fs::is_directory(tasksPath))
233233
{
234234
for (auto& d : fs::directory_iterator(tasksPath))

NativeCore/Unix/DisassembleCode.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ extern "C" bool DisassembleCode(RC_Pointer address, RC_Size length, RC_Pointer v
1111
#ifdef NATIVE_CORE_64
1212
disasm.Archi = 64;
1313
#endif
14-
disasm.VirtualAddr = (UInt64)virtualAddress;
15-
disasm.EIP = (UIntPtr)address;
16-
disasm.SecurityBlock = (UInt32)length;
14+
disasm.VirtualAddr = reinterpret_cast<UInt64>(virtualAddress);
15+
disasm.EIP = reinterpret_cast<UIntPtr>(address);
16+
disasm.SecurityBlock = static_cast<UInt32>(length);
1717

1818
auto disamLength = Disasm(&disasm);
1919
if (disamLength == OUT_OF_BLOCK || disamLength == UNKNOWN_OPCODE)

NativeCore/Unix/EnumerateProcesses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fs::path my_read_symlink(const fs::path& p, std::error_code& ec)
2929
}
3030
else
3131
{
32-
if (result != (ssize_t)temp.size())
32+
if (result != static_cast<ssize_t>(temp.size()))
3333
{
3434
symlink_path = fs::path(std::string(temp.begin(), temp.begin() + result));
3535

NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extern "C" void EnumerateRemoteSectionsAndModules(RC_Pointer handle, EnumerateRe
5050
RC_UnicodeChar Path[PATH_MAXIMUM_LENGTH] = {};
5151
};
5252

53-
std::ifstream input(((std::stringstream&)(std::stringstream() << "/proc/" << (intptr_t)handle << "/maps")).str());
53+
std::ifstream input(static_cast<std::stringstream&>(std::stringstream() << "/proc/" << (intptr_t)handle << "/maps").str());
5454

5555
std::unordered_map<int, ModuleInfo> modules;
5656

@@ -69,7 +69,7 @@ extern "C" void EnumerateRemoteSectionsAndModules(RC_Pointer handle, EnumerateRe
6969
ss >> std::hex >> start >> skip<char> >> end >> skip<char> >> protection >> skip<char> >> offset >> dev1 >> skip<char> >> dev2 >> std::dec >> inode >> std::skipws >> path;
7070

7171
EnumerateRemoteSectionData section = {};
72-
section.BaseAddress = (RC_Pointer)start;
72+
section.BaseAddress = reinterpret_cast<RC_Pointer>(start);
7373
section.Size = end - start;
7474
section.Protection = protection;
7575

@@ -119,7 +119,7 @@ extern "C" void EnumerateRemoteSectionsAndModules(RC_Pointer handle, EnumerateRe
119119
for (auto&& kv : modules)
120120
{
121121
EnumerateRemoteModuleData module = {};
122-
module.BaseAddress = (RC_Pointer)kv.second.Start;
122+
module.BaseAddress = reinterpret_cast<RC_Pointer>(kv.second.Start);
123123
module.Size = kv.second.End - kv.second.Start;
124124
std::memcpy(module.Path, kv.second.Path, PATH_MAXIMUM_LENGTH);
125125

NativeCore/Unix/IsProcessValid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
extern "C" bool IsProcessValid(RC_Pointer handle)
77
{
8-
return kill((pid_t)(intptr_t)handle, 0) == 0;
8+
return kill(static_cast<pid_t>(reinterpret_cast<intptr_t>(handle)), 0) == 0;
99
}

NativeCore/Unix/ReadRemoteMemory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ extern "C" bool ReadRemoteMemory(RC_Pointer handle, RC_Pointer address, RC_Point
77
iovec local[1];
88
iovec remote[1];
99

10-
local[0].iov_base = ((uint8_t*)buffer + offset);
10+
local[0].iov_base = (static_cast<uint8_t*>(buffer) + offset);
1111
local[0].iov_len = size;
1212
remote[0].iov_base = address;
1313
remote[0].iov_len = size;
1414

15-
if (process_vm_readv((pid_t)(intptr_t)handle, local, 1, remote, 1, 0) != size)
15+
if (process_vm_readv(static_cast<pid_t>(reinterpret_cast<intptr_t>(handle)), local, 1, remote, 1, 0) != size)
1616
{
1717
return false;
1818
}

NativeCore/Unix/WriteRemoteMemory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ extern "C" bool WriteRemoteMemory(RC_Pointer handle, RC_Pointer address, RC_Poin
77
iovec local[1];
88
iovec remote[1];
99

10-
local[0].iov_base = ((uint8_t*)buffer + offset);
10+
local[0].iov_base = (static_cast<uint8_t*>(buffer) + offset);
1111
local[0].iov_len = size;
1212
remote[0].iov_base = address;
1313
remote[0].iov_len = size;
1414

15-
if (process_vm_writev((pid_t)(intptr_t)handle, local, 1, remote, 1, 0) != size)
15+
if (process_vm_writev(static_cast<pid_t>(reinterpret_cast<intptr_t>(handle)), local, 1, remote, 1, 0) != size)
1616
{
1717
return false;
1818
}

NativeCore/Windows/Debugger.cpp

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
bool __stdcall AttachDebuggerToProcess(RC_Pointer id)
77
{
8-
if (!DebugActiveProcess((DWORD)id))
8+
if (!DebugActiveProcess(reinterpret_cast<DWORD>(id)))
99
{
1010
return false;
1111
}
@@ -17,7 +17,7 @@ bool __stdcall AttachDebuggerToProcess(RC_Pointer id)
1717

1818
void __stdcall DetachDebuggerFromProcess(RC_Pointer id)
1919
{
20-
DebugActiveProcessStop((DWORD)id);
20+
DebugActiveProcessStop(reinterpret_cast<DWORD>(id));
2121
}
2222

2323
bool __stdcall AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
@@ -30,8 +30,8 @@ bool __stdcall AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
3030

3131
auto result = false;
3232

33-
evt->ProcessId = (RC_Pointer)_evt.dwProcessId;
34-
evt->ThreadId = (RC_Pointer)_evt.dwThreadId;
33+
evt->ProcessId = reinterpret_cast<RC_Pointer>(_evt.dwProcessId);
34+
evt->ThreadId = reinterpret_cast<RC_Pointer>(_evt.dwThreadId);
3535

3636
switch (_evt.dwDebugEventCode)
3737
{
@@ -83,34 +83,34 @@ bool __stdcall AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
8383
// Copy registers.
8484
auto& reg = evt->ExceptionInfo.Registers;
8585
#ifdef _WIN64
86-
reg.Rax = (RC_Pointer)ctx.Rax;
87-
reg.Rbx = (RC_Pointer)ctx.Rbx;
88-
reg.Rcx = (RC_Pointer)ctx.Rcx;
89-
reg.Rdx = (RC_Pointer)ctx.Rdx;
90-
reg.Rdi = (RC_Pointer)ctx.Rdi;
91-
reg.Rsi = (RC_Pointer)ctx.Rsi;
92-
reg.Rsp = (RC_Pointer)ctx.Rsp;
93-
reg.Rbp = (RC_Pointer)ctx.Rbp;
94-
reg.Rip = (RC_Pointer)ctx.Rip;
95-
96-
reg.R8 = (RC_Pointer)ctx.R8;
97-
reg.R9 = (RC_Pointer)ctx.R9;
98-
reg.R10 = (RC_Pointer)ctx.R10;
99-
reg.R11 = (RC_Pointer)ctx.R11;
100-
reg.R12 = (RC_Pointer)ctx.R12;
101-
reg.R13 = (RC_Pointer)ctx.R13;
102-
reg.R14 = (RC_Pointer)ctx.R14;
103-
reg.R15 = (RC_Pointer)ctx.R15;
86+
reg.Rax = reinterpret_cast<RC_Pointer>(ctx.Rax);
87+
reg.Rbx = reinterpret_cast<RC_Pointer>(ctx.Rbx);
88+
reg.Rcx = reinterpret_cast<RC_Pointer>(ctx.Rcx);
89+
reg.Rdx = reinterpret_cast<RC_Pointer>(ctx.Rdx);
90+
reg.Rdi = reinterpret_cast<RC_Pointer>(ctx.Rdi);
91+
reg.Rsi = reinterpret_cast<RC_Pointer>(ctx.Rsi);
92+
reg.Rsp = reinterpret_cast<RC_Pointer>(ctx.Rsp);
93+
reg.Rbp = reinterpret_cast<RC_Pointer>(ctx.Rbp);
94+
reg.Rip = reinterpret_cast<RC_Pointer>(ctx.Rip);
95+
96+
reg.R8 = reinterpret_cast<RC_Pointer>(ctx.R8);
97+
reg.R9 = reinterpret_cast<RC_Pointer>(ctx.R9);
98+
reg.R10 = reinterpret_cast<RC_Pointer>(ctx.R10);
99+
reg.R11 = reinterpret_cast<RC_Pointer>(ctx.R11);
100+
reg.R12 = reinterpret_cast<RC_Pointer>(ctx.R12);
101+
reg.R13 = reinterpret_cast<RC_Pointer>(ctx.R13);
102+
reg.R14 = reinterpret_cast<RC_Pointer>(ctx.R14);
103+
reg.R15 = reinterpret_cast<RC_Pointer>(ctx.R15);
104104
#else
105-
reg.Eax = (RC_Pointer)ctx.Eax;
106-
reg.Ebx = (RC_Pointer)ctx.Ebx;
107-
reg.Ecx = (RC_Pointer)ctx.Ecx;
108-
reg.Edx = (RC_Pointer)ctx.Edx;
109-
reg.Edi = (RC_Pointer)ctx.Edi;
110-
reg.Esi = (RC_Pointer)ctx.Esi;
111-
reg.Esp = (RC_Pointer)ctx.Esp;
112-
reg.Ebp = (RC_Pointer)ctx.Ebp;
113-
reg.Eip = (RC_Pointer)ctx.Eip;
105+
reg.Eax = reinterpret_cast<RC_Pointer>(ctx.Eax);
106+
reg.Ebx = reinterpret_cast<RC_Pointer>(ctx.Ebx);
107+
reg.Ecx = reinterpret_cast<RC_Pointer>(ctx.Ecx);
108+
reg.Edx = reinterpret_cast<RC_Pointer>(ctx.Edx);
109+
reg.Edi = reinterpret_cast<RC_Pointer>(ctx.Edi);
110+
reg.Esi = reinterpret_cast<RC_Pointer>(ctx.Esi);
111+
reg.Esp = reinterpret_cast<RC_Pointer>(ctx.Esp);
112+
reg.Ebp = reinterpret_cast<RC_Pointer>(ctx.Ebp);
113+
reg.Eip = reinterpret_cast<RC_Pointer>(ctx.Eip);
114114
#endif
115115

116116
CloseHandle(handle);
@@ -140,7 +140,7 @@ void __stdcall HandleDebugEvent(DebugEvent* evt)
140140
break;
141141
}
142142

143-
ContinueDebugEvent((DWORD)evt->ProcessId, (DWORD)evt->ThreadId, continueStatus);
143+
ContinueDebugEvent(reinterpret_cast<DWORD>(evt->ProcessId), reinterpret_cast<DWORD>(evt->ThreadId), continueStatus);
144144
}
145145

146146
bool __stdcall SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, HardwareBreakpointRegister reg, HardwareBreakpointTrigger type, HardwareBreakpointSize size, bool set)
@@ -156,7 +156,7 @@ bool __stdcall SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, Hardware
156156

157157
if (set)
158158
{
159-
addressValue = (decltype(CONTEXT::Dr0))address;
159+
addressValue = reinterpret_cast<decltype(CONTEXT::Dr0)>(address);
160160

161161
if (type == HardwareBreakpointTrigger::Execute)
162162
accessValue = 0;
@@ -175,24 +175,24 @@ bool __stdcall SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, Hardware
175175
lengthValue = 2;
176176
}
177177

178-
auto handle = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
179-
if (handle != INVALID_HANDLE_VALUE)
178+
auto snapshotHandle = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
179+
if (snapshotHandle != INVALID_HANDLE_VALUE)
180180
{
181181
THREADENTRY32 te32 = {};
182182
te32.dwSize = sizeof(THREADENTRY32);
183-
if (Thread32First(handle, &te32))
183+
if (Thread32First(snapshotHandle, &te32))
184184
{
185185
do
186186
{
187-
if (te32.th32OwnerProcessID == (DWORD)id)
187+
if (te32.th32OwnerProcessID == reinterpret_cast<DWORD>(id))
188188
{
189-
auto handle = OpenThread(THREAD_SUSPEND_RESUME | THREAD_GET_CONTEXT | THREAD_SET_CONTEXT, FALSE, te32.th32ThreadID);
189+
auto threadHandle = OpenThread(THREAD_SUSPEND_RESUME | THREAD_GET_CONTEXT | THREAD_SET_CONTEXT, FALSE, te32.th32ThreadID);
190190

191-
SuspendThread(handle);
191+
SuspendThread(threadHandle);
192192

193193
CONTEXT ctx = { 0 };
194194
ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS;
195-
GetThreadContext(handle, &ctx);
195+
GetThreadContext(threadHandle, &ctx);
196196

197197
DebugRegister7 dr7;
198198
dr7.Value = ctx.Dr7;
@@ -227,16 +227,16 @@ bool __stdcall SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, Hardware
227227

228228
ctx.Dr7 = dr7.Value;
229229

230-
SetThreadContext(handle, &ctx);
230+
SetThreadContext(threadHandle, &ctx);
231231

232-
ResumeThread(handle);
232+
ResumeThread(threadHandle);
233233

234-
CloseHandle(handle);
234+
CloseHandle(threadHandle);
235235
}
236-
} while (Thread32Next(handle, &te32));
236+
} while (Thread32Next(snapshotHandle, &te32));
237237
}
238238

239-
CloseHandle(handle);
239+
CloseHandle(snapshotHandle);
240240
}
241241

242242
return true;

0 commit comments

Comments
 (0)