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
a8150b53
Commit
a8150b53
authored
Apr 20, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wshom.ocx: Fix BSTR allocation for string registry values (Valgrind).
parent
604c4dba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
shell.c
dlls/wshom.ocx/shell.c
+1
-1
wshom.c
dlls/wshom.ocx/tests/wshom.c
+16
-1
No files found.
dlls/wshom.ocx/shell.c
View file @
a8150b53
...
...
@@ -1376,7 +1376,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
case
REG_SZ
:
case
REG_EXPAND_SZ
:
V_VT
(
value
)
=
VT_BSTR
;
V_BSTR
(
value
)
=
SysAllocString
Len
((
WCHAR
*
)
data
,
datalen
-
sizeof
(
WCHAR
)
);
V_BSTR
(
value
)
=
SysAllocString
((
WCHAR
*
)
data
);
if
(
!
V_BSTR
(
value
))
hr
=
E_OUTOFMEMORY
;
break
;
...
...
dlls/wshom.ocx/tests/wshom.c
View file @
a8150b53
...
...
@@ -276,7 +276,7 @@ static void test_registry(void)
{
static
const
WCHAR
keypathW
[]
=
{
'H'
,
'K'
,
'E'
,
'Y'
,
'_'
,
'C'
,
'U'
,
'R'
,
'R'
,
'E'
,
'N'
,
'T'
,
'_'
,
'U'
,
'S'
,
'E'
,
'R'
,
'\\'
,
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'T'
,
'e'
,
's'
,
't'
,
'\\'
,
0
};
static
const
WCHAR
regsz2W
[]
=
{
'r'
,
'e'
,
'g'
,
's'
,
'z'
,
'2'
,
0
};
static
const
WCHAR
regszW
[]
=
{
'r'
,
'e'
,
'g'
,
's'
,
'z'
,
0
};
static
const
WCHAR
regdwordW
[]
=
{
'r'
,
'e'
,
'g'
,
'd'
,
'w'
,
'o'
,
'r'
,
'd'
,
0
};
static
const
WCHAR
regbinaryW
[]
=
{
'r'
,
'e'
,
'g'
,
'b'
,
'i'
,
'n'
,
'a'
,
'r'
,
'y'
,
0
};
...
...
@@ -332,6 +332,9 @@ static void test_registry(void)
ret
=
RegSetValueExA
(
root
,
"regsz"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"foobar"
,
7
);
ok
(
ret
==
0
,
"got %d
\n
"
,
ret
);
ret
=
RegSetValueExA
(
root
,
"regsz2"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"foobar
\0
f"
,
9
);
ok
(
ret
==
0
,
"got %d
\n
"
,
ret
);
ret
=
RegSetValueExA
(
root
,
"regmultisz"
,
0
,
REG_MULTI_SZ
,
(
const
BYTE
*
)
"foo
\0
bar
\0
"
,
9
);
ok
(
ret
==
0
,
"got %d
\n
"
,
ret
);
...
...
@@ -355,6 +358,18 @@ static void test_registry(void)
VariantClear
(
&
value
);
SysFreeString
(
name
);
/* REG_SZ with embedded NULL */
lstrcpyW
(
pathW
,
keypathW
);
lstrcatW
(
pathW
,
regsz2W
);
name
=
SysAllocString
(
pathW
);
VariantInit
(
&
value
);
hr
=
IWshShell3_RegRead
(
sh3
,
name
,
&
value
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
value
)
==
VT_BSTR
,
"got %d
\n
"
,
V_VT
(
&
value
));
ok
(
SysStringLen
(
V_BSTR
(
&
value
))
==
6
,
"len %d
\n
"
,
SysStringLen
(
V_BSTR
(
&
value
)));
VariantClear
(
&
value
);
SysFreeString
(
name
);
/* REG_DWORD */
lstrcpyW
(
pathW
,
keypathW
);
lstrcatW
(
pathW
,
regdwordW
);
...
...
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