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
ccff4586
Commit
ccff4586
authored
Dec 03, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert change for handling user overrides as numbers and reimplement
it differently.
parent
5e69f118
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
35 deletions
+34
-35
locale.c
dlls/kernel/locale.c
+34
-35
No files found.
dlls/kernel/locale.c
View file @
ccff4586
...
@@ -739,7 +739,7 @@ static const WCHAR *get_locale_value_name( DWORD lctype )
...
@@ -739,7 +739,7 @@ static const WCHAR *get_locale_value_name( DWORD lctype )
* Retrieve user-modified locale info from the registry.
* Retrieve user-modified locale info from the registry.
* Return length, 0 on error, -1 if not found.
* Return length, 0 on error, -1 if not found.
*/
*/
static
INT
get_registry_locale_info
(
UINT
flags
,
LPCWSTR
value
,
LPWSTR
buffer
,
INT
len
)
static
INT
get_registry_locale_info
(
LPCWSTR
value
,
LPWSTR
buffer
,
INT
len
)
{
{
DWORD
size
;
DWORD
size
;
INT
ret
;
INT
ret
;
...
@@ -752,9 +752,9 @@ static INT get_registry_locale_info( UINT flags, LPCWSTR value, LPWSTR buffer, I
...
@@ -752,9 +752,9 @@ static INT get_registry_locale_info( UINT flags, LPCWSTR value, LPWSTR buffer, I
if
(
!
(
hkey
=
create_registry_key
()))
return
-
1
;
if
(
!
(
hkey
=
create_registry_key
()))
return
-
1
;
RtlInitUnicodeString
(
&
nameW
,
value
);
RtlInitUnicodeString
(
&
nameW
,
value
);
size
=
info_size
+
(
flags
&
LOCALE_RETURN_NUMBER
?
16
:
len
)
*
sizeof
(
WCHAR
);
size
=
info_size
+
len
*
sizeof
(
WCHAR
);
if
(
!
(
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
+
sizeof
(
WCHAR
)
)))
if
(
!
(
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
{
{
NtClose
(
hkey
);
NtClose
(
hkey
);
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
...
@@ -767,42 +767,20 @@ static INT get_registry_locale_info( UINT flags, LPCWSTR value, LPWSTR buffer, I
...
@@ -767,42 +767,20 @@ static INT get_registry_locale_info( UINT flags, LPCWSTR value, LPWSTR buffer, I
if
(
!
status
)
if
(
!
status
)
{
{
ret
=
(
size
-
info_size
)
/
sizeof
(
WCHAR
);
ret
=
(
size
-
info_size
)
/
sizeof
(
WCHAR
);
/* append terminating nul if needed */
/* append terminating nul
l
if needed */
if
(
!
ret
||
((
WCHAR
*
)
info
->
Data
)[
ret
-
1
])
if
(
!
ret
||
((
WCHAR
*
)
info
->
Data
)[
ret
-
1
])
{
{
if
(
ret
<
len
||
!
buffer
)
if
(
ret
<
len
||
!
buffer
)
ret
++
;
{
((
WCHAR
*
)
info
->
Data
)[
ret
]
=
'\0'
;
ret
++
;
}
else
else
{
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
ret
=
0
;
ret
=
0
;
}
}
}
}
if
(
ret
&&
buffer
)
if
(
ret
)
{
if
(
flags
&
LOCALE_RETURN_NUMBER
)
{
UINT
number
;
WCHAR
*
end
;
number
=
strtolW
(
(
WCHAR
*
)
info
->
Data
,
&
end
,
10
);
if
(
*
end
)
{
{
SetLastError
(
ERROR_INVALID_FLAGS
);
memcpy
(
buffer
,
info
->
Data
,
(
ret
-
1
)
*
sizeof
(
WCHAR
)
);
ret
=
0
;
buffer
[
ret
-
1
]
=
0
;
}
else
{
if
(
buffer
)
memcpy
(
buffer
,
&
number
,
sizeof
(
number
)
);
ret
=
sizeof
(
UINT
)
/
sizeof
(
WCHAR
);
}
}
else
if
(
buffer
)
memcpy
(
buffer
,
info
->
Data
,
ret
*
sizeof
(
WCHAR
)
);
}
}
}
}
else
else
...
@@ -905,8 +883,6 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len )
...
@@ -905,8 +883,6 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len )
const
WCHAR
*
p
;
const
WCHAR
*
p
;
unsigned
int
i
;
unsigned
int
i
;
TRACE
(
"(0x%08lx,0x%08lx,%p,%d)
\n
"
,
lcid
,
lctype
,
buffer
,
len
);
if
(
len
<
0
||
(
len
&&
!
buffer
))
if
(
len
<
0
||
(
len
&&
!
buffer
))
{
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
...
@@ -927,9 +903,32 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len )
...
@@ -927,9 +903,32 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len )
if
(
value
)
if
(
value
)
{
{
ret
=
get_registry_locale_info
(
lcflags
&
LOCALE_RETURN_NUMBER
,
value
,
buffer
,
len
);
if
(
lcflags
&
LOCALE_RETURN_NUMBER
)
if
(
ret
!=
-
1
)
{
return
ret
;
WCHAR
tmp
[
16
];
ret
=
get_registry_locale_info
(
value
,
tmp
,
sizeof
(
tmp
)
/
sizeof
(
WCHAR
)
);
if
(
ret
>
0
)
{
WCHAR
*
end
;
UINT
number
=
strtolW
(
tmp
,
&
end
,
10
);
if
(
*
end
)
/* invalid number */
{
SetLastError
(
ERROR_INVALID_FLAGS
);
return
0
;
}
ret
=
sizeof
(
UINT
)
/
sizeof
(
WCHAR
);
if
(
!
buffer
)
return
ret
;
if
(
ret
>
len
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
0
;
}
memcpy
(
buffer
,
&
number
,
sizeof
(
number
)
);
}
}
else
ret
=
get_registry_locale_info
(
value
,
buffer
,
len
);
if
(
ret
!=
-
1
)
return
ret
;
}
}
}
}
...
...
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