ReactOS 0.4.15-dev-7958-gcd0bb1a
dmoreg.h File Reference
#include "mediaobj.h"
Include dependency graph for dmoreg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DMO_PARTIAL_MEDIATYPE
 

Typedefs

typedef struct _DMO_PARTIAL_MEDIATYPE DMO_PARTIAL_MEDIATYPE
 
typedef struct _DMO_PARTIAL_MEDIATYPEPDMO_PARTIAL_MEDIATYPE
 

Enumerations

enum  DMO_REGISTER_FLAGS { DMO_REGISTERF_IS_KEYED = 1 }
 
enum  DMO_ENUM_FLAGS { DMO_ENUMF_INCLUDE_KEYED = 1 }
 

Functions

HRESULT WINAPI DMORegister (LPCWSTR, REFCLSID, REFGUID, DWORD, DWORD, const DMO_PARTIAL_MEDIATYPE *, DWORD, const DMO_PARTIAL_MEDIATYPE *)
 
HRESULT WINAPI DMOUnregister (REFCLSID, REFGUID)
 
HRESULT WINAPI DMOEnum (REFGUID, DWORD, DWORD, const DMO_PARTIAL_MEDIATYPE *, DWORD, const DMO_PARTIAL_MEDIATYPE *, IEnumDMO **)
 
HRESULT WINAPI DMOGetTypes (REFCLSID, ULONG, ULONG *, DMO_PARTIAL_MEDIATYPE *, ULONG, ULONG *, DMO_PARTIAL_MEDIATYPE *)
 
