From 6880b295ae72e2537276b519ecb9ed48ea2ade3a Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 2 Aug 2010 02:05:44 +0300 Subject: modified: main.cpp modified: plugin.h --- core/main.cpp | 12 ++++++++++++ core/plugin.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/core/main.cpp b/core/main.cpp index 44add56..a0ed347 100644 --- a/core/main.cpp +++ b/core/main.cpp @@ -17,6 +17,7 @@ int LoadModules(); INT_PTR CallService(const char *name, WPARAM w, LPARAM l); HANDLE CreateServiceFunction(const char *name, SERVICE pService); int ServiceExists(const char *name); +int GetPluginInfoList(WPARAM, LPARAM); PLUGINLINK link = {&CreateServiceFunction, &CallService, &ServiceExists}; @@ -29,6 +30,7 @@ int main(int argc, char *argv[]) cout<<"Loaded plugin: "<<(*p)->getName()<<'\n'; (*p)->getFuncs().load(&link); } + CreateServiceFunction("GetPluginInfoList", GetPluginInfoList); for(;;) Sleep(1000); return 0; @@ -92,6 +94,10 @@ const plugin::exported_funcs_s plugin::getFuncs() { return funcs; } +const PLUGININFO plugin::getPluginInfo() +{ + return pluginInfo; +} plugin::plugin(const HMODULE hMod, const exported_funcs_s fnct, const char *name) { hModule = hMod; @@ -141,4 +147,10 @@ int ServiceExists(const char *name) return 1; return 0; } +int GetPluginInfoList(WPARAM, LPARAM) +{ + list *pluginInfoList = new list; + for(list::iterator p = plugins.begin(); p != plugins.end(); p++) + pluginInfoList->push_back((*p)->getPluginInfo()); +} diff --git a/core/plugin.h b/core/plugin.h index 893b445..01e59c9 100644 --- a/core/plugin.h +++ b/core/plugin.h @@ -17,6 +17,7 @@ public: }; const HMODULE getHmodule(); const exported_funcs_s getFuncs(); + const PLUGININFO getPluginInfo(); int setHandle(const HMODULE &hMod); int setName(const char *name); const char *getName(); @@ -26,5 +27,6 @@ private: HMODULE hModule; char *szPluginName; exported_funcs_s funcs; + PLUGININFO pluginInfo; }; #endif -- cgit v1.2.3