2 * COPYRIGHT: See COPYING in the top level directory
4 * FILE: dll/directx/msvidctl/msvidctl.cpp
5 * PURPOSE: ReactOS DVB Initialization
7 * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
12 static INTERFACE_TABLE InterfaceTable
[] =
14 {&CLSID_SystemTuningSpaces
, CTuningSpaceContainer_fnConstructor
},
28 case DLL_PROCESS_ATTACH
:
32 OutputDebugStringW(L
"MSVIDCTL::DllMain()\n");
35 DisableThreadLibraryCalls(hInstDLL
);
49 DllUnregisterServer(void)
56 if (RegOpenKeyExW(HKEY_CLASSES_ROOT
, L
"CLSID", 0, KEY_SET_VALUE
, &hClass
) != ERROR_SUCCESS
)
61 hr
= StringFromCLSID(*InterfaceTable
[Index
].riid
, &pStr
);
65 RegDeleteKeyW(hClass
, pStr
);
68 }while(InterfaceTable
[Index
].lpfnCI
!= 0);
78 DllRegisterServer(void)
83 HKEY hClass
, hKey
, hSubKey
;
84 static LPCWSTR ModuleName
= L
"msvidctl.ax";
85 static LPCWSTR ThreadingModel
= L
"Both";
87 if (RegOpenKeyExW(HKEY_CLASSES_ROOT
, L
"CLSID", 0, KEY_WRITE
, &hClass
) != ERROR_SUCCESS
)
92 hr
= StringFromCLSID(*InterfaceTable
[Index
].riid
, &pStr
);
96 if (RegCreateKeyExW(hClass
, pStr
, 0, 0, 0, KEY_WRITE
, NULL
, &hKey
, 0) == ERROR_SUCCESS
)
98 if (RegCreateKeyExW(hKey
, L
"InprocServer32", 0, 0, 0, KEY_WRITE
, NULL
, &hSubKey
, 0) == ERROR_SUCCESS
)
100 RegSetValueExW(hSubKey
, 0, 0, REG_SZ
, (const BYTE
*)ModuleName
, (wcslen(ModuleName
) + 1) * sizeof(WCHAR
));
101 RegSetValueExW(hSubKey
, L
"ThreadingModel", 0, REG_SZ
, (const BYTE
*)ThreadingModel
, (wcslen(ThreadingModel
) + 1) * sizeof(WCHAR
));
102 RegCloseKey(hSubKey
);
109 }while(InterfaceTable
[Index
].lpfnCI
!= 0);
124 HRESULT hres
= E_OUTOFMEMORY
;
125 IClassFactory
* pcf
= NULL
;
132 for (i
= 0; InterfaceTable
[i
].riid
; i
++)
134 if (IsEqualIID(*InterfaceTable
[i
].riid
, rclsid
))
136 pcf
= CClassFactory_fnConstructor(InterfaceTable
[i
].lpfnCI
, NULL
, NULL
);
143 return CLASS_E_CLASSNOTAVAILABLE
;
146 hres
= pcf
->QueryInterface(riid
, ppv
);
155 DllCanUnloadNow(void)