ReactOS
0.4.16-dev-1537-g4e425b5
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
GetUserDefaultLocaleName.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS Win32 Base API
3
* LICENSE: MIT (https://spdx.org/licenses/MIT)
4
* PURPOSE: Implementation of GetUserDefaultLocaleName
5
* COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
6
*/
7
8
#include "
k32_vista.h
"
9
#include <
ndk/rtlfuncs.h
>
10
11
INT
12
WINAPI
13
GetUserDefaultLocaleName
(
14
LPWSTR
lpLocaleName,
15
INT
cchLocaleName
)
16
{
17
UNICODE_STRING
LocaleNameString;
18
NTSTATUS
Status
;
19
20
if
(lpLocaleName ==
NULL
)
21
{
22
SetLastError
(
ERROR_INVALID_PARAMETER
);
23
return
0;
24
}
25
26
if
(
cchLocaleName
<= 0)
27
{
28
SetLastError
(
ERROR_INVALID_PARAMETER
);
29
return
0;
30
}
31
32
cchLocaleName
=
min
(
cchLocaleName
,
LOCALE_NAME_MAX_LENGTH
);
33
LocaleNameString.
Buffer
= lpLocaleName;
34
LocaleNameString.
Length
= 0;
35
LocaleNameString.
MaximumLength
= (
USHORT
)(
cchLocaleName
*
sizeof
(
WCHAR
));
36
37
Status
=
RtlLcidToLocaleName
(
LOCALE_USER_DEFAULT
, &LocaleNameString, 0,
FALSE
);
38
if
(!
NT_SUCCESS
(
Status
))
39
{
40
SetLastError
(
RtlNtStatusToDosError
(
Status
));
41
return
0;
42
}
43
44
return
LocaleNameString.
Length
/
sizeof
(
WCHAR
);
45
}
GetUserDefaultLocaleName
INT WINAPI GetUserDefaultLocaleName(LPWSTR lpLocaleName, INT cchLocaleName)
Definition:
GetUserDefaultLocaleName.c:13
NTSTATUS
LONG NTSTATUS
Definition:
precomp.h:26
cchLocaleName
_In_ int cchLocaleName
Definition:
corecrt_internal.h:1384
NULL
#define NULL
Definition:
types.h:112
FALSE
#define FALSE
Definition:
types.h:117
NT_SUCCESS
#define NT_SUCCESS(StatCode)
Definition:
apphelp.c:33
ERROR_INVALID_PARAMETER
#define ERROR_INVALID_PARAMETER
Definition:
compat.h:101
SetLastError
#define SetLastError(x)
Definition:
compat.h:752
Status
Status
Definition:
gdiplustypes.h:25
RtlLcidToLocaleName
NTSYSAPI NTSTATUS WINAPI RtlLcidToLocaleName(LCID, UNICODE_STRING *, ULONG, BOOLEAN)
RtlNtStatusToDosError
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
k32_vista.h
min
#define min(a, b)
Definition:
monoChain.cc:55
rtlfuncs.h
LOCALE_NAME_MAX_LENGTH
#define LOCALE_NAME_MAX_LENGTH
LOCALE_USER_DEFAULT
#define LOCALE_USER_DEFAULT
USHORT
unsigned short USHORT
Definition:
pedump.c:61
_UNICODE_STRING
Definition:
env_spec_w32.h:368
_UNICODE_STRING::Length
USHORT Length
Definition:
env_spec_w32.h:369
_UNICODE_STRING::MaximumLength
USHORT MaximumLength
Definition:
env_spec_w32.h:370
_UNICODE_STRING::Buffer
PWSTR Buffer
Definition:
env_spec_w32.h:371
INT
int32_t INT
Definition:
typedefs.h:58
WINAPI
#define WINAPI
Definition:
msvc.h:6
WCHAR
__wchar_t WCHAR
Definition:
xmlstorage.h:180
LPWSTR
WCHAR * LPWSTR
Definition:
xmlstorage.h:184
dll
win32
kernel32
kernel32_vista
GetUserDefaultLocaleName.c
Generated on Sat Jul 26 2025 06:04:20 for ReactOS by
1.9.6