ReactOS  0.4.13-dev-39-g8b6696f
dmoreg.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winerror.h"
#include "winreg.h"
#include "objbase.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "dmo.h"
Include dependency graph for dmoreg.c:

Go to the source code of this file.

Classes

struct  IEnumDMOImpl
 

Macros

#define COBJMACROS
 
#define MSDMO_MAJOR_VERSION   6
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msdmo)
 
static IEnumDMOImplimpl_from_IEnumDMO (IEnumDMO *iface)
 
static HRESULT read_types (HKEY root, LPCWSTR key, ULONG *supplied, ULONG requested, DMO_PARTIAL_MEDIATYPE *types)
 
static LPWSTR GUIDToString (LPWSTR lpwstr, REFGUID lpcguid)
 
static HRESULT string_to_guid (const WCHAR *string, GUID *guid)
 
static BOOL IsMediaTypeEqual (const DMO_PARTIAL_MEDIATYPE *mt1, const DMO_PARTIAL_MEDIATYPE *mt2)
 
static HRESULT write_types (HKEY hkey, LPCWSTR name, const DMO_PARTIAL_MEDIATYPE *types, DWORD count)
 
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)
 
static HRESULT unregister_dmo_from_category (const WCHAR *dmoW, const WCHAR *catW, HKEY categories)
 
HRESULT WINAPI DMOUnregister (REFCLSID dmo, REFGUID category)
 
HRESULT WINAPI DMOGetName (REFCLSID clsidDMO, WCHAR name[])
 
static HRESULT dup_partial_mediatype (const DMO_PARTIAL_MEDIATYPE *types, DWORD count, DMO_PARTIAL_MEDIATYPE **ret)
 
static HRESULT IEnumDMO_Constructor (REFGUID guidCategory, DWORD dwFlags, DWORD cInTypes, const DMO_PARTIAL_MEDIATYPE *pInTypes, DWORD cOutTypes, const DMO_PARTIAL_MEDIATYPE *pOutTypes, IEnumDMO **obj)
 
static ULONG WINAPI IEnumDMO_fnAddRef (IEnumDMO *iface)
 
static HRESULT WINAPI IEnumDMO_fnQueryInterface (IEnumDMO *iface, REFIID riid, void **ppvObj)
 
static ULONG WINAPI IEnumDMO_fnRelease (IEnumDMO *iface)
 
static HRESULT WINAPI IEnumDMO_fnNext (IEnumDMO *iface, DWORD cItemsToFetch, CLSID *pCLSID, WCHAR **Names, DWORD *pcItemsFetched)
 
static HRESULT WINAPI IEnumDMO_fnSkip (IEnumDMO *iface, DWORD cItemsToSkip)
 
static HRESULT WINAPI IEnumDMO_fnReset (IEnumDMO *iface)
 
static HRESULT WINAPI IEnumDMO_fnClone (IEnumDMO *iface, IEnumDMO **ppEnum)
 
HRESULT WINAPI DMOEnum (REFGUID category, DWORD flags, DWORD cInTypes, const DMO_PARTIAL_MEDIATYPE *pInTypes, DWORD cOutTypes, const DMO_PARTIAL_MEDIATYPE *pOutTypes, IEnumDMO **ppEnum)
 
HRESULT WINAPI DMOGetTypes (REFCLSID clsidDMO, ULONG ulInputTypesRequested, ULONG *pulInputTypesSupplied, DMO_PARTIAL_MEDIATYPE *pInputTypes, ULONG ulOutputTypesRequested, ULONG *pulOutputTypesSupplied, DMO_PARTIAL_MEDIATYPE *pOutputTypes)
 

Variables

static const WCHAR szDMORootKey []
 
static const WCHAR szDMOInputType []
 
static const WCHAR szDMOOutputType []
 
static const WCHAR szDMOKeyed []
 
static const WCHAR szDMOCategories []
 
static const WCHAR szGUIDFmt []
 
static const WCHAR szCat3Fmt []
 
static const WCHAR szCat2Fmt []
 
static const WCHAR szToGuidFmt []
 
static const IEnumDMOVtbl edmovt
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file dmoreg.c.

◆ MSDMO_MAJOR_VERSION

#define MSDMO_MAJOR_VERSION   6

Definition at line 36 of file dmoreg.c.

Function Documentation

◆ 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 730 of file dmoreg.c.

