Exemple #1
0
HRESULT CFGFilterLAVAudio::Create(IBaseFilter** ppBF, CInterfaceList<IUnknown, &IID_IUnknown>& pUnks)
{
    HRESULT hr = __super::Create(ppBF, pUnks);

    if (SUCCEEDED(hr)) {
        if (!CheckVersion(m_path)) {
            hr = E_FAIL;
        } else if (CComQIPtr<ILAVAudioSettings> pLAVFSettings = *ppBF) {
            // Take control over LAVAudio's settings, the settings are reseted to default values
            hr = pLAVFSettings->SetRuntimeConfig(TRUE);

            if (SUCCEEDED(hr)) {
                Settings settings;
                if (settings.GetSettings(pLAVFSettings)) { // Get default settings from LAVAudio
                    settings.LoadSettings(); // Load our current settings from registry/ini
                    settings.SetSettings(pLAVFSettings); // Set our settings in LAVAudio
                }

                // Keep track of LAVFilters instances in runtime mode
                s_instances.AddTail(*ppBF);
            }
        } else {
            hr = E_NOINTERFACE;
        }
    }

    return hr;
}
Exemple #2
0
__declspec(dllexport) void _stdcall InstallHook()
{
	ZoneProcess.Initialize();
	ZoneSettings.LoadSettings();

	int patchError = ZoneProcess.PatchCode();

	if(patchError > 0)
	{
		char patchErrorMessage[256];
		sprintf_s(patchErrorMessage, 256, "There was an error patching the Zone.");

		MessageBox(NULL, patchErrorMessage, "Zone", MB_ICONERROR);

		return;
	}

	bool hookError = ZoneProcess.HookAPI();

	if(hookError)
	{
		char hookErrorMessage[256];
		sprintf_s(hookErrorMessage, 256, "There was an error modifying the Zone.");

		MessageBox(NULL, hookErrorMessage, "Zone", MB_ICONERROR);

		return;
	}
}