// Initialize is called by Inner Space when the extension should initialize. bool ISXEQItemDisplay::Initialize(ISInterface *p_ISInterface) { pISInterface=p_ISInterface; // retrieve basic ISData types pStringType=pISInterface->FindLSType("string"); pIntType=pISInterface->FindLSType("int"); pBoolType=pISInterface->FindLSType("bool"); pFloatType=pISInterface->FindLSType("float"); pTimeType=pISInterface->FindLSType("time"); pByteType=pISInterface->FindLSType("byte"); pISInterface->OpenSettings(XMLFileName); ConnectServices(); RegisterCommands(); RegisterAliases(); RegisterDataTypes(); RegisterTopLevelObjects(); RegisterServices(); EzDetour(CItemDisplayWnd__SetSpell,&ItemDisplayHook::SetSpell_Detour,&ItemDisplayHook::SetSpell_Trampoline); EzDetour(CItemDisplayWnd__UpdateStrings, &ItemDisplayHook::UpdateStrings_Detour, &ItemDisplayHook::UpdateStrings_Trampoline); //EzDetour(CXWnd__DrawTooltipAtPoint,&XWndHook::DrawTooltipAtPoint_Detour,&XWndHook::DrawTooltipAtPoint_Trampoline); //EzDetour(CInvSlotWnd__DrawTooltip, &InvSlotWndHook::DrawTooltip_Detour, &InvSlotWndHook::DrawTooltip_Trampoline); WriteChatf("ISXEQItemDisplay Loaded"); return true; }
// Initialize is called by Inner Space when the extension should initialize. bool ISXEQHUDMove::Initialize(ISInterface *p_ISInterface) { pISInterface = p_ISInterface; // retrieve basic ISData types pStringType = pISInterface->FindLSType("string"); pIntType = pISInterface->FindLSType("int"); pBoolType = pISInterface->FindLSType("bool"); pFloatType = pISInterface->FindLSType("float"); pTimeType = pISInterface->FindLSType("time"); pByteType = pISInterface->FindLSType("byte"); pISInterface->OpenSettings(XMLFileName); LoadSettings(); ConnectServices(); RegisterCommands(); RegisterAliases(); RegisterDataTypes(); RegisterTopLevelObjects(); RegisterServices(); WriteChatf("ISXEQHUDMove Loaded"); return true; }
// Initialize is called by Inner Space when the extension should initialize. bool ISXEQLabels::Initialize(ISInterface *p_ISInterface) { pISInterface=p_ISInterface; // retrieve basic ISData types pStringType=pISInterface->FindLSType("string"); pIntType=pISInterface->FindLSType("int"); pBoolType=pISInterface->FindLSType("bool"); pFloatType=pISInterface->FindLSType("float"); pTimeType=pISInterface->FindLSType("time"); pByteType=pISInterface->FindLSType("byte"); pISInterface->OpenSettings(XMLFileName); LoadSettings(); ConnectServices(); RegisterCommands(); RegisterAliases(); RegisterDataTypes(); RegisterTopLevelObjects(); RegisterServices(); EzDetour(CLabel__Draw,&CLabelHook::Draw_Detour,&CLabelHook::Draw_Trampoline); EzDetour(CSidlManager__CreateLabel,&CSidlManagerHook::CreateLabel_Detour,&CSidlManagerHook::CreateLabel_Trampoline); // currently in testing: // EasyClassDetour(CGauge__Draw,CGaugeHook,Draw_Detour,VOID,(VOID),Draw_Trampoline); // EasyDetour(__GetGaugeValueFromEQ,GetGaugeValueFromEQ_Hook,int,(int,class CXStr *,bool *),GetGaugeValueFromEQ_Trampoline); WriteChatf("ISXEQLabels Loaded"); return true; }
// Initialize is called by Inner Space when the extension should initialize. bool ISXEQMap::Initialize(ISInterface *p_ISInterface) { pISInterface = p_ISInterface; // retrieve basic ISData types pStringType = pISInterface->FindLSType("string"); pIntType = pISInterface->FindLSType("int"); pBoolType = pISInterface->FindLSType("bool"); pFloatType = pISInterface->FindLSType("float"); pTimeType = pISInterface->FindLSType("time"); pByteType = pISInterface->FindLSType("byte"); pISInterface->OpenSettings("ISXEQMap.XML"); bmMapRefresh = AddMQ2Benchmark("Map Refresh"); unsigned int i; CHAR szBuffer[MAX_STRING] = { 0 }; for (i = 0; MapFilterOptions[i].szName; i++) { sprintf(szBuffer, "%s Color", MapFilterOptions[i].szName); int Temp; if (pISInterface->GetSettingi("ISXEQMap.XML", "Map Filters", MapFilterOptions[i].szName, Temp)) MapFilterOptions[i].Enabled = Temp; else MapFilterOptions[i].Enabled = MapFilterOptions[i].Default; if (pISInterface->GetSettingi("ISXEQMap.XML", "Map Filters", szBuffer, Temp)) MapFilterOptions[i].Color = Temp | 0xFF000000; else MapFilterOptions[i].Color = MapFilterOptions[i].DefaultColor | 0xFF000000; } MapInit(); pISInterface->GetSetting("ISXEQMap.XML", "Naming Schemes", "Normal", MapNameString, sizeof(MapNameString)); pISInterface->GetSetting("ISXEQMap.XML", "Naming Schemes", "Target", MapTargetNameString, sizeof(MapTargetNameString)); for (i = 1; i<16; i++) { sprintf(szBuffer, "KeyCombo%d", i); pISInterface->GetSetting("ISXEQMap.XML", "Right Click", szBuffer, MapSpecialClickString[i], sizeof(MapSpecialClickString[i])); } // Do not use Custom, since the string isn't stored MapFilterOptions[MAPFILTER_Custom].Enabled = 0; ConnectServices(); RegisterCommands(); RegisterAliases(); RegisterDataTypes(); RegisterTopLevelObjects(); RegisterServices(); EzDetour(CMapViewWnd__CMapViewWnd, &CMyMapViewWnd::Constructor_Detour, &CMyMapViewWnd::Constructor_Trampoline); CMyMapViewWnd::StealVFTable(); printf("ISXEQMap Loaded"); return true; }
// Initialize is called by Inner Space when the extension should initialize. bool CISXEQ::Initialize(ISInterface *p_ISInterface) { pISInterface=p_ISInterface; char CurrentModule[512]={0}; GetModuleFileName(0,CurrentModule,512); char *filename; if (filename=strrchr(CurrentModule,'\\')) filename++; else filename=CurrentModule; if (stricmp(filename,"eqgame.exe")) { printf("ISXEQ is only meant to be used in eqgame.exe"); return false; } // retrieve basic ISData types pStringType=pISInterface->FindLSType("string"); pMutableStringType = pISInterface->FindLSType("mutablestring"); pWStringType = pISInterface->FindLSType("unistring"); pUniStringType = pISInterface->FindLSType("unistring"); pIntType=pISInterface->FindLSType("int"); pUIntType = pISInterface->FindLSType("uint"); pInt64Type = pISInterface->FindLSType("int64"); pInt64PtrType = pISInterface->FindLSType("int64ptr"); pBoolType=pISInterface->FindLSType("bool"); pFloatType=pISInterface->FindLSType("float"); pTimeType=pISInterface->FindLSType("time"); pByteType=pISInterface->FindLSType("byte"); pIntPtrType=pISInterface->FindLSType("intptr"); pBoolPtrType=pISInterface->FindLSType("boolptr"); pFloatPtrType=pISInterface->FindLSType("floatptr"); pFloat64PtrType = pISInterface->FindLSType("float64ptr"); pBytePtrType=pISInterface->FindLSType("byteptr"); pPoint3fType = pISInterface->FindLSType("point3f"); pIndexType = pISInterface->FindLSType("index"); pVectorType = pISInterface->FindLSType("index"); pMapType = pISInterface->FindLSType("collection"); pSetType = pISInterface->FindLSType("set"); ConnectServices(); RegisterCommands(); RegisterAliases(); RegisterDataTypes(); RegisterTopLevelObjects(); RegisterServices(); HookMemChecker(TRUE); strcpy(gszINIPath,ModulePath); MQ2Initialize(); printf("ISXEQ Loaded"); return true; }
CDevice::OnReleaseHardware(_In_ IWDFDevice* /*pDevice*/) { // Unregister the services as Plug and Play interfaces (errors are ignored). HRESULT hr = RegisterServices(m_pPortableDeviceClassExtension, true /*bUnregister*/); CHECK_HR(hr, "Failed to unregister services"); if (m_pWpdBaseDriver != NULL) { m_pWpdBaseDriver->Uninitialize(); } if (m_pPortableDeviceClassExtension != NULL) { m_pPortableDeviceClassExtension = NULL; } return S_OK; }
CDevice::OnPrepareHardware(_In_ IWDFDevice* pDevice) { HRESULT hr = S_OK; if (m_pWpdBaseDriver != NULL) { DWORD cchDeviceName = 0; PWSTR deviceName = NULL; hr = pDevice->RetrieveDeviceName(NULL, &cchDeviceName); if (SUCCEEDED(hr)) { deviceName = new WCHAR[cchDeviceName]; if (NULL == deviceName) { hr = E_OUTOFMEMORY; } } if (SUCCEEDED(hr)) { hr = pDevice->RetrieveDeviceName(deviceName, &cchDeviceName); } if (SUCCEEDED(hr)) { hr = m_pWpdBaseDriver->Initialize(pDevice, deviceName); } if (NULL != deviceName) { delete [] deviceName; deviceName = NULL; } CHECK_HR(hr, "Failed to Initialize the driver class"); } // Initialize the WPD Class Extension. This will enable the appropriate WPD interface GUID, // as well as do any additional initialization (e.g. enabling Legacy Compatibility layers for those drivers // which requested support in their INF). if (hr == S_OK && m_pPortableDeviceClassExtension == NULL) { CComPtr<IPortableDeviceValues> pOptions; CComPtr<IPortableDevicePropVariantCollection> pContentTypes; hr = CoCreateInstance(CLSID_PortableDeviceClassExtension, NULL, CLSCTX_INPROC_SERVER, IID_IPortableDeviceClassExtension, (VOID**)&m_pPortableDeviceClassExtension); CHECK_HR(hr, "Failed to CoCreate CLSID_PortableDeviceClassExtension"); if (hr == S_OK) { hr = CoCreateInstance(CLSID_PortableDeviceValues, NULL, CLSCTX_INPROC_SERVER, IID_IPortableDeviceValues, (VOID**)&pOptions); CHECK_HR(hr, "Failed to CoCreate CLSID_PortableDeviceValues"); if (hr == S_OK) { // Get supported content types if (hr == S_OK) { hr = GetSupportedContentTypes(&pContentTypes); CHECK_HR(hr, "Failed to get supported content types"); } // Add the supported types to the options if (hr == S_OK) { hr = pOptions->SetIPortableDevicePropVariantCollectionValue(WPD_CLASS_EXTENSION_OPTIONS_SUPPORTED_CONTENT_TYPES, pContentTypes); CHECK_HR(hr, "Failed to set WPD_CLASS_EXTENSION_OPTIONS_SUPPORTED_CONTENT_TYPES"); } // Initialize the PortableDeviceClassExtension with a list of supported content types for the // connected device. This will ensure that the correct application compatibility settings will // be applied for your device. if (hr == S_OK) { hr = m_pPortableDeviceClassExtension->Initialize(pDevice, pOptions); CHECK_HR(hr, "Failed to Initialize portable device class extension object"); } // Register the services as Plug and Play interfaces if (hr == S_OK) { hr = RegisterServices(m_pPortableDeviceClassExtension, false /*bUnregister*/); CHECK_HR(hr, "Failed to register services"); } // Since users commonly have the abiltity to customize their device even when it is not // connected to the PC, we need to make sure the PC is current when the driver loads. // // Send the latest device friendly name to the PortableDeviceClassExtension component // so the system is always updated with the current device name. // // This call should also be made after a successful property set operation of // WPD_DEVICE_FRIENDLY_NAME. LPWSTR wszDeviceFriendlyName = NULL; if (hr == S_OK) { hr = GetDeviceFriendlyName(&wszDeviceFriendlyName); CHECK_HR(hr, "Failed to get device's friendly name"); } if (hr == S_OK) { hr = UpdateDeviceFriendlyName(m_pPortableDeviceClassExtension, wszDeviceFriendlyName); CHECK_HR(hr, "Failed to update device's friendly name"); } // Free the memory. CoTaskMemFree ignores NULLs so no need to check. CoTaskMemFree(wszDeviceFriendlyName); } } } return hr; }
void CFactoryDatabase::Initialise() { RegisterServices(); RegisterObjectTypes(); }
void CFactoryShaderGrammar::Initialise() { RegisterServices(); RegisterObjectTypes(); }