Esempio n. 1
0
void AddFmodGlobals(VM_ID vm)
{
	code_object *a_globals = CreateCodeObject(str_Copy("fmod_code"));
	AddCodeCFunction((object*)a_globals,"Sleep",&fmod_Sleep);
	AddCodeCFunction((object*)a_globals,"playSound",&fmod_playSound);
	AddCodeCFunction((object*)a_globals,"__init__",&fmod_Init);
	AddCodeCFunction((object*)a_globals,"__del__",&fmod_Close);

	class_object *fmod_global = CreateClassObject(a_globals,NULL);
	vm_AddGlobal(vm,(object*)CreateUnicodeObject(str_Copy("fmod")),fmod_global);
}
Esempio n. 2
0
HRESULT WINAPI CKillVirus::OnScanInitialize(void)
{
	HRESULT hr = CreateClassObject(CLSID_CPeFileParser, 0, __uuidof(IPeFile), (LPVOID*)&m_parser);
	if (FAILED(hr)) return hr;

	hr = CreateClassObject(CLSID_CPeEmulator, 0, __uuidof(IEmulator), (LPVOID*)&m_emul);
	if (FAILED(hr))
	{
		m_parser->Release();
		m_parser = NULL;
		return hr;
	}

	hr = m_emul->AddObserver(static_cast<IEmulObserver*>(this));
	if (FAILED(hr))
	{
		m_parser->Release();
		m_parser = NULL;
		m_emul->Release();
		m_emul = NULL;
		return hr;
	}
	return S_OK;
}