* WINDOWS function to display the last system error. */
| 789 | * WINDOWS function to display the last system error. |
| 790 | */ |
| 791 | void ASConsole::displayLastError() |
| 792 | { |
| 793 | LPSTR msgBuf; |
| 794 | DWORD lastError = GetLastError(); |
| 795 | FormatMessage( |
| 796 | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, |
| 797 | NULL, |
| 798 | lastError, |
| 799 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language |
| 800 | (LPSTR) &msgBuf, |
| 801 | 0, |
| 802 | NULL |
| 803 | ); |
| 804 | // Display the string. |
| 805 | (*_err) << "Error (" << lastError << ") " << msgBuf << endl; |
| 806 | // Free the buffer. |
| 807 | LocalFree(msgBuf); |
| 808 | } |
| 809 | |
| 810 | /** |
| 811 | * WINDOWS function to get the current directory. |
nothing calls this directly
no outgoing calls
no test coverage detected