Index: lang/ru-RU.rc =================================================================== --- lang/ru-RU.rc (revision 41443) +++ lang/ru-RU.rc (working copy) @@ -10,7 +10,8 @@ -l\t\t\tЗавершение сеанса\n\ -s\t\t\tВыключение этого компьютера\n\ -r\t\t\tПерезагрузка этого компьютера\n\ - -f\t\t\tИгнорирование запущенных программ и завершение их без предупреждения\n\ - \t\t\tЕсли вы не указали другие параметры, то эта опция приведет к\n\ - \t\t\tзавершению сеанса." + -f\t\t\tИгнорирование запущенных программ и завершение их без\n\ + \t\t\tпредупреждения\n\ + \t\t\tЕсли вы не указали другие параметры, то эта опция\n\ + \t\t\tприведет к завершению сеанса." END Index: shutdown.c =================================================================== --- shutdown.c (revision 41443) +++ shutdown.c (working copy) @@ -10,12 +10,21 @@ // Print information about which commandline arguments the program accepts. static void PrintUsage() { LPTSTR lpUsage = NULL; + DWORD errLength; // error message length + LPTSTR resMsg; // for error message in OEM symbols if( AllocAndLoadString( &lpUsage, GetModuleHandle(NULL), IDS_USAGE ) ) { - _putts( lpUsage ); + errLength = strlen(lpUsage) + 1; + resMsg = (LPTSTR)LocalAlloc(LPTR, errLength * sizeof(TCHAR)); + CharToOemBuff(lpUsage, resMsg, errLength); + + _putts( resMsg ); + + LocalFree(lpUsage); + LocalFree(resMsg); } } @@ -126,20 +135,28 @@ void DisplayLastError() { int errorCode = GetLastError(); - LPTSTR lpMsgBuf; + LPTSTR lpMsgBuf = NULL; + DWORD errLength; // error message length + LPTSTR resMsg; // for error message in OEM symbols // Display the error message to the user - FormatMessage( + errLength = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, LANG_USER_DEFAULT, (LPTSTR) &lpMsgBuf, 0, - NULL); + NULL) + 1; - _ftprintf(stderr, lpMsgBuf); + resMsg = (LPTSTR)LocalAlloc(LPTR, errLength * sizeof(TCHAR)); + CharToOemBuff(lpMsgBuf, resMsg, errLength); + + _ftprintf(stderr, resMsg); _ftprintf(stderr, _T("Error code: %d\n"), errorCode); + + LocalFree(lpMsgBuf); + LocalFree(resMsg); } void EnableShutdownPrivileges()