Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
dd505fab
Commit
dd505fab
authored
Nov 07, 2019
by
João Diogo Ferreira
Committed by
Alexandre Julliard
Nov 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Move Get/SetUserGeoID() to after the geoinfo struct.
Signed-off-by:
João Diogo Craveiro Ferreira
<
devilj@outlook.pt
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fde235da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
75 deletions
+74
-75
locale.c
dlls/kernel32/locale.c
+74
-75
No files found.
dlls/kernel32/locale.c
View file @
dd505fab
...
...
@@ -3644,81 +3644,6 @@ BOOL WINAPI InvalidateNLSCache(void)
}
/******************************************************************************
* GetUserGeoID (KERNEL32.@)
*/
GEOID
WINAPI
GetUserGeoID
(
GEOCLASS
GeoClass
)
{
GEOID
ret
=
GEOID_NOT_AVAILABLE
;
static
const
WCHAR
geoW
[]
=
{
'G'
,
'e'
,
'o'
,
0
};
static
const
WCHAR
nationW
[]
=
{
'N'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
WCHAR
bufferW
[
40
],
*
end
;
DWORD
count
;
HANDLE
hkey
,
hSubkey
=
0
;
UNICODE_STRING
keyW
;
const
KEY_VALUE_PARTIAL_INFORMATION
*
info
=
(
KEY_VALUE_PARTIAL_INFORMATION
*
)
bufferW
;
RtlInitUnicodeString
(
&
keyW
,
nationW
);
count
=
sizeof
(
bufferW
);
if
(
!
(
hkey
=
create_registry_key
()))
return
ret
;
switch
(
GeoClass
){
case
GEOCLASS_NATION
:
if
((
hSubkey
=
NLS_RegOpenKey
(
hkey
,
geoW
)))
{
if
((
NtQueryValueKey
(
hSubkey
,
&
keyW
,
KeyValuePartialInformation
,
bufferW
,
count
,
&
count
)
==
STATUS_SUCCESS
)
&&
info
->
DataLength
)
ret
=
strtolW
((
LPCWSTR
)
info
->
Data
,
&
end
,
10
);
}
break
;
case
GEOCLASS_REGION
:
FIXME
(
"GEOCLASS_REGION not handled yet
\n
"
);
break
;
}
NtClose
(
hkey
);
if
(
hSubkey
)
NtClose
(
hSubkey
);
return
ret
;
}
/******************************************************************************
* SetUserGeoID (KERNEL32.@)
*/
BOOL
WINAPI
SetUserGeoID
(
GEOID
GeoID
)
{
static
const
WCHAR
geoW
[]
=
{
'G'
,
'e'
,
'o'
,
0
};
static
const
WCHAR
nationW
[]
=
{
'N'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
formatW
[]
=
{
'%'
,
'i'
,
0
};
UNICODE_STRING
nameW
,
keyW
;
WCHAR
bufferW
[
10
];
OBJECT_ATTRIBUTES
attr
;
HANDLE
hkey
;
if
(
!
(
hkey
=
create_registry_key
()))
return
FALSE
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
hkey
;
attr
.
ObjectName
=
&
nameW
;
attr
.
Attributes
=
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
geoW
);
RtlInitUnicodeString
(
&
keyW
,
nationW
);
if
(
NtCreateKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
)
!=
STATUS_SUCCESS
)
{
NtClose
(
attr
.
RootDirectory
);
return
FALSE
;
}
sprintfW
(
bufferW
,
formatW
,
GeoID
);
NtSetValueKey
(
hkey
,
&
keyW
,
0
,
REG_SZ
,
bufferW
,
(
strlenW
(
bufferW
)
+
1
)
*
sizeof
(
WCHAR
));
NtClose
(
attr
.
RootDirectory
);
NtClose
(
hkey
);
return
TRUE
;
}
/******************************************************************************
* EnumUILanguagesA (KERNEL32.@)
*/
BOOL
WINAPI
EnumUILanguagesA
(
UILANGUAGE_ENUMPROCA
proc
,
DWORD
flags
,
LONG_PTR
param
)
...
...
@@ -4070,6 +3995,80 @@ static const struct geoinfo_t *get_geoinfo_dataptr(GEOID geoid)
}
/******************************************************************************
* GetUserGeoID (KERNEL32.@)
*/
GEOID
WINAPI
GetUserGeoID
(
GEOCLASS
geoclass
)
{
GEOID
ret
=
GEOID_NOT_AVAILABLE
;
static
const
WCHAR
geoW
[]
=
{
'G'
,
'e'
,
'o'
,
0
};
static
const
WCHAR
nationW
[]
=
{
'N'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
WCHAR
bufferW
[
40
],
*
end
;
HANDLE
hkey
,
hsubkey
=
0
;
UNICODE_STRING
keyW
;
const
KEY_VALUE_PARTIAL_INFORMATION
*
info
=
(
KEY_VALUE_PARTIAL_INFORMATION
*
)
bufferW
;
DWORD
count
=
sizeof
(
bufferW
);
RtlInitUnicodeString
(
&
keyW
,
nationW
);
if
(
!
(
hkey
=
create_registry_key
()))
return
ret
;
switch
(
geoclass
)
{
case
GEOCLASS_NATION
:
if
((
hsubkey
=
NLS_RegOpenKey
(
hkey
,
geoW
)))
{
if
((
NtQueryValueKey
(
hsubkey
,
&
keyW
,
KeyValuePartialInformation
,
bufferW
,
count
,
&
count
)
==
STATUS_SUCCESS
)
&&
info
->
DataLength
)
ret
=
strtolW
((
const
WCHAR
*
)
info
->
Data
,
&
end
,
10
);
}
break
;
case
GEOCLASS_REGION
:
FIXME
(
"GEOCLASS_REGION not handled yet
\n
"
);
break
;
}
NtClose
(
hkey
);
if
(
hsubkey
)
NtClose
(
hsubkey
);
return
ret
;
}
/******************************************************************************
* SetUserGeoID (KERNEL32.@)
*/
BOOL
WINAPI
SetUserGeoID
(
GEOID
geoid
)
{
static
const
WCHAR
geoW
[]
=
{
'G'
,
'e'
,
'o'
,
0
};
static
const
WCHAR
nationW
[]
=
{
'N'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
formatW
[]
=
{
'%'
,
'i'
,
0
};
UNICODE_STRING
nameW
,
keyW
;
WCHAR
bufferW
[
10
];
OBJECT_ATTRIBUTES
attr
;
HANDLE
hkey
;
if
(
!
(
hkey
=
create_registry_key
()))
return
FALSE
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
hkey
;
attr
.
ObjectName
=
&
nameW
;
attr
.
Attributes
=
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
geoW
);
RtlInitUnicodeString
(
&
keyW
,
nationW
);
if
(
NtCreateKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
)
!=
STATUS_SUCCESS
)
{
NtClose
(
attr
.
RootDirectory
);
return
FALSE
;
}
sprintfW
(
bufferW
,
formatW
,
geoid
);
NtSetValueKey
(
hkey
,
&
keyW
,
0
,
REG_SZ
,
bufferW
,
(
strlenW
(
bufferW
)
+
1
)
*
sizeof
(
WCHAR
));
NtClose
(
attr
.
RootDirectory
);
NtClose
(
hkey
);
return
TRUE
;
}
/******************************************************************************
* GetGeoInfoW (KERNEL32.@)
*/
INT
WINAPI
GetGeoInfoW
(
GEOID
geoid
,
GEOTYPE
geotype
,
LPWSTR
data
,
int
data_len
,
LANGID
lang
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment