summaryrefslogtreecommitdiff
path: root/plugins/Variables/src/enumprocs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Variables/src/enumprocs.cpp')
-rw-r--r--plugins/Variables/src/enumprocs.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/Variables/src/enumprocs.cpp b/plugins/Variables/src/enumprocs.cpp
index 7ae68ed978..e35accfd0e 100644
--- a/plugins/Variables/src/enumprocs.cpp
+++ b/plugins/Variables/src/enumprocs.cpp
@@ -44,26 +44,24 @@ typedef struct {
BOOL WINAPI EnumProcs(PROCENUMPROC lpProc, LPARAM lParam)
{
- OSVERSIONINFO osver;
- HANDLE hSnapShot = NULL;
LPDWORD lpdwPIDs = NULL;
- PROCESSENTRY32 procentry;
- BOOL bFlag;
// Retrieve the OS version
+ OSVERSIONINFO osver;
osver.dwOSVersionInfoSize = sizeof(osver);
if (!GetVersionEx(&osver))
return FALSE;
if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS || (osver.dwPlatformId == VER_PLATFORM_WIN32_NT && osver.dwMajorVersion > 4)) {
// Get a handle to a Toolhelp snapshot of all processes.
- hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+ HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnapShot == INVALID_HANDLE_VALUE)
return FALSE;
// Get the first process' information.
+ PROCESSENTRY32 procentry;
procentry.dwSize = sizeof(PROCESSENTRY32);
- bFlag = Process32First(hSnapShot, &procentry);
+ BOOL bFlag = Process32First(hSnapShot, &procentry);
// While there are processes, keep looping.
while (bFlag) {