ReactOS  0.4.15-dev-341-g17c5fb8
msdvbnp.cpp File Reference
#include "precomp.h"
Include dependency graph for msdvbnp.cpp:

Go to the source code of this file.

Functions

BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
KSDDKAPI HRESULT WINAPI DllUnregisterServer (void)
 
VOID RegisterBDAComponent (HKEY hFilter, LPCWSTR ComponentClsid, LPCWSTR ComponentName)
 
KSDDKAPI HRESULT WINAPI DllRegisterServer (void)
 
KSDDKAPI HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
KSDDKAPI HRESULT WINAPI DllCanUnloadNow (void)
 

Variables

const GUID KSCATEGORY_BDA_NETWORK_PROVIDER = {0x71985f4b, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}}
 
static INTERFACE_TABLE InterfaceTable []
 

Function Documentation

◆ DllCanUnloadNow()

KSDDKAPI HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 238 of file msdvbnp.cpp.

239 {
240  return S_OK;
241 }
#define S_OK
Definition: intsafe.h:59

◆ DllGetClassObject()

KSDDKAPI HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 201 of file msdvbnp.cpp.

205 {
206  UINT i;
208  IClassFactory * pcf = NULL;
209 
210  if (!ppv)
211  return E_INVALIDARG;
212 
213  *ppv = NULL;
214 
215  for (i = 0; InterfaceTable[i].riid; i++)
216  {
217  if (IsEqualIID(*InterfaceTable[i].riid, rclsid))
218  {
220  break;
221  }
222  }
223 
224  if (!pcf)
225  {
227  }
228 
229  hres = pcf->QueryInterface(riid, ppv);
230  pcf->Release();
231 
232  return hres;
233 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
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
const GUID * riid
Definition: precomp.h:26
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
ULONG Release()
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
IClassFactory * CClassFactory_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, IID *riidInst)
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
unsigned int UINT
Definition: ndis.h:50
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
static INTERFACE_TABLE InterfaceTable[]
Definition: msdvbnp.cpp:16
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 25 of file msdvbnp.cpp.

29 {
30  switch (fdwReason)
31  {
32  case DLL_PROCESS_ATTACH:
34 
35 #ifdef MSDVBNP_TRACE
36  OutputDebugStringW(L"MSDVBNP::DllMain()\n");
37 #endif
38 
39  DisableThreadLibraryCalls(hInstDLL);
40  break;
41  default:
42  break;
43  }
44 
45  return TRUE;
46 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR L[]
Definition: oid.c:1250
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964

◆ DllRegisterServer()

KSDDKAPI HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 111 of file msdvbnp.cpp.

112 {
113  ULONG Index = 0;
114  LPOLESTR pStr;
115  HRESULT hr = S_OK;
116  HKEY hClass, hKey, hSubKey, hProvider, hInstance, hFilter;
117  static LPCWSTR ModuleName = L"msdvbnp.ax";
118  static LPCWSTR ThreadingModel = L"Both";
119 
121  if (FAILED(hr))
122  return hr;
123 
124  if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_WRITE, &hClass) != ERROR_SUCCESS)
125  {
126  CoTaskMemFree(pStr);
127  return E_FAIL;
128  }
129 
130  if (RegCreateKeyExW(hClass, pStr, 0, NULL, 0, KEY_WRITE, NULL, &hProvider, NULL) != ERROR_SUCCESS)
131  {
132  RegCloseKey(hClass);
133  CoTaskMemFree(pStr);
134  return E_FAIL;
135  }
136 
137  CoTaskMemFree(pStr);
138 
139  if (RegCreateKeyExW(hProvider, L"Instance", 0, NULL, 0, KEY_WRITE, NULL, &hInstance, NULL) != ERROR_SUCCESS)
140  {
141  RegCloseKey(hClass);
142  return E_FAIL;
143  }
144  RegCloseKey(hProvider);
145 
146  /* open active movie filter category key */
147  if (RegCreateKeyExW(hClass, L"{da4e3da0-d07d-11d0-bd50-00a0c911ce86}\\Instance", 0, NULL, 0, KEY_WRITE, NULL, &hFilter, NULL) != ERROR_SUCCESS)
148  {
149  RegCloseKey(hClass);
151  return E_FAIL;
152  }
153 
154  RegisterBDAComponent(hFilter, L"{71985F4A-1CA1-11d3-9CC8-00C04F7971E0}", L"BDA Playback Filter");
155  RegisterBDAComponent(hFilter, L"{71985F4B-1CA1-11D3-9CC8-00C04F7971E0}", L"BDA Network Providers");
156  RegisterBDAComponent(hFilter, L"{71985F48-1CA1-11d3-9CC8-00C04F7971E0}", L"BDA Source Filter");
157  RegisterBDAComponent(hFilter, L"{A2E3074F-6C3D-11D3-B653-00C04F79498E}", L"BDA Transport Information Renderers");
158  RegisterBDAComponent(hFilter, L"{FD0A5AF4-B41D-11d2-9C95-00C04F7971E0}", L"BDA Receiver Component");
159  RegCloseKey(hKey);
160 
161  do
162  {
164  if (FAILED(hr))
165  break;
166 
167  if (RegCreateKeyExW(hClass, pStr, 0, 0, 0, KEY_WRITE, NULL, &hKey, 0) == ERROR_SUCCESS)
168  {
169  if (RegCreateKeyExW(hKey, L"InprocServer32", 0, 0, 0, KEY_WRITE, NULL, &hSubKey, 0) == ERROR_SUCCESS)
170  {
171  RegSetValueExW(hSubKey, 0, 0, REG_SZ, (const BYTE*)ModuleName, (wcslen(ModuleName) + 1) * sizeof(WCHAR));
172  RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ, (const BYTE*)ThreadingModel, (wcslen(ThreadingModel) + 1) * sizeof(WCHAR));
173  RegCloseKey(hSubKey);
174  }
175  RegCloseKey(hKey);
176  }
177 
178  if (RegCreateKeyExW(hInstance, InterfaceTable[Index].ProviderName, 0, 0, 0, KEY_WRITE, NULL, &hKey, 0) == ERROR_SUCCESS)
179  {
180  //FIXME filterdata
181  RegSetValueExW(hKey, L"FriendlyName", 0, REG_SZ, (const BYTE*)InterfaceTable[Index].ProviderName, (wcslen(InterfaceTable[Index].ProviderName) + 1) * sizeof(WCHAR));
182  RegSetValueExW(hKey, L"CLSID", 0, REG_SZ, (const BYTE*)pStr, (wcslen(pStr)+1) * sizeof(WCHAR));
183  RegCloseKey(hKey);
184  }
185 
186 
187 
188 
189  CoTaskMemFree(pStr);
190  Index++;
191  }while(InterfaceTable[Index].lpfnCI != 0);
192 
193  RegCloseKey(hClass);
195  return hr;
196 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
REFIID riid
Definition: precomp.h:44
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1274
static LPOLESTR
Definition: stg_prop.c:27
#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:1091
HINSTANCE hInstance
Definition: charmap.c:20
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
VOID RegisterBDAComponent(HKEY hFilter, LPCWSTR ComponentClsid, LPCWSTR ComponentName)
Definition: msdvbnp.cpp:90
#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:4895
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
const GUID KSCATEGORY_BDA_NETWORK_PROVIDER
Definition: msdvbnp.cpp:13
static const UCHAR Index[8]
Definition: usbohci.c:18
static const WCHAR L[]
Definition: oid.c:1250
unsigned char BYTE
Definition: xxhash.c:193
#define S_OK
Definition: intsafe.h:59
static INTERFACE_TABLE InterfaceTable[]
Definition: msdvbnp.cpp:16
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
#define REG_SZ
Definition: layer.c:22