HRESULT WINAPI DMOGetName (REFCLSID, WCHAR[80])
 
 DEFINE_GUID (DMOCATEGORY_AUDIO_DECODER, 0x57f2db8b, 0xe6bb, 0x4513, 0x9d, 0x43, 0xdc, 0xd2, 0xa6, 0x59, 0x31, 0x25)
 
 DEFINE_GUID (DMOCATEGORY_AUDIO_ENCODER, 0x33d9a761, 0x90c8, 0x11d0, 0xbd, 0x43, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
 
 DEFINE_GUID (DMOCATEGORY_VIDEO_DECODER, 0x4a69b442, 0x28be, 0x4991, 0x96, 0x9c, 0xb5, 0x00, 0xad, 0xf5, 0xd8, 0xa8)
 
 DEFINE_GUID (DMOCATEGORY_VIDEO_ENCODER, 0x33d9a760, 0x90c8, 0x11d0, 0xbd, 0x43, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
 
 DEFINE_GUID (DMOCATEGORY_AUDIO_EFFECT, 0xf3602b3f, 0x0592, 0x48df, 0xa4, 0xcd, 0x67, 0x47, 0x21, 0xe7, 0xeb, 0xeb)
 
 DEFINE_GUID (DMOCATEGORY_VIDEO_EFFECT, 0xd990ee14, 0x776c, 0x4723, 0xbe, 0x46, 0x3d, 0xa2, 0xf5, 0x6f, 0x10, 0xb9)
 
 DEFINE_GUID (DMOCATEGORY_AUDIO_CAPTURE_EFFECT, 0xf665aaba, 0x3e09, 0x4920, 0xaa, 0x5f, 0x21, 0x98, 0x11, 0x14, 0x8f, 0x09)
 
 DEFINE_GUID (DMOCATEGORY_ACOUSTIC_ECHO_CANCEL, 0xbf963d80, 0xc559, 0x11d0, 0x8a, 0x2b, 0x00, 0xa0, 0xc9, 0x25, 0x5a, 0xc1)
 
 DEFINE_GUID (DMOCATEGORY_AUDIO_NOISE_SUPPRESS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5)
 
 DEFINE_GUID (DMOCATEGORY_AGC, 0xe88c9ba0, 0xc557, 0x11d0, 0x8a, 0x2b, 0x00, 0xa0, 0xc9, 0x25, 0x5a, 0xc1)
 

Typedef Documentation

◆ DMO_PARTIAL_MEDIATYPE

◆ PDMO_PARTIAL_MEDIATYPE

Enumeration Type Documentation

◆ DMO_ENUM_FLAGS

Enumerator
DMO_ENUMF_INCLUDE_KEYED 

Definition at line 35 of file dmoreg.h.

36{
38};
@ DMO_ENUMF_INCLUDE_KEYED
Definition: dmoreg.h:37

◆ DMO_REGISTER_FLAGS

Enumerator
DMO_REGISTERF_IS_KEYED 

Definition at line 30 of file dmoreg.h.

31{
33};
@ DMO_REGISTERF_IS_KEYED
Definition: dmoreg.h:32

Function Documentation

◆ DEFINE_GUID() [1/10]

DEFINE_GUID ( DMOCATEGORY_ACOUSTIC_ECHO_CANCEL  ,
0xbf963d80  ,
0xc559  ,
0x11d0  ,
0x8a  ,
0x2b  ,
0x00  ,
0xa0  ,
0xc9  ,
0x25  ,
0x5a  ,
0xc1   
)

◆ DEFINE_GUID() [2/10]

DEFINE_GUID ( DMOCATEGORY_AGC  ,
0xe88c9ba0  ,
0xc557  ,
0x11d0  ,
0x8a  ,
0x2b  ,
0x00  ,
0xa0  ,
0xc9  ,
0x25  ,
0x5a  ,
0xc1   
)

◆ DEFINE_GUID() [3/10]

DEFINE_GUID ( DMOCATEGORY_AUDIO_CAPTURE_EFFECT  ,
0xf665aaba  ,
0x3e09  ,
0x4920  ,
0xaa  ,
0x5f  ,
0x21  ,
0x98  ,
0x11  ,
0x14  ,
0x8f  ,
0x09   
)

◆ DEFINE_GUID() [4/10]

DEFINE_GUID ( DMOCATEGORY_AUDIO_DECODER  ,
0x57f2db8b  ,
0xe6bb  ,
0x4513  ,
0x9d  ,
0x43  ,
0xdc  ,
0xd2  ,
0xa6  ,
0x59  ,
0x31  ,
0x25   
)

◆ DEFINE_GUID() [5/10]

DEFINE_GUID ( DMOCATEGORY_AUDIO_EFFECT  ,
0xf3602b3f  ,
0x0592  ,
0x48df  ,
0xa4  ,
0xcd  ,
0x67  ,
0x47  ,
0x21  ,
0xe7  ,
0xeb  ,
0xeb   
)

◆ DEFINE_GUID() [6/10]

DEFINE_GUID ( DMOCATEGORY_AUDIO_ENCODER  ,
0x33d9a761  ,
0x90c8  ,
0x11d0  ,
0xbd  ,
0x43  ,
0x00  ,
0xa0  ,
0xc9  ,
0x11  ,
0xce  ,
0x86   
)

◆ DEFINE_GUID() [7/10]

DEFINE_GUID ( DMOCATEGORY_AUDIO_NOISE_SUPPRESS  ,
0xe07f903f  ,
0x62fd  ,
0x4e60  ,
0x8c  ,
0xdd  ,
0xde  ,
0xa7  ,
0x23  ,
0x66  ,
0x65  ,
0xb5   
)

◆ DEFINE_GUID() [8/10]

DEFINE_GUID ( DMOCATEGORY_VIDEO_DECODER  ,
0x4a69b442  ,
0x28be  ,
0x4991  ,
0x96  ,
0x9c  ,
0xb5  ,
0x00  ,
0xad  ,
0xf5  ,
0xd8  ,
0xa8   
)

◆ DEFINE_GUID() [9/10]

DEFINE_GUID ( DMOCATEGORY_VIDEO_EFFECT  ,
0xd990ee14  ,
0x776c  ,
0x4723  ,
0xbe  ,
0x46  ,
0x3d  ,
0xa2  ,
0xf5  ,
0x6f  ,
0x10  ,
0xb9   
)

◆ DEFINE_GUID() [10/10]

DEFINE_GUID ( DMOCATEGORY_VIDEO_ENCODER  ,
0x33d9a760  ,
0x90c8  ,
0x11d0  ,
0xbd  ,
0x43  ,
0x00  ,
0xa0  ,
0xc9  ,
0x11  ,
0xce  ,
0x86   
)

◆ DMOEnum()

HRESULT WINAPI DMOEnum ( REFGUID  category,
DWORD  flags,
DWORD  cInTypes,
const DMO_PARTIAL_MEDIATYPE pInTypes,
DWORD  cOutTypes,
const DMO_PARTIAL_MEDIATYPE pOutTypes,
IEnumDMO **  ppEnum 
)

Definition at line 732 of file dmoreg.c.

740{
741 TRACE("%s 0x%08x %d %p %d %p %p\n", debugstr_guid(category), flags, cInTypes, pInTypes,
742 cOutTypes, pOutTypes, ppEnum);
743
744 if (TRACE_ON(msdmo))
745 {
746 DWORD i;
747 if (cInTypes)
748 {
749 for (i = 0; i < cInTypes; i++)
750 TRACE("intype %d - type %s, subtype %s\n", i, debugstr_guid(&pInTypes[i].type),
751 debugstr_guid(&pInTypes[i].subtype));
752 }
753
754 if (cOutTypes) {
755 for (i = 0; i < cOutTypes; i++)
756 TRACE("outtype %d - type %s, subtype %s\n", i, debugstr_guid(&pOutTypes[i].type),
757 debugstr_guid(&pOutTypes[i].subtype));
758 }
759 }
760
761 return IEnumDMO_Constructor(category, flags, cInTypes,
762 pInTypes, cOutTypes, pOutTypes, ppEnum);
763}
#define TRACE_ON(x)
Definition: compat.h:75
static HRESULT IEnumDMO_Constructor(REFGUID guidCategory, DWORD dwFlags, DWORD cInTypes, const DMO_PARTIAL_MEDIATYPE *pInTypes, DWORD cOutTypes, const DMO_PARTIAL_MEDIATYPE *pOutTypes, IEnumDMO **obj)
Definition: dmoreg.c:391
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLbitfield flags
Definition: glext.h:7161
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by create_EnumMoniker().

◆ DMOGetName()

HRESULT WINAPI DMOGetName ( REFCLSID  ,
WCHAR  [80] 
)

◆ DMOGetTypes()

HRESULT WINAPI DMOGetTypes ( REFCLSID  clsidDMO,
ULONG  ulInputTypesRequested,
ULONG pulInputTypesSupplied,
DMO_PARTIAL_MEDIATYPE pInputTypes,
ULONG  ulOutputTypesRequested,
ULONG pulOutputTypesSupplied,
DMO_PARTIAL_MEDIATYPE pOutputTypes 
)

Definition at line 857 of file dmoreg.c.

864{
865 HKEY root,hkey;
866 HRESULT ret = S_OK;
867 WCHAR szguid[64];
868
869 TRACE ("(%s,%u,%p,%p,%u,%p,%p)\n", debugstr_guid(clsidDMO), ulInputTypesRequested,
870 pulInputTypesSupplied, pInputTypes, ulOutputTypesRequested, pulOutputTypesSupplied,
871 pOutputTypes);
872
874 KEY_READ, &root))
875 return E_FAIL;
876
877 if (ERROR_SUCCESS != RegOpenKeyExW(root,GUIDToString(szguid,clsidDMO) , 0,
878 KEY_READ, &hkey))
879 {
881 return E_FAIL;
882 }
883
884 if (ulInputTypesRequested > 0)
885 {
886 ret = read_types(hkey, szDMOInputType, pulInputTypesSupplied, ulInputTypesRequested, pInputTypes );
887 }
888 else
889 *pulInputTypesSupplied = 0;
890
891 if (ulOutputTypesRequested > 0)
892 {
893 HRESULT ret2;
894 ret2 = read_types(hkey, szDMOOutputType, pulOutputTypesSupplied, ulOutputTypesRequested, pOutputTypes );
895
896 if (ret == S_OK)
897 ret = ret2;
898 }
899 else
900 *pulOutputTypesSupplied = 0;
901
902 return ret;
903}
#define RegCloseKey(hKey)
Definition: registry.h:49
struct _root root
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
static const WCHAR szDMORootKey[]
Definition: dmoreg.c:37
static LPWSTR GUIDToString(LPWSTR lpwstr, REFGUID lpcguid)
Definition: dmoreg.c:109
static const WCHAR szDMOInputType[]
Definition: dmoreg.c:43
static const WCHAR szDMOOutputType[]
Definition: dmoreg.c:48
static HRESULT read_types(HKEY root, LPCWSTR key, ULONG *supplied, ULONG requested, DMO_PARTIAL_MEDIATYPE *types)
Definition: dmoreg.c:778
#define S_OK
Definition: intsafe.h:52
#define KEY_READ
Definition: nt_native.h:1023
int ret
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ DMORegister()

