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
b0aca40d
Commit
b0aca40d
authored
Nov 09, 2017
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fusion: Add support for ASM_NAME_ARCHITECTURE in IAssemblyNameImpl_GetProperty.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fac2e9a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
asmname.c
dlls/fusion/asmname.c
+39
-0
asmname.c
dlls/fusion/tests/asmname.c
+25
-0
No files found.
dlls/fusion/asmname.c
View file @
b0aca40d
...
...
@@ -55,6 +55,8 @@ typedef struct {
BYTE
pubkey
[
8
];
BOOL
haspubkey
;
PEKIND
pekind
;
LONG
ref
;
}
IAssemblyNameImpl
;
...
...
@@ -232,6 +234,17 @@ static HRESULT WINAPI IAssemblyNameImpl_GetProperty(IAssemblyName *iface,
}
break
;
case
ASM_NAME_ARCHITECTURE
:
*
pcbProperty
=
0
;
if
(
name
->
pekind
!=
peNone
)
{
*
pcbProperty
=
sizeof
(
PEKIND
);
if
(
size
<
*
pcbProperty
)
return
STRSAFE_E_INSUFFICIENT_BUFFER
;
*
((
PEKIND
*
)
pvProperty
)
=
name
->
pekind
;
}
break
;
default:
*
pcbProperty
=
0
;
break
;
...
...
@@ -616,6 +629,30 @@ static HRESULT parse_pubkey(IAssemblyNameImpl *name, LPCWSTR pubkey)
return
S_OK
;
}
static
HRESULT
parse_procarch
(
IAssemblyNameImpl
*
name
,
LPCWSTR
procarch
)
{
static
const
WCHAR
msilW
[]
=
{
'm'
,
's'
,
'i'
,
'l'
,
0
};
static
const
WCHAR
x86W
[]
=
{
'x'
,
'8'
,
'6'
,
0
};
static
const
WCHAR
ia64W
[]
=
{
'i'
,
'a'
,
'6'
,
'4'
,
0
};
static
const
WCHAR
amd64W
[]
=
{
'a'
,
'm'
,
'd'
,
'6'
,
'4'
,
0
};
if
(
!
lstrcmpiW
(
procarch
,
msilW
))
name
->
pekind
=
peMSIL
;
else
if
(
!
lstrcmpiW
(
procarch
,
x86W
))
name
->
pekind
=
peI386
;
else
if
(
!
lstrcmpiW
(
procarch
,
ia64W
))
name
->
pekind
=
peIA64
;
else
if
(
!
lstrcmpiW
(
procarch
,
amd64W
))
name
->
pekind
=
peAMD64
;
else
{
ERR
(
"unrecognized architecture: %s
\n
"
,
wine_dbgstr_w
(
procarch
));
return
FUSION_E_INVALID_NAME
;
}
return
S_OK
;
}
static
WCHAR
*
parse_value
(
const
WCHAR
*
str
,
unsigned
int
len
)
{
WCHAR
*
ret
;
...
...
@@ -726,6 +763,8 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
{
name
->
procarch
=
value
;
value
=
NULL
;
hr
=
parse_procarch
(
name
,
name
->
procarch
);
}
HeapFree
(
GetProcessHeap
(),
0
,
value
);
...
...
dlls/fusion/tests/asmname.c
View file @
b0aca40d
...
...
@@ -397,6 +397,7 @@ static void test_CreateAssemblyNameObject(void)
WCHAR
str
[
MAX_PATH
];
WCHAR
namestr
[
MAX_PATH
];
DWORD
size
,
hi
,
lo
;
PEKIND
arch
;
HRESULT
hr
;
static
const
WCHAR
empty
[]
=
{
0
};
...
...
@@ -794,6 +795,12 @@ static void test_CreateAssemblyNameObject(void)
ok_aw
(
"wine, processorArchitecture=x86"
,
str
);
ok
(
size
==
32
,
"Expected 32, got %d
\n
"
,
size
);
size
=
sizeof
(
arch
);
hr
=
IAssemblyName_GetProperty
(
name
,
ASM_NAME_ARCHITECTURE
,
&
arch
,
&
size
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
arch
==
peI386
,
"Expected peI386, got %d
\n
"
,
arch
);
ok
(
size
==
sizeof
(
arch
),
"Wrong size %d
\n
"
,
size
);
IAssemblyName_Release
(
name
);
/* amd64 */
...
...
@@ -808,6 +815,12 @@ static void test_CreateAssemblyNameObject(void)
ok_aw
(
"wine, processorArchitecture=AMD64"
,
str
);
ok
(
size
==
34
,
"Expected 34, got %d
\n
"
,
size
);
size
=
sizeof
(
arch
);
hr
=
IAssemblyName_GetProperty
(
name
,
ASM_NAME_ARCHITECTURE
,
&
arch
,
&
size
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
arch
==
peAMD64
,
"Expected peAMD64, got %d
\n
"
,
arch
);
ok
(
size
==
sizeof
(
arch
),
"Wrong size %d
\n
"
,
size
);
IAssemblyName_Release
(
name
);
/* ia64 */
...
...
@@ -822,6 +835,12 @@ static void test_CreateAssemblyNameObject(void)
ok_aw
(
"wine, processorArchitecture=IA64"
,
str
);
ok
(
size
==
33
,
"Expected 33, got %d
\n
"
,
size
);
size
=
sizeof
(
arch
);
hr
=
IAssemblyName_GetProperty
(
name
,
ASM_NAME_ARCHITECTURE
,
&
arch
,
&
size
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
arch
==
peIA64
,
"Expected peIA64, got %d
\n
"
,
arch
);
ok
(
size
==
sizeof
(
arch
),
"Wrong size %d
\n
"
,
size
);
IAssemblyName_Release
(
name
);
/* msil */
...
...
@@ -836,6 +855,12 @@ static void test_CreateAssemblyNameObject(void)
ok_aw
(
"wine, processorArchitecture=MSIL"
,
str
);
ok
(
size
==
33
,
"Expected 33, got %d
\n
"
,
size
);
size
=
sizeof
(
arch
);
hr
=
IAssemblyName_GetProperty
(
name
,
ASM_NAME_ARCHITECTURE
,
&
arch
,
&
size
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
arch
==
peMSIL
,
"Expected peMSIL, got %d
\n
"
,
arch
);
ok
(
size
==
sizeof
(
arch
),
"Wrong size %d
\n
"
,
size
);
IAssemblyName_Release
(
name
);
}
...
...
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