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
ff334121
Commit
ff334121
authored
Apr 07, 2014
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netprofm: Add a class factory implementation.
parent
984663ff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
2 deletions
+110
-2
main.c
dlls/netprofm/main.c
+108
-0
netprofm.spec
dlls/netprofm/netprofm.spec
+2
-2
No files found.
dlls/netprofm/main.c
View file @
ff334121
...
...
@@ -20,6 +20,15 @@
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#define COBJMACROS
#include "objbase.h"
#include "rpcproxy.h"
#include "netlistmgr.h"
#include "wine/debug.h"
#include "netprofm_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
netprofm
);
static
HINSTANCE
instance
;
...
...
@@ -36,3 +45,102 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
}
return
TRUE
;
}
struct
netprofm_cf
{
const
struct
IClassFactoryVtbl
*
vtbl
;
HRESULT
(
*
create_instance
)(
void
**
);
};
static
inline
struct
netprofm_cf
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
{
return
(
struct
netprofm_cf
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
struct
netprofm_cf
,
vtbl
));
}
static
HRESULT
WINAPI
netprofm_cf_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IClassFactory
))
{
IClassFactory_AddRef
(
iface
);
*
ppobj
=
iface
;
return
S_OK
;
}
FIXME
(
"interface %s not implemented
\n
"
,
debugstr_guid
(
riid
)
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
netprofm_cf_AddRef
(
IClassFactory
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
netprofm_cf_Release
(
IClassFactory
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
netprofm_cf_CreateInstance
(
IClassFactory
*
iface
,
LPUNKNOWN
outer
,
REFIID
riid
,
LPVOID
*
obj
)
{
struct
netprofm_cf
*
factory
=
impl_from_IClassFactory
(
iface
);
IUnknown
*
unk
;
HRESULT
r
;
TRACE
(
"%p %s %p
\n
"
,
outer
,
debugstr_guid
(
riid
),
obj
);
*
obj
=
NULL
;
if
(
outer
)
return
CLASS_E_NOAGGREGATION
;
r
=
factory
->
create_instance
(
(
void
**
)
&
unk
);
if
(
FAILED
(
r
))
return
r
;
r
=
IUnknown_QueryInterface
(
unk
,
riid
,
obj
);
if
(
FAILED
(
r
))
return
r
;
IUnknown_Release
(
unk
);
return
r
;
}
static
HRESULT
WINAPI
netprofm_cf_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
{
FIXME
(
"%p, %d
\n
"
,
iface
,
dolock
);
return
S_OK
;
}
static
const
struct
IClassFactoryVtbl
netprofm_cf_vtbl
=
{
netprofm_cf_QueryInterface
,
netprofm_cf_AddRef
,
netprofm_cf_Release
,
netprofm_cf_CreateInstance
,
netprofm_cf_LockServer
};
static
struct
netprofm_cf
list_manager_cf
=
{
&
netprofm_cf_vtbl
,
list_manager_create
};
/***********************************************************************
* DllGetClassObject (NETPROFM.@)
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
iid
,
LPVOID
*
ppv
)
{
IClassFactory
*
cf
=
NULL
;
TRACE
(
"%s %s %p
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
iid
),
ppv
);
if
(
IsEqualGUID
(
rclsid
,
&
CLSID_NetworkListManager
))
{
cf
=
(
IClassFactory
*
)
&
list_manager_cf
.
vtbl
;
}
if
(
!
cf
)
return
CLASS_E_CLASSNOTAVAILABLE
;
return
IClassFactory_QueryInterface
(
cf
,
iid
,
ppv
);
}
/***********************************************************************
* DllCanUnloadNow (NETPROFM.@)
*/
HRESULT
WINAPI
DllCanUnloadNow
(
void
)
{
return
S_FALSE
;
}
dlls/netprofm/netprofm.spec
View file @
ff334121
@ st
ub DllCanUnloadNow
@ st
ub DllGetClassObject
@ st
dcall -private DllCanUnloadNow()
@ st
dcall -private DllGetClassObject(ptr ptr ptr)
@ stub DllRegisterServer
@ stub 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