Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
cc326821
Commit
cc326821
authored
Oct 28, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sapi: Zero terminate some WCHAR strings.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5d179e4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
token.c
dlls/sapi/token.c
+7
-7
No files found.
dlls/sapi/token.c
View file @
cc326821
...
@@ -372,28 +372,28 @@ static HRESULT WINAPI token_category_EnumValues( ISpObjectTokenCategory *iface,
...
@@ -372,28 +372,28 @@ static HRESULT WINAPI token_category_EnumValues( ISpObjectTokenCategory *iface,
static
HRESULT
parse_cat_id
(
const
WCHAR
*
str
,
HKEY
*
root
,
const
WCHAR
**
sub_key
)
static
HRESULT
parse_cat_id
(
const
WCHAR
*
str
,
HKEY
*
root
,
const
WCHAR
**
sub_key
)
{
{
static
const
WCHAR
HKLM
[]
=
{
'H'
,
'K'
,
'E'
,
'Y'
,
'_'
,
'L'
,
'O'
,
'C'
,
'A'
,
'L'
,
'_'
,
'M'
,
'A'
,
'C'
,
'H'
,
'I'
,
'N'
,
'E'
,
'\\'
};
static
const
WCHAR
HKCU
[]
=
{
'H'
,
'K'
,
'E'
,
'Y'
,
'_'
,
'C'
,
'U'
,
'R'
,
'R'
,
'E'
,
'N'
,
'T'
,
'_'
,
'U'
,
'S'
,
'E'
,
'R'
,
'\\'
};
struct
table
struct
table
{
{
const
WCHAR
*
name
;
const
WCHAR
*
name
;
int
size
;
unsigned
int
len
;
HKEY
key
;
HKEY
key
;
}
table
[]
=
}
table
[]
=
{
{
{
HKLM
,
sizeof
(
HKLM
),
HKEY_LOCAL_MACHINE
},
#define X(s) s, ARRAY_SIZE(s) - 1
{
HKCU
,
sizeof
(
HKCU
),
HKEY_CURRENT_USER
},
{
X
(
L"HKEY_LOCAL_MACHINE
\\
"
),
HKEY_LOCAL_MACHINE
},
{
X
(
L"HKEY_CURRENT_USER
\\
"
),
HKEY_CURRENT_USER
},
{
NULL
}
{
NULL
}
#undef X
};
};
struct
table
*
ptr
;
struct
table
*
ptr
;
int
len
=
lstrlenW
(
str
);
int
len
=
lstrlenW
(
str
);
for
(
ptr
=
table
;
ptr
->
name
;
ptr
++
)
for
(
ptr
=
table
;
ptr
->
name
;
ptr
++
)
{
{
if
(
len
>=
ptr
->
size
/
sizeof
(
ptr
->
name
[
0
])
&&
!
memcmp
(
str
,
ptr
->
name
,
ptr
->
size
))
if
(
len
>=
ptr
->
len
&&
!
wcsncmp
(
str
,
ptr
->
name
,
ptr
->
len
))
{
{
*
root
=
ptr
->
key
;
*
root
=
ptr
->
key
;
*
sub_key
=
str
+
ptr
->
size
/
sizeof
(
ptr
->
name
[
0
])
;
*
sub_key
=
str
+
ptr
->
len
;
return
S_OK
;
return
S_OK
;
}
}
}
}
...
...
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