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
2cfc85dc
Commit
2cfc85dc
authored
Jul 21, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sxs: Add support for SXS_LOOKUP_CLR_GUID_USE_ACTCTX in SxsLookupClrGuid().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fe2c271e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
27 deletions
+53
-27
sxs.c
dlls/sxs/sxs.c
+29
-27
sxs.c
dlls/sxs/tests/sxs.c
+24
-0
No files found.
dlls/sxs/sxs.c
View file @
2cfc85dc
...
...
@@ -112,59 +112,58 @@ BOOL WINAPI SxsLookupClrGuid(DWORD flags, GUID *clsid, HANDLE actctx, void *buff
SIZE_T
*
buffer_len_required
)
{
ACTCTX_SECTION_KEYED_DATA
guid_info
=
{
sizeof
(
ACTCTX_SECTION_KEYED_DATA
)
};
ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
*
assembly_info
;
ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
*
assembly_info
=
NULL
;
SIZE_T
bytes_assembly_info
;
unsigned
int
len_version
=
0
,
len_name
,
len_identity
;
const
void
*
ptr_name
,
*
ptr_version
,
*
ptr_identity
;
SXS_GUID_INFORMATION_CLR
*
ret
=
buffer
;
BOOL
retval
=
FALSE
;
char
*
ret_strings
;
ULONG_PTR
cookie
;
TRACE
(
"%#x, %s, %p, %p, %lx, %p.
\n
"
,
flags
,
wine_dbgstr_guid
(
clsid
),
actctx
,
buffer
,
buffer_len
,
buffer_len_required
);
if
(
flags
&
~
SXS_LOOKUP_CLR_GUID_FIND_ANY
)
FIXME
(
"Ignored flags: %x
\n
"
,
flags
&
~
SXS_LOOKUP_CLR_GUID_FIND_ANY
);
if
(
flags
&
SXS_LOOKUP_CLR_GUID_USE_ACTCTX
)
{
if
(
!
ActivateActCtx
(
actctx
,
&
cookie
))
{
WARN
(
"Failed to activate context.
\n
"
);
return
FALSE
;
}
}
if
(
flags
&
SXS_LOOKUP_CLR_GUID_FIND_SURROGATE
)
{
if
((
retval
=
FindActCtxSectionGuid
(
FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX
,
0
,
ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES
,
clsid
,
&
guid_info
)))
{
if
((
retval
=
FindActCtxSectionGuid
(
0
,
NULL
,
ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES
,
clsid
,
&
guid_info
)))
flags
&=
~
SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS
;
}
}
if
(
!
retval
&&
(
flags
&
SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS
))
{
if
((
retval
=
FindActCtxSectionGuid
(
FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX
,
0
,
ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION
,
clsid
,
&
guid_info
)))
{
if
((
retval
=
FindActCtxSectionGuid
(
0
,
NULL
,
ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION
,
clsid
,
&
guid_info
)))
flags
&=
~
SXS_LOOKUP_CLR_GUID_FIND_SURROGATE
;
}
}
if
(
!
retval
)
{
SetLastError
(
ERROR_NOT_FOUND
);
return
FALSE
;
goto
out
;
}
QueryActCtxW
(
0
,
guid_info
.
hActCtx
,
&
guid_info
.
ulAssemblyRosterIndex
,
retval
=
QueryActCtxW
(
QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX
,
NULL
,
&
guid_info
.
ulAssemblyRosterIndex
,
AssemblyDetailedInformationInActivationContext
,
NULL
,
0
,
&
bytes_assembly_info
);
if
(
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
if
(
!
retval
&&
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
{
ReleaseActCtx
(
guid_info
.
hActCtx
);
return
FALSE
;
goto
out
;
}
assembly_info
=
heap_alloc
(
bytes_assembly_info
);
if
(
!
QueryActCtxW
(
0
,
guid_info
.
hActCtx
,
&
guid_info
.
ulAssemblyRosterIndex
,
if
(
!
(
retval
=
QueryActCtxW
(
QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX
,
NULL
,
&
guid_info
.
ulAssemblyRosterIndex
,
AssemblyDetailedInformationInActivationContext
,
assembly_info
,
bytes_assembly_info
,
&
bytes_assembly_info
))
bytes_assembly_info
,
&
bytes_assembly_info
))
)
{
heap_free
(
assembly_info
);
ReleaseActCtx
(
guid_info
.
hActCtx
);
return
FALSE
;
goto
out
;
}
if
(
flags
&
SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS
)
...
...
@@ -192,13 +191,12 @@ BOOL WINAPI SxsLookupClrGuid(DWORD flags, GUID *clsid, HANDLE actctx, void *buff
ptr_identity
=
assembly_info
->
lpAssemblyEncodedAssemblyIdentity
;
len_identity
=
assembly_info
->
ulEncodedAssemblyIdentityLength
+
sizeof
(
WCHAR
);
*
buffer_len_required
=
sizeof
(
SXS_GUID_INFORMATION_CLR
)
+
len_identity
+
len_version
+
len_name
;
*
buffer_len_required
=
sizeof
(
*
ret
)
+
len_identity
+
len_version
+
len_name
;
if
(
!
buffer
||
buffer_len
<
*
buffer_len_required
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
heap_free
(
assembly_info
);
ReleaseActCtx
(
guid_info
.
hActCtx
);
return
FALSE
;
retval
=
FALSE
;
goto
out
;
}
ret
->
cbSize
=
sizeof
(
*
ret
);
...
...
@@ -226,7 +224,11 @@ BOOL WINAPI SxsLookupClrGuid(DWORD flags, GUID *clsid, HANDLE actctx, void *buff
SetLastError
(
0
);
ReleaseActCtx
(
guid_info
.
hActCtx
);
out:
if
(
flags
&
SXS_LOOKUP_CLR_GUID_USE_ACTCTX
)
DeactivateActCtx
(
0
,
cookie
);
heap_free
(
assembly_info
);
return
TRUE
;
return
retval
;
}
dlls/sxs/tests/sxs.c
View file @
2cfc85dc
...
...
@@ -86,15 +86,30 @@ static void run_test(void)
BOOL
ret
;
SXS_GUID_INFORMATION_CLR
*
info
;
SetLastError
(
0xdeadbeef
);
ret
=
SxsLookupClrGuid
(
SXS_LOOKUP_CLR_GUID_FIND_ANY
|
SXS_LOOKUP_CLR_GUID_USE_ACTCTX
,
(
GUID
*
)
&
CLSID_Test
,
NULL
,
NULL
,
0
,
&
buffer_size
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_NOT_FOUND
,
"Unexpected error %d.
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
SxsLookupClrGuid
(
SXS_LOOKUP_CLR_GUID_FIND_ANY
|
SXS_LOOKUP_CLR_GUID_USE_ACTCTX
,
(
GUID
*
)
&
CLSID_Test
,
NULL
,
NULL
,
0
,
&
buffer_size
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_NOT_FOUND
,
"Unexpected error %d.
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
SxsLookupClrGuid
(
SXS_LOOKUP_CLR_GUID_FIND_ANY
,
(
GUID
*
)
&
CLSID_Test
,
NULL
,
NULL
,
0
,
&
buffer_size
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
SxsLookupClrGuid
(
SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS
,
(
GUID
*
)
&
CLSID_Test
,
NULL
,
NULL
,
0
,
&
buffer_size
);
ok
(
ret
==
FALSE
,
"Got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Got %d
\n
"
,
GetLastError
());
info
=
heap_alloc
(
buffer_size
);
SetLastError
(
0xdeadbeef
);
ret
=
SxsLookupClrGuid
(
SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS
,
(
GUID
*
)
&
CLSID_Test
,
NULL
,
info
,
buffer_size
,
&
buffer_size
);
ok
(
ret
==
TRUE
,
"Got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
0
,
"Got %d
\n
"
,
GetLastError
());
...
...
@@ -108,11 +123,13 @@ static void run_test(void)
heap_free
(
info
);
SetLastError
(
0xdeadbeef
);
ret
=
SxsLookupClrGuid
(
SXS_LOOKUP_CLR_GUID_FIND_SURROGATE
,
(
GUID
*
)
&
CLSID_SurrogateTest
,
NULL
,
NULL
,
0
,
&
buffer_size
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Got %d
\n
"
,
GetLastError
());
info
=
heap_alloc
(
buffer_size
);
SetLastError
(
0xdeadbeef
);
ret
=
SxsLookupClrGuid
(
SXS_LOOKUP_CLR_GUID_FIND_SURROGATE
,
(
GUID
*
)
&
CLSID_SurrogateTest
,
NULL
,
info
,
buffer_size
,
&
buffer_size
);
ok
(
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
...
...
@@ -127,6 +144,7 @@ static void run_test(void)
heap_free
(
info
);
SetLastError
(
0xdeadbeef
);
ret
=
SxsLookupClrGuid
(
SXS_LOOKUP_CLR_GUID_FIND_ANY
,
(
GUID
*
)
&
CLSID_SurrogateTest
,
NULL
,
NULL
,
0
,
&
buffer_size
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Got %d
\n
"
,
GetLastError
());
...
...
@@ -232,6 +250,12 @@ static void test_SxsLookupClrGuid(void)
ok
(
GetLastError
()
==
ERROR_NOT_FOUND
,
"Expected ERROR_NOT_FOUND, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
SxsLookupClrGuid
(
SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS
|
SXS_LOOKUP_CLR_GUID_USE_ACTCTX
,
(
GUID
*
)
&
CLSID_Test
,
NULL
,
NULL
,
0
,
&
buffer_size
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_NOT_FOUND
,
"Expected ERROR_NOT_FOUND, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
SxsLookupClrGuid
(
SXS_LOOKUP_CLR_GUID_FIND_SURROGATE
,
(
GUID
*
)
&
CLSID_Test
,
NULL
,
NULL
,
0
,
&
buffer_size
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_NOT_FOUND
,
"Expected ERROR_NOT_FOUND, got %d
\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