Forum posts for alg.exe

results from debug diff from release

I have this code here:

#include 'windows.h'
#include 'Tlhelp32.h'
#include 'shellapi.h'
#include <wchar.h>
#include <fstream>

bool enumProcesses();

int main()
{
enumProcesses();
ShellExecute( NULL, L'open', L'log.txt', NULL, NULL, SW_SHOW );

return 0;
}



bool enumProcesses()
{
std::wofstream log('log.txt');
PROCESSENTRY32 lppe;
MODULEENTRY32 lpme;
HANDLE hSnapshot;
HANDLE mSnapshot;

lppe.dwSize = sizeof( PROCESSENTRY32 );
lpme.dwSize = sizeof( MODULEENTRY32 );
hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );

if( hSnapshot == INVALID_HANDLE_VALUE )
{
log << L'Error creating process snapshot.';
return false;
}

if( !Process32First( hSnapshot, &lppe ) )
{
log << L'Error enumerating first process.';
return false;
}
else
{
mSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, lppe.th32ProcessID );

if( mSnapshot != INVALID_HANDLE_VALUE )
{
Module32First( mSnapshot, &lpme );
}

if( wcscmp( lppe.szExeFile, L'[System Process]' ) != 0 )
{
log << lpme.szExePath << ' ';
}
}

while( Process32Next( hSnapshot, &lppe ) )
{
if( wcscmp( lppe.szExeFile, L'System' ) != 0 )
{
if( (mSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, lppe.th32ProcessID )) != INVALID_HANDLE_VALUE )
{
if( Module32First( mSnapshot, &lpme ) ) {
log << lpme.szExePath << ' ';
}

}
}
}

CloseHandle( hSnapshot );
CloseHandle( mSnapshot );
log.close();

return true;
}


My problem is that whenever I debug this code in VC++ using F5 or CTRL + F5, it shows me all the processes but when I create a release version and run it, some things don't even show anymore and I'm not sure why..

Here's what I'm talking about:

release version:

C:WINDOWSExplorer.EXE
C:Program FilesJavajre6injusched.exe
C:WINDOWSsystem32ctfmon.exe
C:Program FilesMessengermsmsgs.exe
C:WINDOWSsystem32wscntfy.exe
C:WINDOWSsystem32wuauclt.exe
c:Program FilesMicrosoft Visual Studio 9.0Common7idemspdbsrv.exe
C:Program FilesMicrosoft Visual Studio 9.0Common7IDEdevenv.exe
C:Program FilesMozilla Firefoxfirefox.exe
C:Documents and SettingswindowsDesktopc++ projectsggggDebuggggg.exe


log created on debug:

SystemRootSystem32smss.exe
??C:WINDOWSsystem32csrss.exe
??C:WINDOWSsystem32winlogon.exe
C:WINDOWSsystem32services.exe
C:WINDOWSsystem32lsass.exe
C:WINDOWSsystem32svchost.exe
C:WINDOWSsystem32svchost.exe
C:WINDOWSSystem32svchost.exe
C:WINDOWSsystem32svchost.exe
C:WINDOWSsystem32svchost.exe
C:WINDOWSsystem32spoolsv.exe
C:WINDOWSExplorer.EXE
C:Program FilesJavajre6injusched.exe
C:WINDOWSsystem32ctfmon.exe
C:Program FilesMessengermsmsgs.exe
C:Program FilesJavajre6injqs.exe
c:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinnsqlservr.exe
c:Program FilesMicrosoft SQL Server90Sharedsqlwriter.exe
C:WINDOWSSystem32alg.exe
C:WINDOWSsystem32wscntfy.exe
C:WINDOWSsystem32wuauclt.exe
c:Program FilesMicrosoft Visual Studio 9.0Common7idemspdbsrv.exe
C:Program FilesMicrosoft Visual Studio 9.0Common7IDEdevenv.exe
C:Program FilesMozilla Firefoxfirefox.exe
C:WINDOWSsystem32NOTEPAD.EXE
C:WINDOWSsystem32cmd.exe
c:Documents and SettingswindowsDesktopc++ projectsggggReleasegggg.exe


Does it have something to do with permissions?

EDIT:

Looking at 1800 INFORMATION's post, I tried to 'force' it to run under SYSTEM account by using psexec -i -d -s and it worked... Is there any way I could run this without the need of doing such a thing?

View complete forum thread with replies

Other posts related to alg.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

Could not find system file when it actually exists
results from debug diff from release
can a windows service be spawned from something other than services.exe?
Exception during char operation

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.