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
efdaa4a1
Commit
efdaa4a1
authored
Jul 15, 2014
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Jul 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Search 32-bit registry in 64-bit CoGetPSClsid and vice versa.
parent
414398c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
28 deletions
+36
-28
compobj.c
dlls/ole32/compobj.c
+34
-26
compobj.c
dlls/ole32/tests/compobj.c
+2
-2
No files found.
dlls/ole32/compobj.c
View file @
efdaa4a1
...
...
@@ -2491,6 +2491,28 @@ HRESULT WINAPI CLSIDFromProgIDEx(LPCOLESTR progid, LPCLSID clsid)
return
CLSIDFromProgID
(
progid
,
clsid
);
}
static
HRESULT
get_ps_clsid_from_registry
(
const
WCHAR
*
path
,
REGSAM
access
,
CLSID
*
pclsid
)
{
HKEY
hkey
;
WCHAR
value
[
CHARS_IN_GUID
];
DWORD
len
;
access
|=
KEY_READ
;
if
(
open_classes_key
(
HKEY_CLASSES_ROOT
,
path
,
access
,
&
hkey
))
return
REGDB_E_IIDNOTREG
;
len
=
sizeof
(
value
);
if
(
ERROR_SUCCESS
!=
RegQueryValueExW
(
hkey
,
NULL
,
NULL
,
NULL
,
(
BYTE
*
)
value
,
&
len
))
return
REGDB_E_IIDNOTREG
;
RegCloseKey
(
hkey
);
if
(
CLSIDFromString
(
value
,
pclsid
)
!=
NOERROR
)
return
REGDB_E_IIDNOTREG
;
return
S_OK
;
}
/*****************************************************************************
* CoGetPSClsid [OLE32.@]
*
...
...
@@ -2532,12 +2554,12 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
static
const
WCHAR
wszInterface
[]
=
{
'I'
,
'n'
,
't'
,
'e'
,
'r'
,
'f'
,
'a'
,
'c'
,
'e'
,
'\\'
,
0
};
static
const
WCHAR
wszPSC
[]
=
{
'\\'
,
'P'
,
'r'
,
'o'
,
'x'
,
'y'
,
'S'
,
't'
,
'u'
,
'b'
,
'C'
,
'l'
,
's'
,
'i'
,
'd'
,
'3'
,
'2'
,
0
};
WCHAR
path
[
ARRAYSIZE
(
wszInterface
)
-
1
+
CHARS_IN_GUID
-
1
+
ARRAYSIZE
(
wszPSC
)];
WCHAR
value
[
CHARS_IN_GUID
];
LONG
len
;
HKEY
hkey
;
APARTMENT
*
apt
=
COM_CurrentApt
();
struct
registered_psclsid
*
registered_psclsid
;
ACTCTX_SECTION_KEYED_DATA
data
;
HRESULT
hr
;
REGSAM
opposite
=
(
sizeof
(
void
*
)
>
sizeof
(
int
))
?
KEY_WOW64_32KEY
:
KEY_WOW64_64KEY
;
BOOL
is_wow64
;
TRACE
(
"() riid=%s, pclsid=%p
\n
"
,
debugstr_guid
(
riid
),
pclsid
);
...
...
@@ -2576,31 +2598,17 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
StringFromGUID2
(
riid
,
path
+
ARRAYSIZE
(
wszInterface
)
-
1
,
CHARS_IN_GUID
);
strcpyW
(
path
+
ARRAYSIZE
(
wszInterface
)
-
1
+
CHARS_IN_GUID
-
1
,
wszPSC
);
/* Open the key.. */
if
(
open_classes_key
(
HKEY_CLASSES_ROOT
,
path
,
KEY_READ
,
&
hkey
))
{
WARN
(
"No PSFactoryBuffer object is registered for IID %s
\n
"
,
debugstr_guid
(
riid
));
return
REGDB_E_IIDNOTREG
;
}
hr
=
get_ps_clsid_from_registry
(
path
,
0
,
pclsid
);
if
(
FAILED
(
hr
)
&&
(
opposite
==
KEY_WOW64_32KEY
||
(
IsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
)
&&
is_wow64
)))
hr
=
get_ps_clsid_from_registry
(
path
,
opposite
,
pclsid
);
/* ... Once we have the key, query the registry to get the
value of CLSID as a string, and convert it into a
proper CLSID structure to be passed back to the app */
len
=
sizeof
(
value
);
if
(
ERROR_SUCCESS
!=
RegQueryValueW
(
hkey
,
NULL
,
value
,
&
len
))
{
RegCloseKey
(
hkey
);
return
REGDB_E_IIDNOTREG
;
}
RegCloseKey
(
hkey
);
/* We have the CLSID we want back from the registry as a string, so
let's convert it into a CLSID structure */
if
(
CLSIDFromString
(
value
,
pclsid
)
!=
NOERROR
)
return
REGDB_E_IIDNOTREG
;
if
(
hr
==
S_OK
)
TRACE
(
"() Returning CLSID=%s
\n
"
,
debugstr_guid
(
pclsid
));
else
WARN
(
"No PSFactoryBuffer object is registered for IID %s
\n
"
,
debugstr_guid
(
riid
));
TRACE
(
"() Returning CLSID=%s
\n
"
,
debugstr_guid
(
pclsid
));
return
S_OK
;
return
hr
;
}
/*****************************************************************************
...
...
dlls/ole32/tests/compobj.c
View file @
efdaa4a1
...
...
@@ -1162,8 +1162,8 @@ static void test_CoGetPSClsid(void)
RegCloseKey
(
hkey_psclsid
);
hr
=
CoGetPSClsid
(
&
IID_DeadBeef
,
&
clsid
);
todo_wine
ok_ole_success
(
hr
,
"CoGetPSClsid"
);
todo_wine
ok
(
IsEqualGUID
(
&
clsid
,
&
IID_TestPS
),
"got clsid %s
\n
"
,
wine_dbgstr_guid
(
&
clsid
));
ok_ole_success
(
hr
,
"CoGetPSClsid"
);
ok
(
IsEqualGUID
(
&
clsid
,
&
IID_TestPS
),
"got clsid %s
\n
"
,
wine_dbgstr_guid
(
&
clsid
));
res
=
pRegDeleteKeyExA
(
hkey
,
"ProxyStubClsid32"
,
opposite
,
0
);
ok
(
!
res
,
"RegDeleteKeyEx returned %d
\n
"
,
res
);
...
...
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