I want to use DSound Audio Render in one of my application so I load it with CoCreateInstance. Here is a little snippet:
#include <iostream>
#include <strmif.h>
#include <uuids.h>
int main()
{
std::cout << "Start" << std::endl;
HRESULT hr = CoInitialize(NULL);
printf("CoInitialize = 0x%x\n", hr);
IBaseFilter* ptr = NULL;
hr = CoCreateInstance(CLSID_DSoundRender, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void**)&ptr);
printf("CoCreateInstance = 0x%x\n", hr);
ptr->Release();
CoUninitialize();
std::cout << "End" << std::endl;
std::cin.get();
}
The problem is, on the Windows I use to develop my application, it works well and hr
is always 0x0
(S_OK
) but on the Windows of my client, it gets an error 0x0x80040154
(REGDB_E_CLASSNOTREG
) when CoCreateInstance
is called.
It's a 32 bits application running on Windows 10 64 bits (for the dev) and on Windows Server 2016 Datacenter 64 bits (for the prod).
I check the registry and the corresponding DLL (quartz.dll
) is correctly registered. Indeed, I get those results on both Windows:
PS C:\Users\pierre> Get-ChildItem -Path "Registry::HKCR\CLSID\{79376820-07D0-11CF-A24D-0020AFD79767}"
Hive: HKCR\CLSID\{79376820-07D0-11CF-A24D-0020AFD79767}
Name Property
---- --------
InprocServer32 (default) : C:\Windows\System32\quartz.dll
ThreadingModel : Both
PS C:\Users\pierre> Get-ChildItem -Path "Registry::HKCR\WOW6432Node\CLSID\{79376820-07D0-11CF-A24D-0020AFD79767}"
Hive: HKCR\WOW6432Node\CLSID\{79376820-07D0-11CF-A24D-0020AFD79767}
Name Property
---- --------
InprocServer32 (default) : C:\Windows\SysWOW64\quartz.dll
ThreadingModel : Both
PS C:\Users\pierre> dir C:\Windows\System32\quartz.dll
Répertoire : C:\Windows\System32
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 15/09/2018 09:29 1639424 quartz.dll
PS C:\Users\pierre> dir C:\Windows\SysWOW64\quartz.dll
Répertoire : C:\Windows\SysWOW64
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 15/09/2018 09:29 1470464 quartz.dll
I also used procmon.exe
and every calls look correct.
What should I change in the configuration of my client to make it work?