MCPcopy Create free account
hub / github.com/NtQuery/Scylla / writeToLogFile

Function writeToLogFile

Plugins/Sources/Imprec_Wrapper_DLL.cpp:347–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347BOOL writeToLogFile(const char * text)
348{
349 DWORD lpNumberOfBytesWritten = 0;
350 BOOL wfRet = 0;
351 HANDLE hFile = 0;
352
353 hFile = CreateFileA(logFilePath, GENERIC_WRITE, 0, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); //open log file for writing
354
355 if (hFile == INVALID_HANDLE_VALUE)
356 {
357 return FALSE;
358 }
359
360 SetFilePointer(hFile, 0, 0, FILE_END); //set file pointer to the end of file
361
362 if (WriteFile(hFile, text, (DWORD)lstrlenA(text), &lpNumberOfBytesWritten, 0)) //write message to logfile
363 {
364 wfRet = TRUE;
365 }
366 else
367 {
368 wfRet = FALSE;
369 }
370
371 CloseHandle(hFile);
372 return wfRet;
373}

Callers 4

DllMainFunction · 0.70
getImprecPluginFunction · 0.70
getMappedViewFunction · 0.70
resolveImportsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected