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
b80fe361
Commit
b80fe361
authored
Dec 15, 2009
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Dec 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Add class factory.
parent
b51311d6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
169 additions
and
2 deletions
+169
-2
Makefile.in
dlls/mmdevapi/Makefile.in
+1
-0
devenum.c
dlls/mmdevapi/devenum.c
+40
-0
main.c
dlls/mmdevapi/main.c
+109
-2
mmdevapi.h
dlls/mmdevapi/mmdevapi.h
+19
-0
No files found.
dlls/mmdevapi/Makefile.in
View file @
b80fe361
...
...
@@ -6,6 +6,7 @@ MODULE = mmdevapi.dll
IMPORTS
=
ole32 user32 advapi32 kernel32 ntdll
C_SRCS
=
\
devenum.c
\
main.c
\
regsvr.c
...
...
dlls/mmdevapi/devenum.c
0 → 100644
View file @
b80fe361
/*
* Copyright 2009 Maarten Lankhorst
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#define CINTERFACE
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "ole2.h"
#include "mmdeviceapi.h"
#include "mmdevapi.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mmdevapi
);
HRESULT
MMDevEnum_Create
(
REFIID
riid
,
void
**
ppv
)
{
FIXME
(
"stub
\n
"
);
return
CLASS_E_CLASSNOTAVAILABLE
;
}
dlls/mmdevapi/main.c
View file @
b80fe361
...
...
@@ -20,6 +20,8 @@
#include <stdarg.h>
#define CINTERFACE
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
...
...
@@ -28,6 +30,8 @@
#include "ole2.h"
#include "mmdeviceapi.h"
#include "mmdevapi.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mmdevapi
);
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
...
...
@@ -52,8 +56,111 @@ HRESULT WINAPI DllCanUnloadNow(void)
return
S_FALSE
;
}
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
)
typedef
HRESULT
(
*
FnCreateInstance
)(
REFIID
riid
,
LPVOID
*
ppobj
);
typedef
struct
{
const
IClassFactoryVtbl
*
lpVtbl
;
REFCLSID
rclsid
;
FnCreateInstance
pfnCreateInstance
;
}
IClassFactoryImpl
;
static
HRESULT
WINAPI
MMCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
FIXME
(
"stub
\n
"
);
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p, %s, %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
if
(
ppobj
==
NULL
)
return
E_POINTER
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IClassFactory
))
{
*
ppobj
=
iface
;
IUnknown_AddRef
(
iface
);
return
S_OK
;
}
*
ppobj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
MMCF_AddRef
(
LPCLASSFACTORY
iface
)
{
return
2
;
}
static
ULONG
WINAPI
MMCF_Release
(
LPCLASSFACTORY
iface
)
{
/* static class, won't be freed */
return
1
;
}
static
HRESULT
WINAPI
MMCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p, %p, %s, %p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
if
(
pOuter
)
return
CLASS_E_NOAGGREGATION
;
if
(
ppobj
==
NULL
)
{
WARN
(
"invalid parameter
\n
"
);
return
E_POINTER
;
}
*
ppobj
=
NULL
;
return
This
->
pfnCreateInstance
(
riid
,
ppobj
);
}
static
HRESULT
WINAPI
MMCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d) stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
}
static
const
IClassFactoryVtbl
MMCF_Vtbl
=
{
MMCF_QueryInterface
,
MMCF_AddRef
,
MMCF_Release
,
MMCF_CreateInstance
,
MMCF_LockServer
};
static
IClassFactoryImpl
MMDEVAPI_CF
[]
=
{
{
&
MMCF_Vtbl
,
&
CLSID_MMDeviceEnumerator
,
(
FnCreateInstance
)
MMDevEnum_Create
}
};
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
)
{
int
i
=
0
;
TRACE
(
"(%s, %s, %p)
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
if
(
ppv
==
NULL
)
{
WARN
(
"invalid parameter
\n
"
);
return
E_INVALIDARG
;
}
*
ppv
=
NULL
;
if
(
!
IsEqualIID
(
riid
,
&
IID_IClassFactory
)
&&
!
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
WARN
(
"no interface for %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
for
(
i
=
0
;
i
<
sizeof
(
MMDEVAPI_CF
)
/
sizeof
(
MMDEVAPI_CF
[
0
]);
++
i
)
{
if
(
IsEqualGUID
(
rclsid
,
MMDEVAPI_CF
[
i
].
rclsid
))
{
IUnknown_AddRef
((
IClassFactory
*
)
&
MMDEVAPI_CF
[
i
]);
*
ppv
=
&
MMDEVAPI_CF
[
i
];
return
S_OK
;
}
i
++
;
}
WARN
(
"(%s, %s, %p): no class found.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
return
CLASS_E_CLASSNOTAVAILABLE
;
}
dlls/mmdevapi/mmdevapi.h
0 → 100644
View file @
b80fe361
/*
* Copyright 2009 Maarten Lankhorst
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
extern
HRESULT
MMDevEnum_Create
(
REFIID
riid
,
void
**
ppv
);
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