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
382b72d7
Commit
382b72d7
authored
Apr 10, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fusion: Support buffer size queries in IAssemblyName::GetName.
parent
c5c71372
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
11 deletions
+43
-11
asmname.c
dlls/fusion/asmname.c
+12
-7
asmname.c
dlls/fusion/tests/asmname.c
+31
-4
No files found.
dlls/fusion/asmname.c
View file @
382b72d7
...
@@ -369,19 +369,24 @@ static HRESULT WINAPI IAssemblyNameImpl_GetName(IAssemblyName *iface,
...
@@ -369,19 +369,24 @@ static HRESULT WINAPI IAssemblyNameImpl_GetName(IAssemblyName *iface,
WCHAR
*
pwzName
)
WCHAR
*
pwzName
)
{
{
IAssemblyNameImpl
*
name
=
impl_from_IAssemblyName
(
iface
);
IAssemblyNameImpl
*
name
=
impl_from_IAssemblyName
(
iface
);
DWORD
len
;
TRACE
(
"(%p, %p, %p)
\n
"
,
iface
,
lpcwBuffer
,
pwzName
);
TRACE
(
"(%p, %p, %p)
\n
"
,
iface
,
lpcwBuffer
,
pwzName
);
if
(
!
name
->
name
)
if
(
name
->
name
)
len
=
strlenW
(
name
->
name
)
+
1
;
else
len
=
0
;
if
(
*
lpcwBuffer
<
len
)
{
{
*
pwzName
=
'\0'
;
*
lpcwBuffer
=
len
;
*
lpcwBuffer
=
0
;
return
E_NOT_SUFFICIENT_BUFFER
;
return
S_OK
;
}
}
if
(
!
name
->
name
)
lpcwBuffer
[
0
]
=
0
;
else
strcpyW
(
pwzName
,
name
->
name
);
lstrcpyW
(
pwzName
,
name
->
name
);
*
lpcwBuffer
=
len
;
*
lpcwBuffer
=
lstrlenW
(
pwzName
)
+
1
;
return
S_OK
;
return
S_OK
;
}
}
...
...
dlls/fusion/tests/asmname.c
View file @
382b72d7
...
@@ -421,12 +421,12 @@ static void test_CreateAssemblyNameObject(void)
...
@@ -421,12 +421,12 @@ static void test_CreateAssemblyNameObject(void)
broken
(
hr
==
E_INVALIDARG
),
/* .NET 1.x */
broken
(
hr
==
E_INVALIDARG
),
/* .NET 1.x */
"Expected FUSION_E_INVALID_NAME, got %08x
\n
"
,
hr
);
"Expected FUSION_E_INVALID_NAME, got %08x
\n
"
,
hr
);
str
[
0
]
=
'a'
;
size
=
MAX_PATH
;
size
=
MAX_PATH
;
str
[
0
]
=
'\0'
;
hr
=
IAssemblyName_GetName
(
name
,
&
size
,
str
);
hr
=
IAssemblyName_GetName
(
name
,
&
size
,
str
);
ok
(
hr
==
S_OK
,
"
Expected S_OK,
got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
str
[
0
],
"Expected empty name
\n
"
);
ok
(
str
[
0
]
==
'a'
,
"got %c
\n
"
,
str
[
0
]
);
ok
(
size
==
0
,
"Expected 0, got %d
\n
"
,
size
);
ok
(
!
size
,
"got %u
\n
"
,
size
);
hi
=
0xbeefcace
;
hi
=
0xbeefcace
;
lo
=
0xcafebabe
;
lo
=
0xcafebabe
;
...
@@ -457,6 +457,26 @@ static void test_CreateAssemblyNameObject(void)
...
@@ -457,6 +457,26 @@ static void test_CreateAssemblyNameObject(void)
broken
(
hr
==
S_OK
),
/* .NET 1.x */
broken
(
hr
==
S_OK
),
/* .NET 1.x */
"Expected FUSION_E_INVALID_NAME, got %08x
\n
"
,
hr
);
"Expected FUSION_E_INVALID_NAME, got %08x
\n
"
,
hr
);
size
=
0
;
hr
=
IAssemblyName_GetName
(
name
,
&
size
,
NULL
);
ok
(
hr
==
E_NOT_SUFFICIENT_BUFFER
,
"got %08x
\n
"
,
hr
);
ok
(
size
==
1
,
"got %u
\n
"
,
size
);
if
(
0
)
/* crash */
{
str
[
0
]
=
'\0'
;
hr
=
IAssemblyName_GetName
(
name
,
NULL
,
str
);
ok
(
hr
==
E_NOT_SUFFICIENT_BUFFER
,
"got %08x
\n
"
,
hr
);
ok
(
!
str
[
0
],
"got %c
\n
"
,
str
[
0
]);
}
size
=
0
;
str
[
0
]
=
'\0'
;
hr
=
IAssemblyName_GetName
(
name
,
&
size
,
str
);
ok
(
hr
==
E_NOT_SUFFICIENT_BUFFER
,
"got %08x
\n
"
,
hr
);
ok
(
!
str
[
0
],
"got %c
\n
"
,
str
[
0
]);
ok
(
size
==
1
,
"got %u
\n
"
,
size
);
size
=
MAX_PATH
;
size
=
MAX_PATH
;
str
[
0
]
=
'\0'
;
str
[
0
]
=
'\0'
;
hr
=
IAssemblyName_GetName
(
name
,
&
size
,
str
);
hr
=
IAssemblyName_GetName
(
name
,
&
size
,
str
);
...
@@ -494,6 +514,13 @@ static void test_CreateAssemblyNameObject(void)
...
@@ -494,6 +514,13 @@ static void test_CreateAssemblyNameObject(void)
ok_aw
(
"wine"
,
str
);
ok_aw
(
"wine"
,
str
);
ok
(
size
==
5
,
"Expected 5, got %d
\n
"
,
size
);
ok
(
size
==
5
,
"Expected 5, got %d
\n
"
,
size
);
size
=
0
;
str
[
0
]
=
0
;
hr
=
IAssemblyName_GetName
(
name
,
&
size
,
str
);
ok
(
hr
==
E_NOT_SUFFICIENT_BUFFER
,
"got %08x
\n
"
,
hr
);
ok
(
!
str
[
0
],
"got %c
\n
"
,
str
[
0
]);
ok
(
size
==
5
,
"got %u
\n
"
,
size
);
size
=
MAX_PATH
;
size
=
MAX_PATH
;
str
[
0
]
=
'\0'
;
str
[
0
]
=
'\0'
;
hr
=
IAssemblyName_GetName
(
name
,
&
size
,
str
);
hr
=
IAssemblyName_GetName
(
name
,
&
size
,
str
);
...
...
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