ReactOS 0.4.16-dev-1946-g52006dd
GetUserDefaultLocaleName.c File Reference
#include "k32_vista.h"
#include <ndk/rtlfuncs.h>
Include dependency graph for GetUserDefaultLocaleName.c:

Go to the source code of this file.

Functions

INT WINAPI GetUserDefaultLocaleName (LPWSTR lpLocaleName, INT cchLocaleName)
 

Function Documentation

◆ GetUserDefaultLocaleName()

INT WINAPI GetUserDefaultLocaleName ( LPWSTR  lpLocaleName,
INT  cchLocaleName 
)

Definition at line 13 of file GetUserDefaultLocaleName.c.

16{
17 UNICODE_STRING LocaleNameString;
19
20 if (lpLocaleName == NULL)
21 {
23 return 0;
24 }
25
26 if (cchLocaleName <= 0)
27 {
29 return 0;
30 }
31
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 {
41 return 0;
42 }
43
44 return LocaleNameString.Length / sizeof(WCHAR);
45}
LONG NTSTATUS
Definition: precomp.h:26
_In_ int cchLocaleName
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
Status
Definition: gdiplustypes.h:25
NTSYSAPI NTSTATUS WINAPI RtlLcidToLocaleName(LCID, UNICODE_STRING *, ULONG, BOOLEAN)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define min(a, b)
Definition: monoChain.cc:55
#define LOCALE_NAME_MAX_LENGTH
#define LOCALE_USER_DEFAULT
unsigned short USHORT
Definition: pedump.c:61
USHORT MaximumLength
Definition: env_spec_w32.h:370
__wchar_t WCHAR
Definition: xmlstorage.h:180