mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 21:13:52 +00:00
1b7106dee1
- Fix compilation of a number of modules. - Delete outdated fmifs.h, the one from ReactOS includes should be used instead. - Move more libs to /lib directory. svn path=/trunk/; revision=34627
70 lines
1.8 KiB
C
70 lines
1.8 KiB
C
/* $Id$
|
|
*
|
|
* win32err.c
|
|
*
|
|
* Copyright (c) 1998 Mark Russinovich
|
|
* Systems Internals
|
|
* http://www.sysinternals.com/
|
|
*
|
|
* --------------------------------------------------------------------
|
|
*
|
|
* This software is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public License as
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
* License, or (at your option) any later version.
|
|
*
|
|
* This software is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this software; see the file COPYING.LIB. If
|
|
* not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
|
* Cambridge, MA 02139, USA.
|
|
*
|
|
* --------------------------------------------------------------------
|
|
*
|
|
* Print a Win32 error.
|
|
*
|
|
* 1999 February (Emanuele Aliberti)
|
|
* Taken from chkdskx.c and formatx.c by Mark Russinovich
|
|
* to be used in all sysutils.
|
|
*/
|
|
#include <windows.h>
|
|
#include <stdio.h>
|
|
|
|
//----------------------------------------------------------------------
|
|
//
|
|
// PrintWin32Error
|
|
//
|
|
// Takes the win32 error code and prints the text version.
|
|
//
|
|
//----------------------------------------------------------------------
|
|
void
|
|
PrintWin32Error(
|
|
PWCHAR Message,
|
|
DWORD ErrorCode
|
|
)
|
|
{
|
|
PVOID lpMsgBuf;
|
|
|
|
FormatMessageW(
|
|
(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM),
|
|
NULL,
|
|
ErrorCode,
|
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
|
(LPWSTR)& lpMsgBuf,
|
|
0,
|
|
NULL
|
|
);
|
|
wprintf(
|
|
L"%s: %s\n",
|
|
Message,
|
|
lpMsgBuf
|
|
);
|
|
LocalFree( lpMsgBuf );
|
|
}
|
|
|
|
|
|
/* EOF */
|