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
c1eb2c70
Commit
c1eb2c70
authored
Aug 26, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Aug 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Get the threading model value for inproc classes and output a
fixme if we should create it in an apartment of another type.
parent
9959d7e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
compobj.c
dlls/ole32/compobj.c
+45
-0
No files found.
dlls/ole32/compobj.c
View file @
c1eb2c70
...
...
@@ -1627,14 +1627,59 @@ static DWORD COM_RegReadPath(HKEY hkeyroot, const WCHAR *keyname, const WCHAR *v
return
ret
;
}
static
void
get_threading_model
(
HKEY
key
,
LPWSTR
value
,
DWORD
len
)
{
static
const
WCHAR
wszThreadingModel
[]
=
{
'T'
,
'h'
,
'r'
,
'e'
,
'a'
,
'd'
,
'i'
,
'n'
,
'g'
,
'M'
,
'o'
,
'd'
,
'e'
,
'l'
,
0
};
DWORD
keytype
;
DWORD
ret
;
DWORD
dwLength
=
len
*
sizeof
(
WCHAR
);
ret
=
RegQueryValueExW
(
key
,
wszThreadingModel
,
NULL
,
&
keytype
,
(
LPBYTE
)
value
,
&
dwLength
);
if
((
ret
!=
ERROR_SUCCESS
)
||
(
keytype
!=
REG_SZ
))
value
[
0
]
=
'\0'
;
}
static
HRESULT
get_inproc_class_object
(
HKEY
hkeydll
,
REFCLSID
rclsid
,
REFIID
riid
,
void
**
ppv
)
{
static
const
WCHAR
wszApartment
[]
=
{
'A'
,
'p'
,
'a'
,
'r'
,
't'
,
'm'
,
'e'
,
'n'
,
't'
,
0
};
static
const
WCHAR
wszFree
[]
=
{
'F'
,
'r'
,
'e'
,
'e'
,
0
};
static
const
WCHAR
wszBoth
[]
=
{
'B'
,
'o'
,
't'
,
'h'
,
0
};
HINSTANCE
hLibrary
;
typedef
HRESULT
(
CALLBACK
*
DllGetClassObjectFunc
)(
REFCLSID
clsid
,
REFIID
iid
,
LPVOID
*
ppv
);
DllGetClassObjectFunc
DllGetClassObject
;
WCHAR
dllpath
[
MAX_PATH
+
1
];
WCHAR
threading_model
[
10
/* strlenW(L"apartment")+1 */
];
HRESULT
hr
;
get_threading_model
(
hkeydll
,
threading_model
,
ARRAYSIZE
(
threading_model
));
/* "Apartment" */
if
(
!
strcmpiW
(
threading_model
,
wszApartment
))
{
APARTMENT
*
apt
=
COM_CurrentApt
();
if
(
apt
->
multi_threaded
)
{
FIXME
(
"should create object %s in single-threaded apartment
\n
"
,
debugstr_guid
(
rclsid
));
}
}
/* "Free" */
else
if
(
!
strcmpiW
(
threading_model
,
wszFree
))
{
APARTMENT
*
apt
=
COM_CurrentApt
();
if
(
!
apt
->
multi_threaded
)
{
FIXME
(
"should create object %s in multi-threaded apartment
\n
"
,
debugstr_guid
(
rclsid
));
}
}
/* everything except "Apartment", "Free" and "Both" */
else
if
(
strcmpiW
(
threading_model
,
wszBoth
))
{
/* everything else is main-threaded */
FIXME
(
"unrecognised threading model %s for object %s, should be main-threaded?
\n
"
,
debugstr_w
(
threading_model
),
debugstr_guid
(
rclsid
));
}
if
(
COM_RegReadPath
(
hkeydll
,
NULL
,
NULL
,
dllpath
,
ARRAYSIZE
(
dllpath
))
!=
ERROR_SUCCESS
)
{
/* failure: CLSID is not found in registry */
...
...
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