◆ DllUnregisterServer()

KSDDKAPI HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 53 of file msdvbnp.cpp.

54 {
55  ULONG Index = 0;
56  LPOLESTR pStr;
57  HRESULT hr = S_OK;
58  HKEY hClass;
59 
60 
62  if (FAILED(hr))
63  return hr;
64 
65  if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_SET_VALUE, &hClass) != ERROR_SUCCESS)
66  {
67  CoTaskMemFree(pStr);
68  return E_FAIL;
69  }
70 
71  RegDeleteKeyW(hClass, pStr);
72  CoTaskMemFree(pStr);
73 
74  do
75  {
77  if (FAILED(hr))
78  break;
79 
80  RegDeleteKeyW(hClass, pStr);
81  CoTaskMemFree(pStr);
82  Index++;
83  }while(InterfaceTable[Index].lpfnCI != 0);
84 
85  RegCloseKey(hClass);
86  return hr;
87 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define KEY_SET_VALUE
Definition: nt_native.h:1017
REFIID riid
Definition: precomp.h:44
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1237
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
static LPOLESTR
Definition: stg_prop.c:27
#define E_FAIL
Definition: ddrawi.h:102
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
LONG HRESULT
Definition: typedefs.h:78
const GUID KSCATEGORY_BDA_NETWORK_PROVIDER
Definition: msdvbnp.cpp:13
static const UCHAR Index[8]
Definition: usbohci.c:18
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
static INTERFACE_TABLE InterfaceTable[]
Definition: msdvbnp.cpp:16
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412

◆ RegisterBDAComponent()

VOID RegisterBDAComponent ( HKEY  hFilter,
LPCWSTR  ComponentClsid,
LPCWSTR  ComponentName 
)

Definition at line 90 of file msdvbnp.cpp.

94 {
95  HKEY hComp;
96 
97  // create network provider filter key
98  if (RegCreateKeyExW(hFilter, ComponentClsid, 0, NULL, 0, KEY_WRITE, NULL, &hComp, NULL) == ERROR_SUCCESS)
99  {
100  // store class id
101  RegSetValueExW(hComp, L"CLSID", 0, REG_SZ, (const BYTE*)ComponentClsid, (wcslen(ComponentClsid)+1) * sizeof(WCHAR));
102  RegSetValueExW(hComp, L"FriendlyName", 0, REG_SZ, (const BYTE*)ComponentName, (wcslen(ComponentName)+1) * sizeof(WCHAR));
103  RegCloseKey(hComp);
104  }
105 }
#define ERROR_SUCCESS
Definition: deptool.c:10
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:1091
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
#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:4895
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR L[]
Definition: oid.c:1250
unsigned char BYTE
Definition: xxhash.c:193
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define REG_SZ
Definition: layer.c:22

Referenced by DllRegisterServer().

Variable Documentation

◆ InterfaceTable

INTERFACE_TABLE InterfaceTable[]
static
Initial value:
=
{
{&CLSID_DVBTNetworkProvider, CNetworkProvider_fnConstructor, L"ReactOS DVBT Network Provider"},
}
const GUID CLSID_DVBTNetworkProvider
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI CNetworkProvider_fnConstructor(IUnknown *pUnknown, REFIID riid, LPVOID *ppv)
static const WCHAR L[]
Definition: oid.c:1250

Definition at line 16 of file msdvbnp.cpp.

Referenced by DllGetClassObject(), DllRegisterServer(), and DllUnregisterServer().

◆ KSCATEGORY_BDA_NETWORK_PROVIDER

const GUID KSCATEGORY_BDA_NETWORK_PROVIDER = {0x71985f4b, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}}

Definition at line 13 of file msdvbnp.cpp.

Referenced by DllRegisterServer(), and DllUnregisterServer().