738 {
739  TRACE("%s 0x%08x %d %p %d %p %p\n", debugstr_guid(category), flags, cInTypes, pInTypes,
740  cOutTypes, pOutTypes, ppEnum);
741 
742  if (TRACE_ON(msdmo))
743  {
744  DWORD i;
745  if (cInTypes)
746  {
747  for (i = 0; i < cInTypes; i++)
748  TRACE("intype %d - type %s, subtype %s\n", i, debugstr_guid(&pInTypes[i].type),
749  debugstr_guid(&pInTypes[i].subtype));
750  }
751 
752  if (cOutTypes) {
753  for (i = 0; i < cOutTypes; i++)
754  TRACE("outtype %d - type %s, subtype %s\n", i, debugstr_guid(&pOutTypes[i].type),
755  debugstr_guid(&pOutTypes[i].subtype));
756  }
757  }
758 
759  return IEnumDMO_Constructor(category, flags, cInTypes,
760  pInTypes, cOutTypes, pOutTypes, ppEnum);
761 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
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
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:392
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define TRACE_ON(x)
Definition: compat.h:65

◆ DMOGetName()

HRESULT WINAPI DMOGetName ( REFCLSID  clsidDMO,
WCHAR  name[] 
)

Definition at line 343 of file dmoreg.c.

344 {
345  static const INT max_name_len = 80*sizeof(WCHAR);
346  DWORD count = max_name_len;
347  WCHAR szguid[64];
348  HKEY hrkey, hkey;
349  LONG ret;
350 
351  TRACE("%s %p\n", debugstr_guid(clsidDMO), name);
352 
354  return E_FAIL;
355 
356  ret = RegOpenKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, KEY_READ, &hkey);
357  RegCloseKey(hrkey);
358  if (ret)
359  return E_FAIL;
360 
362  RegCloseKey(hkey);
363 
364  if (!ret && count > 1)
365  {
366  TRACE("name=%s\n", debugstr_w(name));
367  return S_OK;
368  }
369 
370  name[0] = 0;
371  return S_FALSE;
372 }
static const WCHAR szDMORootKey[]
Definition: dmoreg.c:38
#define KEY_READ
Definition: nt_native.h:1023
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define E_FAIL
Definition: ddrawi.h:102
int32_t INT
Definition: typedefs.h:56
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static LPWSTR GUIDToString(LPWSTR lpwstr, REFGUID lpcguid)
Definition: dmoreg.c:110
#define S_OK
Definition: intsafe.h:59
Definition: name.c:36
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

◆ 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 855 of file dmoreg.c.

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

◆ 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 184 of file dmoreg.c.

