diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-02 02:05:44 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-02 02:05:44 +0300 |
commit | 6880b295ae72e2537276b519ecb9ed48ea2ade3a (patch) | |
tree | 667667f25655faf8988c374f13fc269300ae7bdf | |
parent | fa6c7360660214c98b66bac9e18144144ee8a7d5 (diff) |
modified: main.cpp
modified: plugin.h
-rw-r--r-- | core/main.cpp | 12 | ||||
-rw-r--r-- | core/plugin.h | 2 |
2 files changed, 14 insertions, 0 deletions
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<PLUGININFO> *pluginInfoList = new list<PLUGININFO>; + for(list<plugin*>::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 |