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
7092313b
Commit
7092313b
authored
Dec 07, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum: Convert dll registration to the IRegistrar mechanism.
parent
343a2cb0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
214 deletions
+96
-214
Makefile.in
dlls/devenum/Makefile.in
+2
-0
devenum_classes.idl
dlls/devenum/devenum_classes.idl
+90
-0
devenum_main.c
dlls/devenum/devenum_main.c
+4
-214
No files found.
dlls/devenum/Makefile.in
View file @
7092313b
...
...
@@ -8,6 +8,8 @@ C_SRCS = \
mediacatenum.c
\
parsedisplayname.c
IDL_R_SRCS
=
devenum_classes.idl
RC_SRCS
=
\
Cs.rc
\
Cy.rc
\
...
...
dlls/devenum/devenum_classes.idl
0 → 100644
View file @
7092313b
/*
*
COM
Classes
for
devenum
*
*
Copyright
2010
Alexandre
Julliard
*
*
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
*/
[
helpstring
(
"System Device Enum"
),
threading
(
both
),
uuid
(
62b
e5d10
-
60
eb
-
11
d0
-
bd3b
-
00
a0c911ce86
)
]
coclass
SystemDeviceEnum
{
interface
ICreateDevEnum
; }
[
threading
(
both
),
progid
(
"device.1"
),
vi_progid
(
"device"
),
uuid
(
4315
d437
-
5b8
c
-
11
d0
-
bd3b
-
00
a0c911ce86
)
]
coclass
DeviceMoniker
{
interface
IParseDisplayName
; }
[
helpstring
(
"ACM Class Manager"
),
threading
(
both
),
uuid
(
33
d9a761
-
90
c8
-
11
d0
-
bd43
-
00
a0c911ce86
)
]
coclass
AudioCompressorCategory
{
}
[
helpstring
(
"ICM Class Manager"
),
threading
(
both
),
uuid
(
33
d9a760
-
90
c8
-
11
d0
-
bd43
-
00
a0c911ce86
)
]
coclass
VideoCompressorCategory
{
}
[
helpstring
(
"ActiveMovie Filter Class Manager"
),
threading
(
both
),
uuid
(
083863
f1
-
70
de
-
11
d0
-
bd40
-
00
a0c911ce86
)
]
coclass
LegacyAmFilterCategory
{
}
[
helpstring
(
"VFW Capture Class Manager"
),
threading
(
both
),
uuid
(
860b
b310
-
5
d01
-
11
d0
-
bd3b
-
00
a0c911ce86
)
]
coclass
VideoInputDeviceCategory
{
}
[
helpstring
(
"WaveIn Class Manager"
),
threading
(
both
),
uuid
(
33
d9a762
-
90
c8
-
11
d0
-
bd43
-
00
a0c911ce86
)
]
coclass
AudioInputDeviceCategory
{
}
[
helpstring
(
"WaveOut and DSound Class Manager"
),
threading
(
both
),
uuid
(
e0f158e1
-
cb04
-
11
d0
-
bd4e
-
00
a0c911ce86
)
]
coclass
AudioRendererCategory
{
}
[
helpstring
(
"MidiOut Class Manager"
),
threading
(
both
),
uuid
(
4
efe2452
-
168
a
-
11
d1
-
bc76
-
00
c04fb9453b
)
]
coclass
MidiRendererCategory
{
}
[
helpstring
(
"ActiveMovie Filter Categories"
),
threading
(
both
),
uuid
(
da4e3da0
-
d07d
-
11
d0
-
bd50
-
00
a0c911ce86
)
]
coclass
ActiveMovieCategories
{
}
dlls/devenum/devenum_main.c
View file @
7092313b
...
...
@@ -20,8 +20,8 @@
*/
#include "devenum_private.h"
#include "rpcproxy.h"
#include "wine/debug.h"
#include "winreg.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
devenum
);
...
...
@@ -35,7 +35,6 @@ typedef struct
BOOL
instance
;
}
register_info
;
static
HRESULT
register_clsids
(
int
count
,
const
register_info
*
pRegInfo
,
LPCWSTR
pszThreadingModel
);
static
void
DEVENUM_RegisterQuartz
(
void
);
/***********************************************************************
...
...
@@ -96,42 +95,12 @@ HRESULT WINAPI DllCanUnloadNow(void)
HRESULT
WINAPI
DllRegisterServer
(
void
)
{
HRESULT
res
;
HKEY
hkeyClsid
=
NULL
;
HKEY
hkey1
=
NULL
;
HKEY
hkey2
=
NULL
;
LPOLESTR
pszClsidDevMon
=
NULL
;
IFilterMapper2
*
pMapper
=
NULL
;
LPVOID
mapvptr
;
static
const
WCHAR
threadingModel
[]
=
{
'B'
,
'o'
,
't'
,
'h'
,
0
};
static
const
WCHAR
sysdevenum
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
' '
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
' '
,
'E'
,
'n'
,
'u'
,
'm'
,
0
};
static
const
WCHAR
devmon
[]
=
{
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'M'
,
'o'
,
'n'
,
'i'
,
'k'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
acmcat
[]
=
{
'A'
,
'C'
,
'M'
,
' '
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
' '
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
vidcat
[]
=
{
'I'
,
'C'
,
'M'
,
' '
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
' '
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
filtcat
[]
=
{
'A'
,
'c'
,
't'
,
'i'
,
'v'
,
'e'
,
'M'
,
'o'
,
'v'
,
'i'
,
'e'
,
' '
,
'F'
,
'i'
,
'l'
,
't'
,
'e'
,
'r'
,
' '
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
' '
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
vfwcat
[]
=
{
'V'
,
'F'
,
'W'
,
' '
,
'C'
,
'a'
,
'p'
,
't'
,
'u'
,
'r'
,
'e'
,
' '
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
' '
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
wavein
[]
=
{
'W'
,
'a'
,
'v'
,
'e'
,
'I'
,
'n'
,
' '
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
' '
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
waveout
[]
=
{
'W'
,
'a'
,
'v'
,
'e'
,
'O'
,
'u'
,
't'
,
' '
,
'a'
,
'n'
,
'd'
,
' '
,
'D'
,
'S'
,
'o'
,
'u'
,
'n'
,
'd'
,
' '
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
' '
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
midiout
[]
=
{
'M'
,
'i'
,
'd'
,
'i'
,
'O'
,
'u'
,
't'
,
' '
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
' '
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
amcat
[]
=
{
'A'
,
'c'
,
't'
,
'i'
,
'v'
,
'e'
,
'M'
,
'o'
,
'v'
,
'i'
,
'e'
,
' '
,
'F'
,
'i'
,
'l'
,
't'
,
'e'
,
'r'
,
' '
,
'C'
,
'a'
,
't'
,
'e'
,
'g'
,
'o'
,
'r'
,
'i'
,
'e'
,
's'
,
0
};
static
const
WCHAR
device
[]
=
{
'd'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
0
};
static
const
WCHAR
device_1
[]
=
{
'd'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'.'
,
'1'
,
0
};
static
const
register_info
ri
[]
=
{
{
&
CLSID_SystemDeviceEnum
,
sysdevenum
,
FALSE
},
{
&
CLSID_CDeviceMoniker
,
devmon
,
FALSE
},
{
&
CLSID_AudioCompressorCategory
,
acmcat
,
TRUE
},
{
&
CLSID_VideoCompressorCategory
,
vidcat
,
TRUE
},
{
&
CLSID_LegacyAmFilterCategory
,
filtcat
,
TRUE
},
{
&
CLSID_VideoInputDeviceCategory
,
vfwcat
,
FALSE
},
{
&
CLSID_AudioInputDeviceCategory
,
wavein
,
FALSE
},
{
&
CLSID_AudioRendererCategory
,
waveout
,
FALSE
},
{
&
CLSID_MidiRendererCategory
,
midiout
,
FALSE
},
{
&
CLSID_ActiveMovieCategories
,
amcat
,
TRUE
}
};
TRACE
(
"
\n
"
);
res
=
register_clsids
(
sizeof
(
ri
)
/
sizeof
(
register_info
),
ri
,
threadingModel
);
res
=
__wine_register_resources
(
DEVENUM_hInstance
,
NULL
);
/* Quartz is needed for IFilterMapper2 */
DEVENUM_RegisterQuartz
();
...
...
@@ -169,116 +138,6 @@ HRESULT WINAPI DllRegisterServer(void)
IFilterMapper2_Release
(
pMapper
);
}
/*** CDeviceMoniker ***/
if
(
SUCCEEDED
(
res
))
{
res
=
StringFromCLSID
(
&
CLSID_CDeviceMoniker
,
&
pszClsidDevMon
);
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
clsid_keyname
,
&
hkeyClsid
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegOpenKeyW
(
hkeyClsid
,
pszClsidDevMon
,
&
hkey1
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
SUCCEEDED
(
res
))
{
static
const
WCHAR
wszProgID
[]
=
{
'P'
,
'r'
,
'o'
,
'g'
,
'I'
,
'D'
,
0
};
res
=
RegCreateKeyW
(
hkey1
,
wszProgID
,
&
hkey2
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegSetValueW
(
hkey2
,
NULL
,
REG_SZ
,
device_1
,
(
lstrlenW
(
device_1
)
+
1
)
*
sizeof
(
WCHAR
))
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
hkey2
)
{
RegCloseKey
(
hkey2
);
hkey2
=
NULL
;
}
if
(
SUCCEEDED
(
res
))
{
static
const
WCHAR
wszVProgID
[]
=
{
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'I'
,
'n'
,
'd'
,
'e'
,
'p'
,
'e'
,
'd'
,
'e'
,
'n'
,
't'
,
'P'
,
'r'
,
'o'
,
'g'
,
'I'
,
'D'
,
0
};
res
=
RegCreateKeyW
(
hkey1
,
wszVProgID
,
&
hkey2
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegSetValueW
(
hkey2
,
NULL
,
REG_SZ
,
device
,
(
lstrlenW
(
device
)
+
1
)
*
sizeof
(
WCHAR
))
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
hkey2
)
{
RegCloseKey
(
hkey2
);
hkey2
=
NULL
;
}
if
(
hkey1
)
{
RegCloseKey
(
hkey1
);
hkey1
=
NULL
;
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegCreateKeyW
(
HKEY_CLASSES_ROOT
,
device
,
&
hkey1
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegCreateKeyW
(
hkey1
,
clsid_keyname
,
&
hkey2
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegSetValueW
(
hkey2
,
NULL
,
REG_SZ
,
pszClsidDevMon
,
(
lstrlenW
(
pszClsidDevMon
)
+
1
)
*
sizeof
(
WCHAR
))
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
hkey2
)
{
RegCloseKey
(
hkey2
);
hkey2
=
NULL
;
}
if
(
hkey1
)
{
RegCloseKey
(
hkey1
);
hkey1
=
NULL
;
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegCreateKeyW
(
HKEY_CLASSES_ROOT
,
device_1
,
&
hkey1
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegCreateKeyW
(
hkey1
,
clsid_keyname
,
&
hkey2
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegSetValueW
(
hkey2
,
NULL
,
REG_SZ
,
pszClsidDevMon
,
(
lstrlenW
(
pszClsidDevMon
)
+
1
)
*
sizeof
(
WCHAR
))
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
hkey2
)
RegCloseKey
(
hkey2
);
if
(
hkey1
)
RegCloseKey
(
hkey1
);
if
(
hkeyClsid
)
RegCloseKey
(
hkeyClsid
);
CoTaskMemFree
(
pszClsidDevMon
);
CoUninitialize
();
return
res
;
...
...
@@ -289,77 +148,8 @@ HRESULT WINAPI DllRegisterServer(void)
*/
HRESULT
WINAPI
DllUnregisterServer
(
void
)
{
FIXME
(
"stub!
\n
"
);
return
E_FAIL
;
}
static
HRESULT
register_clsids
(
int
count
,
const
register_info
*
pRegInfo
,
LPCWSTR
pszThreadingModel
)
{
HRESULT
res
=
S_OK
;
LPOLESTR
clsidString
=
NULL
;
HKEY
hkeyClsid
;
HKEY
hkeySub
;
HKEY
hkeyInproc32
;
HKEY
hkeyInstance
=
NULL
;
int
i
;
static
const
WCHAR
wcszInproc32
[]
=
{
'I'
,
'n'
,
'p'
,
'r'
,
'o'
,
'c'
,
'S'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
wcszThreadingModel
[]
=
{
'T'
,
'h'
,
'r'
,
'e'
,
'a'
,
'd'
,
'i'
,
'n'
,
'g'
,
'M'
,
'o'
,
'd'
,
'e'
,
'l'
,
0
};
static
const
WCHAR
dll_module
[]
=
{
'd'
,
'e'
,
'v'
,
'e'
,
'n'
,
'u'
,
'm'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
res
=
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
clsid_keyname
,
&
hkeyClsid
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
hkeySub
=
0
;
if
(
SUCCEEDED
(
res
))
{
res
=
StringFromCLSID
(
pRegInfo
[
i
].
clsid
,
&
clsidString
);
}
if
(
SUCCEEDED
(
res
))
{
res
=
RegCreateKeyW
(
hkeyClsid
,
clsidString
,
&
hkeySub
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
pRegInfo
[
i
].
instance
&&
SUCCEEDED
(
res
))
{
res
=
RegCreateKeyW
(
hkeySub
,
wszInstanceKeyName
,
&
hkeyInstance
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
RegCloseKey
(
hkeyInstance
);
}
if
(
SUCCEEDED
(
res
))
{
RegSetValueW
(
hkeySub
,
NULL
,
REG_SZ
,
pRegInfo
->
friendly_name
?
pRegInfo
[
i
].
friendly_name
:
clsidString
,
(
lstrlenW
(
pRegInfo
[
i
].
friendly_name
?
pRegInfo
->
friendly_name
:
clsidString
)
+
1
)
*
sizeof
(
WCHAR
));
res
=
RegCreateKeyW
(
hkeySub
,
wcszInproc32
,
&
hkeyInproc32
)
==
ERROR_SUCCESS
?
S_OK
:
E_FAIL
;
}
if
(
SUCCEEDED
(
res
))
{
RegSetValueW
(
hkeyInproc32
,
NULL
,
REG_SZ
,
dll_module
,
(
lstrlenW
(
dll_module
)
+
1
)
*
sizeof
(
WCHAR
));
RegSetValueExW
(
hkeyInproc32
,
wcszThreadingModel
,
0
,
REG_SZ
,
(
LPCVOID
)
pszThreadingModel
,
(
lstrlenW
(
pszThreadingModel
)
+
1
)
*
sizeof
(
WCHAR
));
RegCloseKey
(
hkeyInproc32
);
}
if
(
hkeySub
)
RegCloseKey
(
hkeySub
);
CoTaskMemFree
(
clsidString
);
clsidString
=
NULL
;
}
RegCloseKey
(
hkeyClsid
);
return
res
;
FIXME
(
"stub!
\n
"
);
return
__wine_unregister_resources
(
DEVENUM_hInstance
,
NULL
);
}
typedef
HRESULT
(
WINAPI
*
DllRegisterServer_func
)(
void
);
...
...
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