xhmikosr / psvince Goto Github PK
View Code? Open in Web Editor NEWPSVince is a DLL to detect if a module is loaded in memory for Inno Setup
PSVince is a DLL to detect if a module is loaded in memory for Inno Setup
It would be nice to finally close the handleToSnapshot opened in the new function EnumProcs2.
Also see the MIcrosoft example at href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms686701(v=vs.85).aspx
My overall suggestion for code enhancement:
BOOL WINAPI EnumProcs2(char* procname)
{
//MessageBox(nullptr, procname, "msg", MB_OK);
HANDLE handleToSnapshot;
PROCESSENTRY32 procEntry;
BOOL retcode = FALSE;
// Take a snapshot of all processes in the system
handleToSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (handleToSnapshot != INVALID_HANDLE_VALUE) {
procEntry.dwSize = sizeof(PROCESSENTRY32);
if (Process32First(handleToSnapshot, &procEntry)) {
do {
//MessageBox(nullptr, procEntry.szExeFile, "msg", MB_OK);
if (_stricmp(procname, procEntry.szExeFile) == 0) {
retcode = TRUE;
break;
}
} while (Process32Next(handleToSnapshot, &procEntry));
}
// Destroy the snapshot handle
CloseHandle(handleToSnapshot);
}
return retcode;
}
P.S.: My tests on 64 bit Windows 7 and 32 bit Windows XP carried out, that IsModuleLoaded2 actually detects both, 64 bit and 32 bit processes, while IsModuleLoaded only detects 32 bit processes.
As Windows 95 is not supported anymore in psvince.dll, "#include <vdmdbg.h>" may be removed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.