HRESULT WINAPI DMORegister ( LPCWSTR  szName,
REFCLSID  clsidDMO,
REFGUID  guidCategory,
DWORD  dwFlags,
DWORD  cInTypes,
const DMO_PARTIAL_MEDIATYPE pInTypes,
DWORD  cOutTypes,
const DMO_PARTIAL_MEDIATYPE pOutTypes 
)

Definition at line 183 of file dmoreg.c.

193{
194 WCHAR szguid[64];
196 HKEY hrkey = 0;
197 HKEY hkey = 0;
198 HKEY hckey = 0;
199 HKEY hclskey = 0;
200 LONG ret;
201
202 TRACE("%s %s %s\n", debugstr_w(szName), debugstr_guid(clsidDMO), debugstr_guid(guidCategory));
203
204 if (IsEqualGUID(guidCategory, &GUID_NULL))
205 return E_INVALIDARG;
206
209 if (ret)
210 return E_FAIL;
211
212 /* Create clsidDMO key under MediaObjects */
213 ret = RegCreateKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, NULL,
215 if (ret)
216 goto lend;
217
218 /* Set default Name value */
219 ret = RegSetValueExW(hkey, NULL, 0, REG_SZ, (const BYTE*) szName,
220 (lstrlenW(szName) + 1) * sizeof(WCHAR));
221
222 /* Set InputTypes */
223 hres = write_types(hkey, szDMOInputType, pInTypes, cInTypes);
224
225 /* Set OutputTypes */
226 hres = write_types(hkey, szDMOOutputType, pOutTypes, cOutTypes);
227
229 {
230 /* Create Keyed key */
233 if (ret)
234 goto lend;
235 RegCloseKey(hckey);
236 }
237
238 /* Register the category */
241 if (ret)
242 goto lend;
243
244 RegCloseKey(hkey);
245
246 ret = RegCreateKeyExW(hckey, GUIDToString(szguid, guidCategory), 0, NULL,
248 if (ret)
249 goto lend;
250 ret = RegCreateKeyExW(hkey, GUIDToString(szguid, clsidDMO), 0, NULL,
252 if (ret)
253 goto lend;
254
255lend:
256 if (hkey)
257 RegCloseKey(hkey);
258 if (hckey)
259 RegCloseKey(hckey);
260 if (hclskey)
261 RegCloseKey(hclskey);
262 if (hrkey)
263 RegCloseKey(hrkey);
264
266 TRACE(" hresult=0x%08x\n", hres);
267 return hres;
268}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
#define lstrlenW
Definition: compat.h:750
static HRESULT write_types(HKEY hkey, LPCWSTR name, const DMO_PARTIAL_MEDIATYPE *types, DWORD count)
Definition: dmoreg.c:140
static const WCHAR szDMOKeyed[]
Definition: dmoreg.c:53
static const WCHAR szDMOCategories[]
Definition: dmoreg.c:58
#define debugstr_w
Definition: kernel32.h:32
#define GUID_NULL
Definition: ks.h:106
#define REG_SZ
Definition: layer.c:22
HRESULT hres
Definition: protocol.c:465
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
long LONG
Definition: pedump.c:60
static const WCHAR szName[]
Definition: powrprof.c:45
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
unsigned char BYTE
Definition: xxhash.c:193

Referenced by test_dmo().

◆ DMOUnregister()

HRESULT WINAPI DMOUnregister ( REFCLSID  dmo,
REFGUID  category 
)

Definition at line 290 of file dmoreg.c.

291{
292 HKEY rootkey = 0, categorieskey = 0;
293 WCHAR dmoW[64], catW[64];
295 LONG ret;
296
297 TRACE("%s %s\n", debugstr_guid(dmo), debugstr_guid(category));
298
300 if (ret)
301 return S_FALSE;
302
303 GUIDToString(dmoW, dmo);
304 RegDeleteKeyW(rootkey, dmoW);
305
306 /* open 'Categories' */
307 ret = RegOpenKeyExW(rootkey, szDMOCategories, 0, KEY_WRITE|KEY_ENUMERATE_SUB_KEYS, &categorieskey);
308 RegCloseKey(rootkey);
309 if (ret)
310 {
312 goto lend;
313 }
314
315 /* remove from all categories */
317 {
318 DWORD index = 0, len = ARRAY_SIZE(catW);
319
320 while (!RegEnumKeyExW(categorieskey, index++, catW, &len, NULL, NULL, NULL, NULL))
321 hr = unregister_dmo_from_category(dmoW, catW, categorieskey);
322 }
323 else
324 {
325 GUIDToString(catW, category);
326 hr = unregister_dmo_from_category(dmoW, catW, categorieskey);
327 }
328
329lend:
330 if (categorieskey)
331 RegCloseKey(categorieskey);
332
333 return hr;
334}
#define ARRAY_SIZE(A)
Definition: main.h:33
static const WCHAR dmoW[]
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
static HRESULT unregister_dmo_from_category(const WCHAR *dmoW, const WCHAR *catW, HKEY categories)
Definition: dmoreg.c:270
GLuint index
Definition: glext.h:6031
GLenum GLsizei len
Definition: glext.h:6722
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019
HRESULT hr
Definition: shlfolder.c:183
#define S_FALSE
Definition: winerror.h:2357

Referenced by test_dmo().