Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
c1cb1713
Commit
c1cb1713
authored
Mar 31, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
combase: Move IGlobalOptions implementation.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e687f589
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
162 additions
and
111 deletions
+162
-111
combase.c
dlls/combase/combase.c
+161
-1
combase.spec
dlls/combase/combase.spec
+1
-1
compobj.c
dlls/ole32/compobj.c
+0
-96
oleproxy.c
dlls/ole32/oleproxy.c
+0
-13
No files found.
dlls/combase/combase.c
View file @
c1cb1713
...
...
@@ -429,6 +429,150 @@ static void com_cleanup_tlsdata(void)
NtCurrentTeb
()
->
ReservedForOle
=
NULL
;
}
struct
global_options
{
IGlobalOptions
IGlobalOptions_iface
;
LONG
refcount
;
};
static
inline
struct
global_options
*
impl_from_IGlobalOptions
(
IGlobalOptions
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
global_options
,
IGlobalOptions_iface
);
}
static
HRESULT
WINAPI
global_options_QueryInterface
(
IGlobalOptions
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppv
);
if
(
IsEqualGUID
(
&
IID_IGlobalOptions
,
riid
)
||
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
*
ppv
=
iface
;
}
else
{
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
global_options_AddRef
(
IGlobalOptions
*
iface
)
{
struct
global_options
*
options
=
impl_from_IGlobalOptions
(
iface
);
LONG
refcount
=
InterlockedIncrement
(
&
options
->
refcount
);
TRACE
(
"%p, refcount %d.
\n
"
,
iface
,
refcount
);
return
refcount
;
}
static
ULONG
WINAPI
global_options_Release
(
IGlobalOptions
*
iface
)
{
struct
global_options
*
options
=
impl_from_IGlobalOptions
(
iface
);
LONG
refcount
=
InterlockedDecrement
(
&
options
->
refcount
);
TRACE
(
"%p, refcount %d.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
heap_free
(
options
);
return
refcount
;
}
static
HRESULT
WINAPI
global_options_Set
(
IGlobalOptions
*
iface
,
GLOBALOPT_PROPERTIES
property
,
ULONG_PTR
value
)
{
FIXME
(
"%p, %u, %lx.
\n
"
,
iface
,
property
,
value
);
return
S_OK
;
}
static
HRESULT
WINAPI
global_options_Query
(
IGlobalOptions
*
iface
,
GLOBALOPT_PROPERTIES
property
,
ULONG_PTR
*
value
)
{
FIXME
(
"%p, %u, %p.
\n
"
,
iface
,
property
,
value
);
return
E_NOTIMPL
;
}
static
const
IGlobalOptionsVtbl
global_options_vtbl
=
{
global_options_QueryInterface
,
global_options_AddRef
,
global_options_Release
,
global_options_Set
,
global_options_Query
};
static
HRESULT
WINAPI
class_factory_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppv
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IClassFactory
))
{
*
ppv
=
iface
;
return
S_OK
;
}
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
class_factory_AddRef
(
IClassFactory
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
class_factory_Release
(
IClassFactory
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
class_factory_LockServer
(
IClassFactory
*
iface
,
BOOL
fLock
)
{
TRACE
(
"%d
\n
"
,
fLock
);
return
S_OK
;
}
static
HRESULT
WINAPI
global_options_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer
,
REFIID
riid
,
void
**
ppv
)
{
struct
global_options
*
object
;
HRESULT
hr
;
TRACE
(
"%p, %s, %p.
\n
"
,
outer
,
debugstr_guid
(
riid
),
ppv
);
if
(
outer
)
return
E_INVALIDARG
;
if
(
!
(
object
=
heap_alloc
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IGlobalOptions_iface
.
lpVtbl
=
&
global_options_vtbl
;
object
->
refcount
=
1
;
hr
=
IGlobalOptions_QueryInterface
(
&
object
->
IGlobalOptions_iface
,
riid
,
ppv
);
IGlobalOptions_Release
(
&
object
->
IGlobalOptions_iface
);
return
hr
;
}
static
const
IClassFactoryVtbl
global_options_factory_vtbl
=
{
class_factory_QueryInterface
,
class_factory_AddRef
,
class_factory_Release
,
global_options_CreateInstance
,
class_factory_LockServer
};
static
IClassFactory
global_options_factory
=
{
&
global_options_factory_vtbl
};
static
HRESULT
get_builtin_class_factory
(
REFCLSID
rclsid
,
REFIID
riid
,
void
**
obj
)
{
if
(
IsEqualCLSID
(
rclsid
,
&
CLSID_GlobalOptions
))
return
IClassFactory_QueryInterface
(
&
global_options_factory
,
riid
,
obj
);
return
E_UNEXPECTED
;
}
/***********************************************************************
* FreePropVariantArray (combase.@)
*/
...
...
@@ -1569,7 +1713,11 @@ static HRESULT com_get_class_object(REFCLSID rclsid, DWORD clscontext,
IsEqualCLSID
(
rclsid
,
&
CLSID_StdGlobalInterfaceTable
))
{
apartment_release
(
apt
);
return
Ole32DllGetClassObject
(
rclsid
,
riid
,
obj
);
if
(
IsEqualCLSID
(
rclsid
,
&
CLSID_GlobalOptions
))
return
get_builtin_class_factory
(
rclsid
,
riid
,
obj
);
else
return
Ole32DllGetClassObject
(
rclsid
,
riid
,
obj
);
}
}
...
...
@@ -3226,3 +3374,15 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
return
TRUE
;
}
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
void
**
obj
)
{
TRACE
(
"%s, %s, %p.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
obj
);
*
obj
=
NULL
;
if
(
IsEqualCLSID
(
rclsid
,
&
CLSID_GlobalOptions
))
return
IClassFactory_QueryInterface
(
&
global_options_factory
,
riid
,
obj
);
return
CLASS_E_CLASSNOTAVAILABLE
;
}
dlls/combase/combase.spec
View file @
c1cb1713
...
...
@@ -178,7 +178,7 @@
@ stub DcomChannelSetHResult
@ stdcall DllDebugObjectRPCHook(long ptr)
@ stdcall DllGetActivationFactory(ptr ptr)
@ stdcall -private DllGetClassObject(ptr ptr ptr)
ole32.DllGetClassObject
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stub EnableHookObject
@ stdcall FreePropVariantArray(long ptr)
@ stub FreePropVariantArrayWorker
...
...
dlls/ole32/compobj.c
View file @
c1cb1713
...
...
@@ -924,102 +924,6 @@ HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
return
CLASS_E_CLASSNOTAVAILABLE
;
}
typedef
struct
{
IGlobalOptions
IGlobalOptions_iface
;
LONG
ref
;
}
GlobalOptions
;
static
inline
GlobalOptions
*
impl_from_IGlobalOptions
(
IGlobalOptions
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
GlobalOptions
,
IGlobalOptions_iface
);
}
static
HRESULT
WINAPI
GlobalOptions_QueryInterface
(
IGlobalOptions
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
GlobalOptions
*
This
=
impl_from_IGlobalOptions
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
if
(
IsEqualGUID
(
&
IID_IGlobalOptions
,
riid
)
||
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
*
ppv
=
iface
;
}
else
{
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
GlobalOptions_AddRef
(
IGlobalOptions
*
iface
)
{
GlobalOptions
*
This
=
impl_from_IGlobalOptions
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
GlobalOptions_Release
(
IGlobalOptions
*
iface
)
{
GlobalOptions
*
This
=
impl_from_IGlobalOptions
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
)
heap_free
(
This
);
return
ref
;
}
static
HRESULT
WINAPI
GlobalOptions_Set
(
IGlobalOptions
*
iface
,
GLOBALOPT_PROPERTIES
property
,
ULONG_PTR
value
)
{
GlobalOptions
*
This
=
impl_from_IGlobalOptions
(
iface
);
FIXME
(
"(%p)->(%u %lx)
\n
"
,
This
,
property
,
value
);
return
S_OK
;
}
static
HRESULT
WINAPI
GlobalOptions_Query
(
IGlobalOptions
*
iface
,
GLOBALOPT_PROPERTIES
property
,
ULONG_PTR
*
value
)
{
GlobalOptions
*
This
=
impl_from_IGlobalOptions
(
iface
);
FIXME
(
"(%p)->(%u %p)
\n
"
,
This
,
property
,
value
);
return
E_NOTIMPL
;
}
static
const
IGlobalOptionsVtbl
GlobalOptionsVtbl
=
{
GlobalOptions_QueryInterface
,
GlobalOptions_AddRef
,
GlobalOptions_Release
,
GlobalOptions_Set
,
GlobalOptions_Query
};
HRESULT
WINAPI
GlobalOptions_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer
,
REFIID
riid
,
void
**
ppv
)
{
GlobalOptions
*
global_options
;
HRESULT
hres
;
TRACE
(
"(%p %s %p)
\n
"
,
outer
,
debugstr_guid
(
riid
),
ppv
);
if
(
outer
)
return
E_INVALIDARG
;
global_options
=
heap_alloc
(
sizeof
(
*
global_options
));
if
(
!
global_options
)
return
E_OUTOFMEMORY
;
global_options
->
IGlobalOptions_iface
.
lpVtbl
=
&
GlobalOptionsVtbl
;
global_options
->
ref
=
1
;
hres
=
IGlobalOptions_QueryInterface
(
&
global_options
->
IGlobalOptions_iface
,
riid
,
ppv
);
IGlobalOptions_Release
(
&
global_options
->
IGlobalOptions_iface
);
return
hres
;
}
/***********************************************************************
* DllMain (OLE32.@)
*/
...
...
dlls/ole32/oleproxy.c
View file @
c1cb1713
...
...
@@ -148,17 +148,6 @@ static const IClassFactoryVtbl ComCatCFVtbl =
static
IClassFactory
ComCatCF
=
{
&
ComCatCFVtbl
};
static
const
IClassFactoryVtbl
GlobalOptionsCFVtbl
=
{
ClassFactory_QueryInterface
,
ClassFactory_AddRef
,
ClassFactory_Release
,
GlobalOptions_CreateInstance
,
ClassFactory_LockServer
};
IClassFactory
GlobalOptionsCF
=
{
&
GlobalOptionsCFVtbl
};
static
const
IClassFactoryVtbl
GlobalInterfaceTableCFVtbl
=
{
ClassFactory_QueryInterface
,
...
...
@@ -230,8 +219,6 @@ HRESULT WINAPI Ole32DllGetClassObject(REFCLSID rclsid, REFIID riid, void **obj)
return
IClassFactory_QueryInterface
(
&
GlobalInterfaceTableCF
,
riid
,
obj
);
else
if
(
IsEqualCLSID
(
rclsid
,
&
CLSID_ManualResetEvent
))
return
IClassFactory_QueryInterface
(
&
ManualResetEventCF
,
riid
,
obj
);
else
if
(
IsEqualCLSID
(
rclsid
,
&
CLSID_GlobalOptions
))
return
IClassFactory_QueryInterface
(
&
GlobalOptionsCF
,
riid
,
obj
);
else
if
(
IsEqualCLSID
(
rclsid
,
&
CLSID_InProcFreeMarshaler
))
return
FTMarshalCF_Create
(
riid
,
obj
);
else
...
...
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