| 345 | } |
| 346 | |
| 347 | BOOL 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 | } |
no outgoing calls
no test coverage detected