Author: janderwald
Date: Tue Apr 6 17:08:16 2010
New Revision: 46750
URL:
http://svn.reactos.org/svn/reactos?rev=46750&view=rev
Log:
[MSDVBNP]
- Dynamically register DVB network provider categories
Modified:
trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp
trunk/reactos/dll/directx/msdvbnp/precomp.h
Modified: trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/msdvbn…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp [iso-8859-1] Tue Apr 6 17:08:16 2010
@@ -9,10 +9,14 @@
#include "precomp.h"
+#ifndef _MSC_VER
+const GUID KSCATEGORY_BDA_NETWORK_PROVIDER = {0x71985f4b, 0x1ca1, 0x11d3, {0x9c, 0xc8,
0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
+#endif
+
static INTERFACE_TABLE InterfaceTable[] =
{
- {&CLSID_DVBTNetworkProvider, CNetworkProvider_fnConstructor},
- {NULL, NULL}
+ {&CLSID_DVBTNetworkProvider, CNetworkProvider_fnConstructor, L"ReactOS DVBT
Network Provider"},
+ {NULL, NULL, NULL}
};
extern "C"
@@ -53,8 +57,19 @@
HRESULT hr = S_OK;
HKEY hClass;
+
+ hr = StringFromCLSID(KSCATEGORY_BDA_NETWORK_PROVIDER, &pStr);
+ if (FAILED(hr))
+ return hr;
+
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_SET_VALUE,
&hClass) != ERROR_SUCCESS)
- return E_FAIL;
+ {
+ CoTaskMemFree(pStr);
+ return E_FAIL;
+ }
+
+ RegDeleteKeyW(hClass, pStr);
+ CoTaskMemFree(pStr);
do
{
@@ -80,12 +95,35 @@
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
- HKEY hClass, hKey, hSubKey;
+ HKEY hClass, hKey, hSubKey, hProvider, hInstance;
static LPCWSTR ModuleName = L"msdvbnp.ax";
static LPCWSTR ThreadingModel = L"Both";
+ hr = StringFromCLSID(KSCATEGORY_BDA_NETWORK_PROVIDER, &pStr);
+ if (FAILED(hr))
+ return hr;
+
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_WRITE, &hClass)
!= ERROR_SUCCESS)
- return E_FAIL;
+ {
+ CoTaskMemFree(pStr);
+ return E_FAIL;
+ }
+
+ if (RegCreateKeyExW(hClass, pStr, 0, NULL, 0, KEY_WRITE, NULL, &hProvider, NULL)
!= ERROR_SUCCESS)
+ {
+ RegCloseKey(hClass);
+ CoTaskMemFree(pStr);
+ return E_FAIL;
+ }
+
+ CoTaskMemFree(pStr);
+
+ if (RegCreateKeyExW(hProvider, L"Instance", 0, NULL, 0, KEY_WRITE, NULL,
&hInstance, NULL) != ERROR_SUCCESS)
+ {
+ RegCloseKey(hClass);
+ return E_FAIL;
+ }
+ RegCloseKey(hProvider);
do
{
@@ -104,11 +142,20 @@
RegCloseKey(hKey);
}
+ if (RegCreateKeyExW(hInstance, InterfaceTable[Index].ProviderName, 0, 0, 0,
KEY_WRITE, NULL, &hKey, 0) == ERROR_SUCCESS)
+ {
+ //FIXME filterdata
+ RegSetValueExW(hKey, L"FriendlyName", 0, REG_SZ, (const
BYTE*)InterfaceTable[Index].ProviderName, (wcslen(InterfaceTable[Index].ProviderName) + 1)
* sizeof(WCHAR));
+ RegSetValueExW(hKey, L"CLSID", 0, REG_SZ, (const BYTE*)pStr,
(wcslen(pStr)+1) * sizeof(WCHAR));
+ RegCloseKey(hKey);
+ }
+
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
RegCloseKey(hClass);
+ RegCloseKey(hInstance);
return hr;
}
Modified: trunk/reactos/dll/directx/msdvbnp/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/precom…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/msdvbnp/precomp.h [iso-8859-1] Tue Apr 6 17:08:16 2010
@@ -28,6 +28,7 @@
{
const GUID* riid;
LPFNCREATEINSTANCE lpfnCI;
+ LPCWSTR ProviderName;
} INTERFACE_TABLE;
/* classfactory.cpp */