2 * lpr for cygwin/windows
4 * Copyright (C) 2000-2003 Rick Rankin
5 * http://www.cygwin.com/ml/cygwin/2000-07/msg00320.html
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * See the COPYING file for full license information.
23 #include "src/lpr/Win32Utils.hh"
26 string
Win32Utils::getErrorMessage()
28 return Win32Utils::getErrorMessage(GetLastError());
31 string
Win32Utils::getErrorMessage(DWORD code
)
34 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
|
35 FORMAT_MESSAGE_FROM_SYSTEM
|
36 FORMAT_MESSAGE_IGNORE_INSERTS
,
39 MAKELANGID(LANG_NEUTRAL
, SUBLANG_DEFAULT
), // Default language
44 string msg
= lpMsgBuf
;