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
ea0fa9f1
Commit
ea0fa9f1
authored
Apr 05, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
combase: Lookup activatable class library in the activation context.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9d1beee6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
roapi.c
dlls/combase/roapi.c
+21
-0
roapi.c
dlls/combase/tests/roapi.c
+4
-4
No files found.
dlls/combase/roapi.c
View file @
ea0fa9f1
...
...
@@ -37,8 +37,18 @@ static const char *debugstr_hstring(HSTRING hstr)
return
wine_dbgstr_wn
(
str
,
len
);
}
struct
activatable_class_data
{
ULONG
size
;
DWORD
unk
;
DWORD
module_len
;
DWORD
module_offset
;
DWORD
threading_model
;
};
static
HRESULT
get_library_for_classid
(
const
WCHAR
*
classid
,
WCHAR
**
out
)
{
ACTCTX_SECTION_KEYED_DATA
data
;
HKEY
hkey_root
,
hkey_class
;
DWORD
type
,
size
;
HRESULT
hr
;
...
...
@@ -46,6 +56,17 @@ static HRESULT get_library_for_classid(const WCHAR *classid, WCHAR **out)
*
out
=
NULL
;
/* search activation context first */
data
.
cbSize
=
sizeof
(
data
);
if
(
FindActCtxSectionStringW
(
FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX
,
NULL
,
ACTIVATION_CONTEXT_SECTION_WINRT_ACTIVATABLE_CLASSES
,
classid
,
&
data
))
{
struct
activatable_class_data
*
activatable_class
=
(
struct
activatable_class_data
*
)
data
.
lpData
;
void
*
ptr
=
(
BYTE
*
)
data
.
lpSectionBase
+
activatable_class
->
module_offset
;
*
out
=
wcsdup
(
ptr
);
return
S_OK
;
}
/* load class registry key */
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
L"Software
\\
Microsoft
\\
WindowsRuntime
\\
ActivatableClassId"
,
0
,
KEY_READ
,
&
hkey_root
))
...
...
dlls/combase/tests/roapi.c
View file @
ea0fa9f1
...
...
@@ -95,21 +95,19 @@ static void test_ActivationFactories(void)
todo_wine
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
REGDB_E_CLASSNOTREG
)
/* <= w1064v1809 */
,
"RoGetActivationFactory returned %#lx.
\n
"
,
hr
);
todo_wine
ok
(
factory
==
NULL
,
"got factory %p.
\n
"
,
factory
);
if
(
factory
)
IActivationFactory_Release
(
factory
);
WindowsDeleteString
(
str
);
hr
=
WindowsCreateString
(
L"Wine.Test.Trusted"
,
ARRAY_SIZE
(
L"Wine.Test.Trusted"
)
-
1
,
&
str
);
ok
(
hr
==
S_OK
,
"WindowsCreateString returned %#lx.
\n
"
,
hr
);
hr
=
RoGetActivationFactory
(
str
,
&
IID_IActivationFactory
,
(
void
**
)
&
factory
);
todo_wine
ok
(
hr
==
S_OK
||
broken
(
hr
==
REGDB_E_CLASSNOTREG
)
/* <= w1064v1809 */
,
"RoGetActivationFactory returned %#lx.
\n
"
,
hr
);
if
(
hr
==
REGDB_E_CLASSNOTREG
)
ok
(
!
factory
,
"got factory %p.
\n
"
,
factory
);
else
{
todo_wine
ok
(
!!
factory
,
"got factory %p.
\n
"
,
factory
);
}
if
(
!
factory
)
ref
=
0
;
else
ref
=
IActivationFactory_Release
(
factory
);
ok
(
ref
==
0
,
"Release returned %lu
\n
"
,
ref
);
...
...
@@ -126,6 +124,8 @@ START_TEST(roapi)
test_ActivationFactories
();
SetLastError
(
0xdeadbeef
);
ret
=
DeleteFileW
(
L"wine.combase.test.dll"
);
todo_wine_if
(
!
ret
&&
GetLastError
()
==
ERROR_ACCESS_DENIED
)
ok
(
ret
,
"Failed to delete file, error %lu
\n
"
,
GetLastError
());
}
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