Moderatori: Dylan666, hydra, gahan
Dylan666 ha scritto:A chi interessasse alla fine ho optato per questo:
Process Logger 1.5
#include <windows.h>
#include <string>
using namespace std;
#define MUTEX "ZelloProcessLogger"
#define LOGFILE "c:\\temp\\logfile.log"
BOOL WINAPI DllMain(HINSTANCE hi, DWORD dwReason,LPVOID)
{
if(DLL_PROCESS_ATTACH==dwReason)
{
//acquire mutex
HANDLE hMutex=CreateMutex(NULL,FALSE,MUTEX);
WaitForSingleObject(hMutex,INFINITE);
HANDLE hFile=CreateFile(
LOGFILE,
GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL
);
SetFilePointer(hFile,0,NULL,FILE_END);
SYSTEMTIME st;
GetLocalTime(&st);
char buf[MAX_PATH];
GetDateFormat(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&st,NULL,(char*)buf,MAX_PATH);
string file=buf;
GetTimeFormat(LOCALE_USER_DEFAULT,0,&st,NULL,(char*)buf,MAX_PATH);
file+=" ";
file+=buf;
GetModuleFileName(NULL,(char*)buf,MAX_PATH);
file+=" - "+string(buf)+"\n";
DWORD dwDummy;
WriteFile(hFile,(void*)file.c_str(),file.length(),&dwDummy,NULL);
CloseHandle(hFile);
ReleaseMutex(hMutex);
CloseHandle(hMutex);
}
return TRUE;
}
Sergio1983 ha scritto:Dylan666 ha scritto:A chi interessasse alla fine ho optato per questo:
Process Logger 1.5
Lo recensisco in Download molto presto. Grazie Dylan.
Dylan666 ha scritto:Mettetelo pure sul server a parte dato che è ormai scomparso...
Errore generic host process Win32 svchost e non solo Autore: PlXEL |
Forum: Sistemi Operativi Windows Risposte: 10 |
Visitano il forum: Nessuno e 29 ospiti