From 71201030aedb473d67f15c4ab72ba21c60cca30b Mon Sep 17 00:00:00 2001 From: ai4rei Date: Wed, 29 Dec 2010 05:14:16 +0000 Subject: * Fixed 'console' plugin not working on Windows, due to NULL passed to CreateThread instead of required pointer to thread id variable. - Fixed 'console' plugin causing delete_timer error when it fails to load, due to uninitialized variable. * Renamed plugin.def to sample.def and added 'sample' plugin exports into it, as it's purpose is nothing than a sample right now. - Also added .def files for 'gui' and 'pid' plugins as MSVC does not export everything automatically and missing event export cause the plugins silently failing. - Added VS6, VS8 and VS9 projects for compiling plug-ins, which can be used on Windows. * The plug-in system will now report, if it cannot import an event function. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14638 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/plugins/console.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/console.c') diff --git a/src/plugins/console.c b/src/plugins/console.c index 5056eafdc..7ea69c637 100644 --- a/src/plugins/console.c +++ b/src/plugins/console.c @@ -32,7 +32,8 @@ #define WORKER_FUNC_END(name) } ExitThread(0); return 0; } #define WORKER_EXECUTE(name,errvar) \ do{ \ - buf.worker = CreateThread(NULL, 0, worker_ ## name, NULL, CREATE_SUSPENDED, NULL); \ + DWORD dwThreadId; \ + buf.worker = CreateThread(NULL, 0, worker_ ## name, NULL, CREATE_SUSPENDED, &dwThreadId); \ if( errvar ) \ *errvar = ( buf.worker == NULL ); \ }while(0) @@ -135,7 +136,7 @@ unsigned int (*gettick)(void); int (*parse_console)(char* buf); // Locals -int tid; // timer id +int tid = -1; // timer id BUFFER buf; // input buffer WORKER_FUNC_DECLARE(getinput); // worker for the input buffer -- cgit v1.2.3-60-g2f50