ReactOS
0.4.16-dev-814-g656a5dc
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
win32err.c
Go to the documentation of this file.
1
/*
2
* win32err.c
3
*
4
* Copyright (c) 1998 Mark Russinovich
5
* Systems Internals
6
* http://www.sysinternals.com/
7
*
8
* --------------------------------------------------------------------
9
*
10
* This software is free software; you can redistribute it and/or
11
* modify it under the terms of the GNU Library General Public License as
12
* published by the Free Software Foundation; either version 2 of the
13
* License, or (at your option) any later version.
14
*
15
* This software is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
* Library General Public License for more details.
19
*
20
* You should have received a copy of the GNU Library General Public
21
* License along with this software; see the file COPYING.LIB. If
22
* not, write to the Free Software Foundation, Inc., 675 Mass Ave,
23
* Cambridge, MA 02139, USA.
24
*
25
* --------------------------------------------------------------------
26
*
27
* Print a Win32 error.
28
*
29
* 1999 February (Emanuele Aliberti)
30
* Taken from chkdskx.c and formatx.c by Mark Russinovich
31
* to be used in all sysutils.
32
*/
33
#include <windows.h>
34
#include <stdio.h>
35
36
//----------------------------------------------------------------------
37
//
38
// PrintWin32Error
39
//
40
// Takes the win32 error code and prints the text version.
41
//
42
//----------------------------------------------------------------------
43
void
44
PrintWin32Error
(
45
PWCHAR
Message
,
46
DWORD
ErrorCode
47
)
48
{
49
LPWSTR
lpMsgBuf;
50
51
FormatMessageW
(
52
(
FORMAT_MESSAGE_ALLOCATE_BUFFER
|
FORMAT_MESSAGE_FROM_SYSTEM
),
53
NULL
,
54
ErrorCode
,
55
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
56
(
LPWSTR
)& lpMsgBuf,
57
0,
58
NULL
59
);
60
wprintf
(
61
L
"%s: %s\n"
,
62
Message
,
63
lpMsgBuf
64
);
65
LocalFree
( lpMsgBuf );
66
}
67
68
69
/* EOF */
NULL
#define NULL
Definition:
types.h:112
FormatMessageW
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition:
format_msg.c:583
Message
static const WCHAR Message[]
Definition:
register.c:74
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
LocalFree
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition:
heapmem.c:1594
ErrorCode
_In_ NDIS_ERROR_CODE ErrorCode
Definition:
ndis.h:4436
L
#define L(x)
Definition:
ntvdm.h:50
LANG_NEUTRAL
#define LANG_NEUTRAL
Definition:
nls.h:22
MAKELANGID
#define MAKELANGID(p, s)
Definition:
nls.h:15
SUBLANG_DEFAULT
#define SUBLANG_DEFAULT
Definition:
nls.h:168
PWCHAR
uint16_t * PWCHAR
Definition:
typedefs.h:56
wprintf
#define wprintf(...)
Definition:
whoami.c:18
PrintWin32Error
void PrintWin32Error(PWCHAR Message, DWORD ErrorCode)
Definition:
win32err.c:44
FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition:
winbase.h:449
FORMAT_MESSAGE_ALLOCATE_BUFFER
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition:
winbase.h:445
LPWSTR
WCHAR * LPWSTR
Definition:
xmlstorage.h:184
modules
rosapps
lib
win32err
win32err.c
Generated on Thu Mar 13 2025 06:06:43 for ReactOS by
1.9.6