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
7e3fd4e3
Commit
7e3fd4e3
authored
Dec 15, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix SysReAllocStringLen implementation.
parent
17bec80f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
oleaut.c
dlls/oleaut32/oleaut.c
+2
-1
vartype.c
dlls/oleaut32/tests/vartype.c
+14
-0
No files found.
dlls/oleaut32/oleaut.c
View file @
7e3fd4e3
...
...
@@ -294,6 +294,7 @@ int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len)
return
0
;
if
(
*
old
!=
NULL
)
{
BSTR
old_copy
=
*
old
;
DWORD
newbytelen
=
len
*
sizeof
(
WCHAR
);
DWORD
*
ptr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,((
DWORD
*
)
*
old
)
-
1
,
newbytelen
+
sizeof
(
WCHAR
)
+
sizeof
(
DWORD
));
*
old
=
(
BSTR
)(
ptr
+
1
);
...
...
@@ -302,7 +303,7 @@ int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len)
* when 'in' is NULL!
* Some Microsoft program needs it.
*/
if
(
str
)
memmove
(
*
old
,
str
,
newbytelen
);
if
(
str
&&
old_copy
!=
str
)
memmove
(
*
old
,
str
,
newbytelen
);
(
*
old
)[
len
]
=
0
;
}
else
{
/*
...
...
dlls/oleaut32/tests/vartype.c
View file @
7e3fd4e3
...
...
@@ -5440,6 +5440,20 @@ static void test_SysReAllocStringLen(void)
}
}
}
/* Some Windows applications use the same pointer for pbstr and psz */
str
=
SysAllocStringLen
(
szTest
,
4
);
ok
(
str
!=
NULL
,
"Expected non-NULL
\n
"
);
if
(
str
)
{
int
changed
;
changed
=
SysReAllocStringLen
(
&
str
,
str
,
1000000
);
ok
(
SysStringLen
(
str
)
==
1000000
,
"Incorrect string length
\n
"
);
ok
(
!
memcmp
(
szTest
,
str
,
4
*
sizeof
(
WCHAR
)),
"Incorrect string returned
\n
"
);
SysFreeString
(
str
);
}
}
static
void
test_BstrCopy
(
void
)
...
...
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