ReactOS 0.4.15-dev-7958-gcd0bb1a
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:52

◆ 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}
IClassFactory * CClassFactory_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, IID *riidInst)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
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
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
HRESULT hres
Definition: protocol.c:465
static INTERFACE_TABLE InterfaceTable[]
Definition: msdvbnp.cpp:16
unsigned int UINT
Definition: ndis.h:50
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
const GUID * riid
Definition: precomp.h:26
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

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

Definition at line 25 of file msdvbnp.cpp.

29{
30 switch (fdwReason)
31 {
34
35#ifdef MSDVBNP_TRACE
36 OutputDebugStringW(L"MSDVBNP::DllMain()\n");
37#endif
38
40 break;
41 default:
42 break;
43 }
44
45 return TRUE;
46}
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define L(x)
Definition: ntvdm.h:50

◆ 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
140 {
141 RegCloseKey(hClass);
142 return E_FAIL;
143 }
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");
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 }
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));
184 }
185
186
187
188
189 CoTaskMemFree(pStr);
190 Index++;
191 }while(InterfaceTable[Index].lpfnCI != 0);
192
193 RegCloseKey(hClass);
195 return hr;
196}
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:1280
#define RegCloseKey(hKey)
Definition: registry.h:49
HINSTANCE hInstance
Definition: charmap.c:19
#define E_FAIL
Definition: ddrawi.h:102
#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:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
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
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
FxAutoRegKey hKey
WDFWMIPROVIDER hProvider
Definition: fxwmiapi.cpp:165
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define FAILED(hr)
Definition: intsafe.h:51
#define REG_SZ
Definition: layer.c:22
static LPOLESTR
Definition: stg_prop.c:27
const GUID KSCATEGORY_BDA_NETWORK_PROVIDER
Definition: msdvbnp.cpp:13
VOID RegisterBDAComponent(HKEY hFilter, LPCWSTR ComponentClsid, LPCWSTR ComponentName)
Definition: msdvbnp.cpp:90
#define KEY_WRITE
Definition: nt_native.h:1031
HRESULT hr
Definition: shlfolder.c:183
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFCOLLECTION _In_ ULONG Index
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193

◆ 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}
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
#define KEY_SET_VALUE
Definition: nt_native.h:1017

◆ 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}

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
HRESULT WINAPI CNetworkProvider_fnConstructor(IUnknown *pUnknown, REFIID riid, LPVOID *ppv)

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().