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
05b14634
Commit
05b14634
authored
Aug 16, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemdisp: Add a class factory implementation.
parent
5928f54a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
107 additions
and
2 deletions
+107
-2
main.c
dlls/wbemdisp/main.c
+105
-0
wbemdisp.spec
dlls/wbemdisp/wbemdisp.spec
+2
-2
No files found.
dlls/wbemdisp/main.c
View file @
05b14634
...
...
@@ -18,13 +18,96 @@
#include "config.h"
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "wbemdisp.h"
#include "rpcproxy.h"
#include "wine/debug.h"
#include "wbemdisp_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wbemdisp
);
static
HINSTANCE
instance
;
struct
factory
{
IClassFactory
IClassFactory_iface
;
HRESULT
(
*
fnCreateInstance
)(
IUnknown
*
,
LPVOID
*
);
};
static
inline
struct
factory
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
factory
,
IClassFactory_iface
);
}
static
HRESULT
WINAPI
factory_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
LPVOID
*
obj
)
{
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IClassFactory
))
{
IClassFactory_AddRef
(
iface
);
*
obj
=
iface
;
return
S_OK
;
}
FIXME
(
"interface %s not implemented
\n
"
,
debugstr_guid
(
riid
)
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
factory_AddRef
(
IClassFactory
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
factory_Release
(
IClassFactory
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
factory_CreateInstance
(
IClassFactory
*
iface
,
LPUNKNOWN
outer
,
REFIID
riid
,
LPVOID
*
obj
)
{
struct
factory
*
factory
=
impl_from_IClassFactory
(
iface
);
IUnknown
*
unk
;
HRESULT
hr
;
TRACE
(
"%p, %s, %p
\n
"
,
outer
,
debugstr_guid
(
riid
),
obj
);
*
obj
=
NULL
;
if
(
outer
)
return
CLASS_E_NOAGGREGATION
;
hr
=
factory
->
fnCreateInstance
(
outer
,
(
LPVOID
*
)
&
unk
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IUnknown_QueryInterface
(
unk
,
riid
,
obj
);
if
(
FAILED
(
hr
))
return
hr
;
IUnknown_Release
(
unk
);
return
hr
;
}
static
HRESULT
WINAPI
factory_LockServer
(
IClassFactory
*
iface
,
BOOL
lock
)
{
FIXME
(
"%p, %d
\n
"
,
iface
,
lock
);
return
S_OK
;
}
static
const
struct
IClassFactoryVtbl
factory_vtbl
=
{
factory_QueryInterface
,
factory_AddRef
,
factory_Release
,
factory_CreateInstance
,
factory_LockServer
};
static
struct
factory
swbem_locator_cf
=
{
{
&
factory_vtbl
},
SWbemLocator_create
};
BOOL
WINAPI
DllMain
(
HINSTANCE
hinst
,
DWORD
reason
,
LPVOID
reserved
)
{
...
...
@@ -40,6 +123,28 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
return
TRUE
;
}
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
iid
,
LPVOID
*
obj
)
{
IClassFactory
*
cf
=
NULL
;
TRACE
(
"%s, %s, %p
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
iid
),
obj
);
if
(
IsEqualGUID
(
rclsid
,
&
CLSID_SWbemLocator
))
{
cf
=
&
swbem_locator_cf
.
IClassFactory_iface
;
}
if
(
!
cf
)
return
CLASS_E_CLASSNOTAVAILABLE
;
return
IClassFactory_QueryInterface
(
cf
,
iid
,
obj
);
}
/***********************************************************************
* DllCanUnloadNow (WBEMDISP.@)
*/
HRESULT
WINAPI
DllCanUnloadNow
(
void
)
{
return
S_FALSE
;
}
/***********************************************************************
* DllRegisterServer (WBEMDISP.@)
*/
...
...
dlls/wbemdisp/wbemdisp.spec
View file @
05b14634
@ st
ub DllCanUnloadNow
@ st
ub DllGetClassObject
@ st
dcall -private DllCanUnloadNow()
@ st
dcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()
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