194 {
195  WCHAR szguid[64];
196  HRESULT hres;
197  HKEY hrkey = 0;
198  HKEY hkey = 0;
199  HKEY hckey = 0;
200  HKEY hclskey = 0;
201  LONG ret;
202 
203  TRACE("%s %s %s\n", debugstr_w(szName), debugstr_guid(clsidDMO), debugstr_guid(guidCategory));
204 
205  if (IsEqualGUID(guidCategory, &GUID_NULL))
206  return E_INVALIDARG;
207 
210  if (ret)
211  return E_FAIL;
212 
213  /* Create clsidDMO key under MediaObjects */
214  ret = RegCreateKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, NULL,
216  if (ret)
217  goto lend;
218 
219  /* Set default Name value */
220  ret = RegSetValueExW(hkey, NULL, 0, REG_SZ, (const BYTE*) szName,
221  (strlenW(szName) + 1) * sizeof(WCHAR));
222 
223  /* Set InputTypes */
224  hres = write_types(hkey, szDMOInputType, pInTypes, cInTypes);
225 
226  /* Set OutputTypes */
227  hres = write_types(hkey, szDMOOutputType, pOutTypes, cOutTypes);
228 
230  {
231  /* Create Keyed key */
232  ret = RegCreateKeyExW(hkey, szDMOKeyed, 0, NULL,
234  if (ret)
235  goto lend;
236  RegCloseKey(hckey);
237  }
238 
239  /* Register the category */
242  if (ret)
243  goto lend;
244 
245  RegCloseKey(hkey);
246 
247  ret = RegCreateKeyExW(hckey, GUIDToString(szguid, guidCategory), 0, NULL,
249  if (ret)
250  goto lend;
251  ret = RegCreateKeyExW(hkey, GUIDToString(szguid, clsidDMO), 0, NULL,
253  if (ret)
254  goto lend;
255 
256 lend:
257  if (hkey)
258  RegCloseKey(hkey);
259  if (hckey)
260  RegCloseKey(hckey);
261  if (hclskey)
262  RegCloseKey(hclskey);
263  if (hrkey)
264  RegCloseKey(hrkey);
265 
267  TRACE(" hresult=0x%08x\n", hres);
268  return hres;
269 }
static const WCHAR szDMORootKey[]
Definition: dmoreg.c:38
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static HRESULT write_types(HKEY hkey, LPCWSTR name, const DMO_PARTIAL_MEDIATYPE *types, DWORD count)
Definition: dmoreg.c:141
#define E_FAIL
Definition: ddrawi.h:102
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:1094
static const WCHAR szDMOKeyed[]
Definition: dmoreg.c:54
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
static const WCHAR szDMOOutputType[]
Definition: dmoreg.c:49
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
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:4917
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR szDMOCategories[]
Definition: dmoreg.c:59
static const WCHAR szDMOInputType[]
Definition: dmoreg.c:44
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
unsigned char BYTE
Definition: mem.h:68
#define GUID_NULL
Definition: ks.h:106
static LPWSTR GUIDToString(LPWSTR lpwstr, REFGUID lpcguid)
Definition: dmoreg.c:110
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static const WCHAR szName[]
Definition: msipriv.h:1194
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define REG_SZ
Definition: layer.c:22

◆ DMOUnregister()

HRESULT WINAPI DMOUnregister ( REFCLSID  dmo,
REFGUID  category 
)

Definition at line 291 of file dmoreg.c.

292 {
293  HKEY rootkey = 0, categorieskey = 0;
294  WCHAR dmoW[64], catW[64];
295  HRESULT hr = S_FALSE;
296  LONG ret;
297 
298  TRACE("%s %s\n", debugstr_guid(dmo), debugstr_guid(category));
299 
301  if (ret)
302  return S_FALSE;
303 
304  GUIDToString(dmoW, dmo);
305  RegDeleteKeyW(rootkey, dmoW);
306 
307  /* open 'Categories' */
308  ret = RegOpenKeyExW(rootkey, szDMOCategories, 0, KEY_WRITE|KEY_ENUMERATE_SUB_KEYS, &categorieskey);
309  RegCloseKey(rootkey);
310  if (ret)
311  {
313  goto lend;
314  }
315 
316  /* remove from all categories */
318  {
319  DWORD index = 0, len = ARRAY_SIZE(catW);
320 
321  while (!RegEnumKeyExW(categorieskey, index++, catW, &len, NULL, NULL, NULL, NULL))
322  hr = unregister_dmo_from_category(dmoW, catW, categorieskey);
323  }
324  else
325  {
326  GUIDToString(catW, category);
327  hr = unregister_dmo_from_category(dmoW, catW, categorieskey);
328  }
329 
330 lend:
331  if (categorieskey)
332  RegCloseKey(categorieskey);
333 
334  return hr;
335 }
static const WCHAR szDMORootKey[]
Definition: dmoreg.c:38
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HRESULT hr
Definition: shlfolder.c:183
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1240
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
static HRESULT unregister_dmo_from_category(const WCHAR *dmoW, const WCHAR *catW, HKEY categories)
Definition: dmoreg.c:271
GLuint index
Definition: glext.h:6031
#define debugstr_guid
Definition: kernel32.h:35
#define KEY_WRITE
Definition: nt_native.h:1031
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR szDMOCategories[]
Definition: dmoreg.c:59
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define GUID_NULL
Definition: ks.h:106
static LPWSTR GUIDToString(LPWSTR lpwstr, REFGUID lpcguid)
Definition: dmoreg.c:110
#define ARRAY_SIZE(a)
Definition: main.h:24
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
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:2541
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019

◆ dup_partial_mediatype()

static HRESULT dup_partial_mediatype ( const DMO_PARTIAL_MEDIATYPE types,
DWORD  count,
DMO_PARTIAL_MEDIATYPE **  ret 
)
static

Definition at line 374 of file dmoreg.c.

375 {
376  *ret = NULL;
377 
378  if (count == 0)
379  return S_OK;
380 
381  *ret = HeapAlloc(GetProcessHeap(), 0, count*sizeof(*types));
382  if (!*ret)
383  return E_OUTOFMEMORY;
384 
385  memcpy(*ret, types, count*sizeof(*types));
386  return S_OK;
387 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
Definition: cmds.c:130
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59

Referenced by IEnumDMO_Constructor().

◆ GUIDToString()

static LPWSTR GUIDToString ( LPWSTR  lpwstr,
REFGUID  lpcguid 
)
static

Definition at line 110 of file dmoreg.c.

111 {
112  wsprintfW(lpwstr, szGUIDFmt, lpcguid->Data1, lpcguid->Data2,
113  lpcguid->Data3, lpcguid->Data4[0], lpcguid->Data4[1],
114  lpcguid->Data4[2], lpcguid->Data4[3], lpcguid->Data4[4],
115  lpcguid->Data4[5], lpcguid->Data4[6], lpcguid->Data4[7]);
116 
117  return lpwstr;
118 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
static const WCHAR szGUIDFmt[]
Definition: dmoreg.c:64
unsigned short Data2
Definition: scsiwmi.h:53
unsigned long Data1
Definition: scsiwmi.h:52
unsigned char Data4[8]
Definition: scsiwmi.h:55
unsigned short Data3
Definition: scsiwmi.h:54

Referenced by DMOGetName(), DMOGetTypes(), DMORegister(), DMOUnregister(), IEnumDMO_Constructor(), and write_types().

◆ IEnumDMO_Constructor()

static HRESULT IEnumDMO_Constructor ( REFGUID  guidCategory,
DWORD  dwFlags,
DWORD  cInTypes,
const DMO_PARTIAL_MEDIATYPE pInTypes,
DWORD  cOutTypes,
const DMO_PARTIAL_MEDIATYPE pOutTypes,
IEnumDMO **  obj 
)
static

Definition at line 392 of file dmoreg.c.

400 {
401  IEnumDMOImpl* lpedmo;
402  HRESULT hr;
403 
404  *obj = NULL;
405 
407  if (!lpedmo)
408  return E_OUTOFMEMORY;
409 
410  lpedmo->IEnumDMO_iface.lpVtbl = &edmovt;
411  lpedmo->ref = 1;
412  lpedmo->index = -1;
413  lpedmo->category = *guidCategory;
414  lpedmo->dwFlags = dwFlags;
415  lpedmo->cInTypes = cInTypes;
416  lpedmo->cOutTypes = cOutTypes;
417  lpedmo->hkey = NULL;
418 
419  hr = dup_partial_mediatype(pInTypes, cInTypes, &lpedmo->pInTypes);
420  if (FAILED(hr))
421  goto lerr;
422 
423  hr = dup_partial_mediatype(pOutTypes, cOutTypes, &lpedmo->pOutTypes);
424  if (FAILED(hr))
425  goto lerr;
426 
427  /* If not filtering by category enum from media objects root */
428  if (IsEqualGUID(guidCategory, &GUID_NULL))
429  {
431  }
432  else
433  {
434  WCHAR szguid[64];
435  WCHAR szKey[MAX_PATH];
436 
437  wsprintfW(szKey, szCat3Fmt, szDMORootKey, szDMOCategories, GUIDToString(szguid, guidCategory));
438  RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &lpedmo->hkey);
439  }
440 
441 lerr:
442 
443  if (FAILED(hr))
444  IEnumDMO_Release(&lpedmo->IEnumDMO_iface);
445  else
446  {
447  TRACE("returning %p\n", lpedmo);
448  *obj = &lpedmo->IEnumDMO_iface;
449  }
450 
451  return hr;
452 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
static const WCHAR szDMORootKey[]
Definition: dmoreg.c:38
HRESULT hr
Definition: shlfolder.c:183
DMO_PARTIAL_MEDIATYPE * pOutTypes
Definition: dmoreg.c:97
#define KEY_READ
Definition: nt_native.h:1023
DWORD dwFlags
Definition: dmoreg.c:93
DMO_PARTIAL_MEDIATYPE * pInTypes
Definition: dmoreg.c:95
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
DWORD cOutTypes
Definition: dmoreg.c:96
HKEY hkey
Definition: dmoreg.c:98
IEnumDMO IEnumDMO_iface
Definition: dmoreg.c:89
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const IEnumDMOVtbl edmovt
Definition: dmoreg.c:108
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
static const WCHAR szDMOCategories[]
Definition: dmoreg.c:59
static const WCHAR szCat3Fmt[]
Definition: dmoreg.c:71
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define GUID_NULL
Definition: ks.h:106
LONG ref
Definition: dmoreg.c:90
static LPWSTR GUIDToString(LPWSTR lpwstr, REFGUID lpcguid)
Definition: dmoreg.c:110
GUID category
Definition: dmoreg.c:92
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
DWORD cInTypes
Definition: dmoreg.c:94
static HRESULT dup_partial_mediatype(const DMO_PARTIAL_MEDIATYPE *types, DWORD count, DMO_PARTIAL_MEDIATYPE **ret)
Definition: dmoreg.c:374
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
DWORD index
Definition: dmoreg.c:91

Referenced by DMOEnum(), and IEnumDMO_fnClone().

◆ IEnumDMO_fnAddRef()

static ULONG WINAPI IEnumDMO_fnAddRef ( IEnumDMO iface)
static

Definition at line 457 of file dmoreg.c.

458 {
460  ULONG refCount = InterlockedIncrement(&This->ref);
461  TRACE("(%p)->(%d)\n", This, refCount);
462  return refCount;
463 }
static IEnumDMOImpl * impl_from_IEnumDMO(IEnumDMO *iface)
Definition: dmoreg.c:101
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ IEnumDMO_fnClone()

static HRESULT WINAPI IEnumDMO_fnClone ( IEnumDMO iface,
IEnumDMO **  ppEnum 
)
static

Definition at line 716 of file dmoreg.c.

717 {
719  TRACE("(%p)->(%p)\n", This, ppEnum);
720  return IEnumDMO_Constructor(&This->category, This->dwFlags, This->cInTypes, This->pInTypes,
721  This->cOutTypes, This->pOutTypes, ppEnum);
722 }
static IEnumDMOImpl * impl_from_IEnumDMO(IEnumDMO *iface)
Definition: dmoreg.c:101
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:392
#define TRACE(s)
Definition: solgame.cpp:4

◆ IEnumDMO_fnNext()

static HRESULT WINAPI IEnumDMO_fnNext ( IEnumDMO iface,
DWORD  cItemsToFetch,
CLSID pCLSID,
WCHAR **  Names,
DWORD pcItemsFetched 
)
static

Definition at line 511 of file dmoreg.c.

517 {
518  HKEY hkey;
519  WCHAR szNextKey[MAX_PATH];
520  WCHAR szGuidKey[64];
521  WCHAR szKey[MAX_PATH];
522  WCHAR szValue[MAX_PATH];
523  DWORD len;
524  UINT count = 0;
525  HRESULT hres = S_OK;
526  LONG ret;
527  GUID guid;
528 
530 
531  TRACE("(%p)->(%d %p %p %p)\n", This, cItemsToFetch, pCLSID, Names, pcItemsFetched);
532 
533  if (!pCLSID || !Names)
534  return E_POINTER;
535 
536  if (!pcItemsFetched && cItemsToFetch > 1)
537  return E_INVALIDARG;
538 
539  while (count < cItemsToFetch)
540  {
541  This->index++;
542 
543  len = MAX_PATH;
544  ret = RegEnumKeyExW(This->hkey, This->index, szNextKey, &len, NULL, NULL, NULL, NULL);
545  if (ret != ERROR_SUCCESS)
546  {
548  break;
549  }
550 
551  if (string_to_guid(szNextKey, &guid) != S_OK)
552  continue;
553 
554  TRACE("found %s\n", debugstr_w(szNextKey));
555 
556  if (!(This->dwFlags & DMO_ENUMF_INCLUDE_KEYED))
557  {
558  wsprintfW(szKey, szCat3Fmt, szDMORootKey, szNextKey, szDMOKeyed);
559  ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &hkey);
560  if (ERROR_SUCCESS == ret)
561  {
562  RegCloseKey(hkey);
563  /* Skip Keyed entries */
564  continue;
565  }
566  }
567 
568  wsprintfW(szKey, szCat2Fmt, szDMORootKey, szNextKey);
569  ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &hkey);
570  TRACE("testing %s\n", debugstr_w(szKey));
571 
572  if (This->pInTypes)
573  {
574  UINT i, j;
575  DWORD cInTypes;
576  DMO_PARTIAL_MEDIATYPE* pInTypes;
577 
578  hres = read_types(hkey, szDMOInputType, &cInTypes,
579  sizeof(szValue)/sizeof(DMO_PARTIAL_MEDIATYPE),
580  (DMO_PARTIAL_MEDIATYPE*)szValue);
581 
582  if (FAILED(hres))
583  {
584  RegCloseKey(hkey);
585  continue;
586  }
587 
588  pInTypes = (DMO_PARTIAL_MEDIATYPE *)szValue;
589 
590  TRACE("read %d intypes for %s:\n", cInTypes, debugstr_w(szKey));
591  for (i = 0; i < cInTypes; i++) {
592  TRACE("intype %d: type %s, subtype %s\n", i, debugstr_guid(&pInTypes[i].type),
593  debugstr_guid(&pInTypes[i].subtype));
594  }
595 
596  for (i = 0; i < This->cInTypes; i++)
597  {
598  for (j = 0; j < cInTypes; j++)
599  {
600  if (IsMediaTypeEqual(&pInTypes[j], &This->pInTypes[i]))
601  break;
602  }
603 
604  if (j >= cInTypes)
605  break;
606  }
607 
608  if (i < This->cInTypes)
609  {
610  RegCloseKey(hkey);
611  continue;
612  }
613  }
614 
615  if (This->pOutTypes)
616  {
617  UINT i, j;
618  DWORD cOutTypes;
619  DMO_PARTIAL_MEDIATYPE* pOutTypes;
620 
621  hres = read_types(hkey, szDMOOutputType, &cOutTypes,
622  sizeof(szValue)/sizeof(DMO_PARTIAL_MEDIATYPE),
623  (DMO_PARTIAL_MEDIATYPE*)szValue);
624 
625  if (FAILED(hres))
626  {
627  RegCloseKey(hkey);
628  continue;
629  }
630 
631  pOutTypes = (DMO_PARTIAL_MEDIATYPE *)szValue;
632 
633  TRACE("read %d outtypes for %s:\n", cOutTypes, debugstr_w(szKey));
634  for (i = 0; i < cOutTypes; i++) {
635  TRACE("outtype %d: type %s, subtype %s\n", i, debugstr_guid(&pOutTypes[i].type),
636  debugstr_guid(&pOutTypes[i].subtype));
637  }
638 
639  for (i = 0; i < This->cOutTypes; i++)
640  {
641  for (j = 0; j < cOutTypes; j++)
642  {
643  if (IsMediaTypeEqual(&pOutTypes[j], &This->pOutTypes[i]))
644  break;
645  }
646 
647  if (j >= cOutTypes)
648  break;
649  }
650 
651  if (i < This->cOutTypes)
652  {
653  RegCloseKey(hkey);
654  continue;
655  }
656  }
657 
658  /* Media object wasn't filtered so add it to return list */
659  Names[count] = NULL;
660  len = MAX_PATH * sizeof(WCHAR);
661  ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE)szValue, &len);
662  if (ERROR_SUCCESS == ret)
663  {
664  Names[count] = CoTaskMemAlloc((strlenW(szValue) + 1) * sizeof(WCHAR));
665  if (Names[count])
666  strcpyW(Names[count], szValue);
667  }
668  wsprintfW(szGuidKey,szToGuidFmt,szNextKey);
669  CLSIDFromString(szGuidKey, &pCLSID[count]);
670 
671  TRACE("found match %s %s\n", debugstr_w(szValue), debugstr_w(szNextKey));
672  RegCloseKey(hkey);
673  count++;
674  }
675 
676  if (pcItemsFetched) *pcItemsFetched = count;
677  if (count < cItemsToFetch)
678  hres = S_FALSE;
679 
680  TRACE("<-- %i found\n",count);
681  return hres;
682 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
PWSTR Names[NAMES_COUNT]
static const WCHAR szDMORootKey[]
Definition: dmoreg.c:38
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
static const WCHAR szToGuidFmt[]
Definition: dmoreg.c:81
#define KEY_READ
Definition: nt_native.h:1023
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static const WCHAR szDMOKeyed[]
Definition: dmoreg.c:54
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
static IEnumDMOImpl * impl_from_IEnumDMO(IEnumDMO *iface)
Definition: dmoreg.c:101
const GUID * guid
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
static const WCHAR szDMOOutputType[]
Definition: dmoreg.c:49
#define debugstr_w
Definition: kernel32.h:32
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
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 GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
static const WCHAR szDMOInputType[]
Definition: dmoreg.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static const WCHAR szCat3Fmt[]
Definition: dmoreg.c:71
static const WCHAR szCat2Fmt[]
Definition: dmoreg.c:76
GLenum GLsizei len
Definition: glext.h:6722
static HRESULT read_types(HKEY root, LPCWSTR key, ULONG *supplied, ULONG requested, DMO_PARTIAL_MEDIATYPE *types)
Definition: dmoreg.c:776
static BOOL IsMediaTypeEqual(const DMO_PARTIAL_MEDIATYPE *mt1, const DMO_PARTIAL_MEDIATYPE *mt2)
Definition: dmoreg.c:130
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
static HRESULT string_to_guid(const WCHAR *string, GUID *guid)
Definition: dmoreg.c:120
unsigned int UINT
Definition: ndis.h:50
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
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:2541
#define E_POINTER
Definition: winerror.h:2365
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

◆ IEnumDMO_fnQueryInterface()

static HRESULT WINAPI IEnumDMO_fnQueryInterface ( IEnumDMO iface,
REFIID  riid,
void **  ppvObj 
)
static

Definition at line 468 of file dmoreg.c.

469 {
471 
472  TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObj);
473 
474  *ppvObj = NULL;
475 
476  if (IsEqualIID(riid, &IID_IEnumDMO) ||
478  {
479  *ppvObj = iface;
480  IEnumDMO_AddRef(iface);
481  }
482 
483  return *ppvObj ? S_OK : E_NOINTERFACE;
484 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
static IEnumDMOImpl * impl_from_IEnumDMO(IEnumDMO *iface)
Definition: dmoreg.c:101
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ IEnumDMO_fnRelease()

static ULONG WINAPI IEnumDMO_fnRelease ( IEnumDMO iface)
static

Definition at line 489 of file dmoreg.c.

490 {
492  ULONG refCount = InterlockedDecrement(&This->ref);
493 
494  TRACE("(%p)->(%d)\n", This, refCount);
495 
496  if (!refCount)
497  {
498  if (This->hkey)
499  RegCloseKey(This->hkey);
500  HeapFree(GetProcessHeap(), 0, This->pInTypes);
501  HeapFree(GetProcessHeap(), 0, This->pOutTypes);
503  }
504  return refCount;
505 }
static IEnumDMOImpl * impl_from_IEnumDMO(IEnumDMO *iface)
Definition: dmoreg.c:101
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ IEnumDMO_fnReset()

static HRESULT WINAPI IEnumDMO_fnReset ( IEnumDMO iface)
static

Definition at line 702 of file dmoreg.c.

703 {
705 
706  TRACE("(%p)\n", This);
707  This->index = -1;
708 
709  return S_OK;
710 }
static IEnumDMOImpl * impl_from_IEnumDMO(IEnumDMO *iface)
Definition: dmoreg.c:101
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ IEnumDMO_fnSkip()

static HRESULT WINAPI IEnumDMO_fnSkip ( IEnumDMO iface,
DWORD  cItemsToSkip 
)
static

Definition at line 688 of file dmoreg.c.

689 {
691 
692  TRACE("(%p)->(%d)\n", This, cItemsToSkip);
693  This->index += cItemsToSkip;
694 
695  return S_OK;
696 }
static IEnumDMOImpl * impl_from_IEnumDMO(IEnumDMO *iface)
Definition: dmoreg.c:101
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ impl_from_IEnumDMO()

static IEnumDMOImpl* impl_from_IEnumDMO ( IEnumDMO iface)
inlinestatic

Definition at line 101 of file dmoreg.c.

102 {
103  return CONTAINING_RECORD(iface, IEnumDMOImpl, IEnumDMO_iface);
104 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by IEnumDMO_fnAddRef(), IEnumDMO_fnClone(), IEnumDMO_fnNext(), IEnumDMO_fnQueryInterface(), IEnumDMO_fnRelease(), IEnumDMO_fnReset(), and IEnumDMO_fnSkip().

◆ IsMediaTypeEqual()

static BOOL IsMediaTypeEqual ( const DMO_PARTIAL_MEDIATYPE mt1,
const DMO_PARTIAL_MEDIATYPE mt2 
)
static

Definition at line 130 of file dmoreg.c.

131 {
132 
133  return (IsEqualCLSID(&mt1->type, &mt2->type) ||
134  IsEqualCLSID(&mt2->type, &GUID_NULL) ||
135  IsEqualCLSID(&mt1->type, &GUID_NULL)) &&
136  (IsEqualCLSID(&mt1->subtype, &mt2->subtype) ||
137  IsEqualCLSID(&mt2->subtype, &GUID_NULL) ||
138  IsEqualCLSID(&mt1->subtype, &GUID_NULL));
139 }
#define GUID_NULL
Definition: ks.h:106
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:91

Referenced by IEnumDMO_fnNext().

◆ read_types()

HRESULT read_types ( HKEY  root,
LPCWSTR  key,
ULONG supplied,
ULONG  requested,
DMO_PARTIAL_MEDIATYPE types 
)
static

Definition at line 776 of file dmoreg.c.

777 {
778  HRESULT ret = S_OK;
779 
780  if (MSDMO_MAJOR_VERSION > 5)
781  {
782  DWORD len;
783  LONG rc;
784 
785  len = requested * sizeof(DMO_PARTIAL_MEDIATYPE);
787  ret = HRESULT_FROM_WIN32(rc);
788 
789  *supplied = len / sizeof(DMO_PARTIAL_MEDIATYPE);
790  }
791  else
792  {
793  HKEY hkey;
794  WCHAR szGuidKey[64];
795 
796  *supplied = 0;
797  if (ERROR_SUCCESS == RegOpenKeyExW(root, key, 0, KEY_READ, &hkey))
798  {
799  int index = 0;
800  WCHAR szNextKey[MAX_PATH];
801  DWORD len;
802  LONG rc = ERROR_SUCCESS;
803 
804  while (rc == ERROR_SUCCESS)
805  {
806  len = MAX_PATH;
807  rc = RegEnumKeyExW(hkey, index, szNextKey, &len, NULL, NULL, NULL, NULL);
808  if (rc == ERROR_SUCCESS)
809  {
810  HKEY subk;
811  int sub_index = 0;
812  LONG rcs = ERROR_SUCCESS;
813  WCHAR szSubKey[MAX_PATH];
814 
815  RegOpenKeyExW(hkey, szNextKey, 0, KEY_READ, &subk);
816  while (rcs == ERROR_SUCCESS)
817  {
818  len = MAX_PATH;
819  rcs = RegEnumKeyExW(subk, sub_index, szSubKey, &len, NULL, NULL, NULL, NULL);
820  if (rcs == ERROR_SUCCESS)
821  {
822  if (*supplied >= requested)
823  {
824  /* Bailing */
825  ret = S_FALSE;
826  rc = ERROR_MORE_DATA;
827  rcs = ERROR_MORE_DATA;
828  break;
829  }
830 
831  wsprintfW(szGuidKey,szToGuidFmt,szNextKey);
832  CLSIDFromString(szGuidKey, &types[*supplied].type);
833  wsprintfW(szGuidKey,szToGuidFmt,szSubKey);
834  CLSIDFromString(szGuidKey, &types[*supplied].subtype);
835  TRACE("Adding type %s subtype %s at index %i\n",
836  debugstr_guid(&types[*supplied].type),
837  debugstr_guid(&types[*supplied].subtype),
838  *supplied);
839  (*supplied)++;
840  }
841  sub_index++;
842  }
843  index++;
844  }
845  }
846  RegCloseKey(hkey);
847  }
848  }
849  return ret;
850 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
static const WCHAR szToGuidFmt[]
Definition: dmoreg.c:81
#define KEY_READ
Definition: nt_native.h:1023
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
#define S_FALSE
Definition: winerror.h:2357
struct _DMO_PARTIAL_MEDIATYPE DMO_PARTIAL_MEDIATYPE
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
Definition: cmds.c:130
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define MSDMO_MAJOR_VERSION
Definition: dmoreg.c:36
GLenum GLsizei len
Definition: glext.h:6722
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
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:2541
Definition: path.c:42

Referenced by DMOGetTypes(), and IEnumDMO_fnNext().

◆ string_to_guid()

static HRESULT string_to_guid ( const WCHAR string,
GUID guid 
)
static

Definition at line 120 of file dmoreg.c.

121 {
122  WCHAR buffer[39];
123  buffer[0] = '{';
124  strcpyW(buffer + 1, string);
125  buffer[37] = '}';
126  buffer[38] = 0;
127  return CLSIDFromString(buffer, guid);
128 }
GLuint buffer
Definition: glext.h:5915
const GUID * guid
__wchar_t WCHAR
Definition: xmlstorage.h:180
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247

Referenced by IEnumDMO_fnNext().

◆ unregister_dmo_from_category()

static HRESULT unregister_dmo_from_category ( const WCHAR dmoW,
const WCHAR catW,
HKEY  categories 
)
static

Definition at line 271 of file dmoreg.c.

272 {
273  HKEY catkey;
274  LONG ret;
275 
276  ret = RegOpenKeyExW(categories, catW, 0, KEY_WRITE, &catkey);
277  if (!ret)
278  {
279  ret = RegDeleteKeyW(catkey, dmoW);
280  RegCloseKey(catkey);
281  }
282 
283  return !ret ? S_OK : S_FALSE;
284 }
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1240
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define S_FALSE
Definition: winerror.h:2357
#define KEY_WRITE
Definition: nt_native.h:1031
int ret
#define S_OK
Definition: intsafe.h:59
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
GLsizei GLenum * categories
Definition: glext.h:11561

Referenced by DMOUnregister().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msdmo  )

◆ write_types()

static HRESULT write_types ( HKEY  hkey,
LPCWSTR  name,
const DMO_PARTIAL_MEDIATYPE types,
DWORD  count 
)
static

Definition at line 141 of file dmoreg.c.

142 {
143  LONG ret;
144 
145  if (MSDMO_MAJOR_VERSION > 5)
146  {
147  ret = RegSetValueExW(hkey, name, 0, REG_BINARY, (const BYTE*) types,
148  count* sizeof(DMO_PARTIAL_MEDIATYPE));
149  }
150  else
151  {
152  HKEY skey1,skey2,skey3;
153  DWORD index = 0;
154  WCHAR szGuidKey[64];
155 
157  KEY_WRITE, NULL, &skey1, NULL);
158  if (ret)
159  return HRESULT_FROM_WIN32(ret);
160 
161  while (index < count)
162  {
163  GUIDToString(szGuidKey,&types[index].type);
164  ret = RegCreateKeyExW(skey1, szGuidKey, 0, NULL,
166  GUIDToString(szGuidKey,&types[index].subtype);
167  ret = RegCreateKeyExW(skey2, szGuidKey, 0, NULL,
169  RegCloseKey(skey3);
170  RegCloseKey(skey2);
171  index ++;
172  }
173  RegCloseKey(skey1);
174  }
175 
176  return HRESULT_FROM_WIN32(ret);
177 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define REG_BINARY
Definition: nt_native.h:1496
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
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:1094
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
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:4917
Definition: cmds.c:130
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define MSDMO_MAJOR_VERSION
Definition: dmoreg.c:36
unsigned char BYTE
Definition: mem.h:68
static LPWSTR GUIDToString(LPWSTR lpwstr, REFGUID lpcguid)
Definition: dmoreg.c:110
Definition: name.c:36

Referenced by DMORegister().

Variable Documentation

◆ edmovt

static const IEnumDMOVtbl edmovt
static
Initial value:
=
{
}
static HRESULT WINAPI IEnumDMO_fnReset(IEnumDMO *iface)
Definition: dmoreg.c:702
static HRESULT WINAPI IEnumDMO_fnSkip(IEnumDMO *iface, DWORD cItemsToSkip)
Definition: dmoreg.c:688
static HRESULT WINAPI IEnumDMO_fnNext(IEnumDMO *iface, DWORD cItemsToFetch, CLSID *pCLSID, WCHAR **Names, DWORD *pcItemsFetched)
Definition: dmoreg.c:511
static HRESULT WINAPI IEnumDMO_fnQueryInterface(IEnumDMO *iface, REFIID riid, void **ppvObj)
Definition: dmoreg.c:468
static ULONG WINAPI IEnumDMO_fnRelease(IEnumDMO *iface)
Definition: dmoreg.c:489
static HRESULT WINAPI IEnumDMO_fnClone(IEnumDMO *iface, IEnumDMO **ppEnum)
Definition: dmoreg.c:716
static ULONG WINAPI IEnumDMO_fnAddRef(IEnumDMO *iface)
Definition: dmoreg.c:457

Definition at line 108 of file dmoreg.c.

Referenced by IEnumDMO_Constructor().

◆ szCat2Fmt

const WCHAR szCat2Fmt[]
static
Initial value:
=
{
'%','s','\\','%','s',0
}

Definition at line 76 of file dmoreg.c.

Referenced by IEnumDMO_fnNext().

◆ szCat3Fmt

const WCHAR szCat3Fmt[]
static
Initial value:
=
{
'%','s','\\','%','s','\\','%','s',0
}

Definition at line 71 of file dmoreg.c.

Referenced by IEnumDMO_Constructor(), and IEnumDMO_fnNext().

◆ szDMOCategories

const WCHAR szDMOCategories[]
static
Initial value:
=
{
'C','a','t','e','g','o','r','i','e','s',0
}

Definition at line 59 of file dmoreg.c.

Referenced by DMORegister(), DMOUnregister(), and IEnumDMO_Constructor().

◆ szDMOInputType

const WCHAR szDMOInputType[]
static
Initial value:
=
{
'I','n','p','u','t','T','y','p','e','s',0
}

Definition at line 44 of file dmoreg.c.

Referenced by DMOGetTypes(), DMORegister(), and IEnumDMO_fnNext().

◆ szDMOKeyed

const WCHAR szDMOKeyed[]
static
Initial value:
=
{
'K','e','y','e','d',0
}

Definition at line 54 of file dmoreg.c.

Referenced by DMORegister(), and IEnumDMO_fnNext().

◆ szDMOOutputType

const WCHAR szDMOOutputType[]
static
Initial value:
=
{
'O','u','t','p','u','t','T','y','p','e','s',0
}

Definition at line 49 of file dmoreg.c.

Referenced by DMOGetTypes(), DMORegister(), and IEnumDMO_fnNext().

◆ szDMORootKey

const WCHAR szDMORootKey[]
static
Initial value:
=
{
'D','i','r','e','c','t','S','h','o','w','\\',
'M','e','d','i','a','O','b','j','e','c','t','s',0
}

Definition at line 38 of file dmoreg.c.

Referenced by DMOGetName(), DMOGetTypes(), DMORegister(), DMOUnregister(), IEnumDMO_Constructor(), and IEnumDMO_fnNext().

◆ szGUIDFmt

const WCHAR szGUIDFmt[]
static
Initial value:
=
{
'%','0','8','X','-','%','0','4','X','-','%','0','4','X','-','%','0',
'2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','%','0','2',
'X','%','0','2','X','%','0','2','X','%','0','2','X',0
}

Definition at line 64 of file dmoreg.c.

Referenced by GUIDToString().

◆ szToGuidFmt

const WCHAR szToGuidFmt[]
static
Initial value:
=
{
'{','%','s','}',0
}

Definition at line 81 of file dmoreg.c.

Referenced by IEnumDMO_fnNext(), and read_types().