diff --git a/Makefile.watcom b/Makefile.watcom index e58f2ce..c730892 100644 --- a/Makefile.watcom +++ b/Makefile.watcom @@ -8,7 +8,7 @@ BUILDDIR = ../bin/ CC = cl -CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NODEBUG" /D "NOODBC" /D "MSVC" /D "WITH_STD_MALLOC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /c +CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NODEBUG" /D "NOODBC" /D"WATCOM" /D "MSVC" /D "WITH_STD_MALLOC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /c COUT = /Fo LN = link LDFLAGS = /nologo /subsystem:console /incremental:no diff --git a/src/plugins/FilePlugin/FilePlugin.c b/src/plugins/FilePlugin/FilePlugin.c index 280dbdf..ad9dbbe 100644 --- a/src/plugins/FilePlugin/FilePlugin.c +++ b/src/plugins/FilePlugin/FilePlugin.c @@ -878,13 +878,13 @@ static struct commands file_commandhandlers[] = { static int file_loaded=0; - -#ifdef _WIN32 -__declspec(dllexport) +#ifdef WATCOM +#pragma aux file_plugin "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL #endif - - int file_plugin (struct pluginlink * pluginlink, + PLUGINAPI int PLUGINCALL file_plugin (struct pluginlink * pluginlink, int argc, char** argv){ if(!file_loaded){ diff --git a/src/plugins/LastFRipper/lastFripper.c b/src/plugins/LastFRipper/lastFripper.c index d5eea85..b1299f2 100644 --- a/src/plugins/LastFRipper/lastFripper.c +++ b/src/plugins/LastFRipper/lastFripper.c @@ -677,13 +677,18 @@ static struct commands lfm_commandhandlers[] = { {NULL, "lfm_format", h_lfm_format, 2, 2} }; + #ifdef __cplusplus extern "C" { #endif -#ifdef _WIN32 -__declspec(dllexport) + +#ifdef WATCOM +#pragma aux lfm_plugin "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL #endif -int lfm_plugin( struct pluginlink * pluginlink, int argc, char** argv ) + +PLUGINAPI int PLUGINCALL lfm_plugin( struct pluginlink * pluginlink, int argc, char** argv ) { pl = pluginlink; myOutputDebugStringA1( "lfm_plugin" ); diff --git a/src/plugins/LdapPlugin/ldapauth.c b/src/plugins/LdapPlugin/ldapauth.c index 2dde248..38d112a 100644 --- a/src/plugins/LdapPlugin/ldapauth.c +++ b/src/plugins/LdapPlugin/ldapauth.c @@ -457,15 +457,16 @@ int h_dircount(int argc, unsigned char ** argv) /*------------------------------- MAIN -------------------------------------- start plugin init */ -#ifdef _WIN32 -__declspec(dllexport) int start(struct pluginlink * pluginlink, - int argc, char** argv) -#else -int start(struct pluginlink * pluginlink, +#ifdef WATCOM +#pragma aux start "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL +#endif + +PLUGINAPI int PLUGINCALL start(struct pluginlink * pluginlink, int argc, char** argv) -#endif { diff --git a/src/plugins/PCREPlugin/pcre_plugin.c b/src/plugins/PCREPlugin/pcre_plugin.c index f7b74ee..5342e4b 100644 --- a/src/plugins/PCREPlugin/pcre_plugin.c +++ b/src/plugins/PCREPlugin/pcre_plugin.c @@ -358,12 +358,15 @@ static struct symbol regexp_symbols[] = { {NULL, "pcre_free", NULL}, }; -#ifdef _WIN32 -__declspec(dllexport) +#ifdef WATCOM +#pragma aux pcre_plugin "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL #endif - int pcre_plugin (struct pluginlink * pluginlink, +PLUGINAPI int PLUGINCALL pcre_plugin (struct pluginlink * pluginlink, int argc, char** argv){ + struct filter *flt, *tmpflt; pl = pluginlink; pcre_options = 0; diff --git a/src/plugins/PamAuth/pamauth.c b/src/plugins/PamAuth/pamauth.c index da8869d..68fd337 100644 --- a/src/plugins/PamAuth/pamauth.c +++ b/src/plugins/PamAuth/pamauth.c @@ -117,9 +117,15 @@ static int pamfunc(struct clientparam *param) } +#ifdef WATCOM +#pragma aux start "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL +#endif + /*------------------------------- MAIN -------------------------------------- start plugin init */ -int start(struct pluginlink * pluginlink, int argc, unsigned char** argv) +PLUGINAPI int PLUGINCALL start(struct pluginlink * pluginlink, int argc, unsigned char** argv) { diff --git a/src/plugins/SSLPlugin/ssl_plugin.c b/src/plugins/SSLPlugin/ssl_plugin.c index 0214f5a..afd494e 100644 --- a/src/plugins/SSLPlugin/ssl_plugin.c +++ b/src/plugins/SSLPlugin/ssl_plugin.c @@ -372,12 +372,15 @@ static struct commands ssl_commandhandlers[] = { }; -#ifdef _WIN32 -__declspec(dllexport) +#ifdef WATCOM +#pragma aux ssl_plugin "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL #endif - int ssl_plugin (struct pluginlink * pluginlink, +PLUGINAPI int PLUGINCALL ssl_plugin (struct pluginlink * pluginlink, int argc, char** argv){ + pl = pluginlink; if(!ssl_loaded){ ssl_loaded = 1; diff --git a/src/plugins/StringsPlugin/StringsPlugin.c b/src/plugins/StringsPlugin/StringsPlugin.c index 911c4b9..288ed74 100644 --- a/src/plugins/StringsPlugin/StringsPlugin.c +++ b/src/plugins/StringsPlugin/StringsPlugin.c @@ -164,17 +164,16 @@ BOOL WINAPI DllMain( HINSTANCE hModule, return TRUE; } -__declspec(dllexport) int start(struct pluginlink * pluginlink, - int argc, char** argv) - -#else - -int start(struct pluginlink * pluginlink, - int argc, char** argv) #endif +#ifdef WATCOM +#pragma aux start "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL +#endif - +PLUGINAPI int PLUGINCALL start(struct pluginlink * pluginlink, + int argc, char** argv) { FILE *f=NULL; diff --git a/src/plugins/TrafficPlugin/TrafficPlugin.c b/src/plugins/TrafficPlugin/TrafficPlugin.c index 09009a0..1f91f72 100644 --- a/src/plugins/TrafficPlugin/TrafficPlugin.c +++ b/src/plugins/TrafficPlugin/TrafficPlugin.c @@ -266,11 +266,16 @@ BOOL WINAPI DllMain( HINSTANCE hModule, return TRUE; } -__declspec(dllexport) - #endif - int start(struct pluginlink * pluginlink, int argc, char** argv) { +#ifdef WATCOM +#pragma aux start "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL +#endif + +PLUGINAPI int PLUGINCALL start(struct pluginlink * pluginlink, int argc, char** argv) { + struct commands * starthandler; conf = pluginlink->conf; commandhandlers = pluginlink->commandhandlers; diff --git a/src/plugins/TransparentPlugin/transparent_plugin.c b/src/plugins/TransparentPlugin/transparent_plugin.c index 6bbbdfb..7668d15 100644 --- a/src/plugins/TransparentPlugin/transparent_plugin.c +++ b/src/plugins/TransparentPlugin/transparent_plugin.c @@ -89,11 +89,13 @@ static struct filter transparent_filter = { }; -#ifdef _WIN32 -__declspec(dllexport) +#ifdef WATCOM +#pragma aux transparent_plugin "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL #endif - int transparent_plugin (struct pluginlink * pluginlink, +PLUGINAPI int PLUGINCALL transparent_plugin (struct pluginlink * pluginlink, int argc, char** argv){ pl = pluginlink; if(!transparent_loaded){ diff --git a/src/plugins/WindowsAuthentication/WindowsAuthentication.c b/src/plugins/WindowsAuthentication/WindowsAuthentication.c index d0af431..818237e 100644 --- a/src/plugins/WindowsAuthentication/WindowsAuthentication.c +++ b/src/plugins/WindowsAuthentication/WindowsAuthentication.c @@ -58,7 +58,13 @@ extern "C" { return 7; } -__declspec(dllexport) int WindowsAuthentication(struct pluginlink * pluginlink, int argc, char** argv){ +#ifdef WATCOM +#pragma aux WindowsAuthentication "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL +#endif + +PLUGINAPI int PLUGINCALL WindowsAuthentication(struct pluginlink * pluginlink, int argc, char** argv){ char tmpbuf[4096]; DWORD dlen, sidlen; SID_NAME_USE snu; diff --git a/src/plugins/utf8tocp1251/utf8tocp1251.c b/src/plugins/utf8tocp1251/utf8tocp1251.c index c0e21fc..412c927 100644 --- a/src/plugins/utf8tocp1251/utf8tocp1251.c +++ b/src/plugins/utf8tocp1251/utf8tocp1251.c @@ -62,8 +62,13 @@ unsigned char * conv_utf8_to_cp1251(unsigned char *s){ } +#ifdef WATCOM +#pragma aux utf8tocp1251 "*" parm caller [ ] value struct float struct routine [eax] modify [eax ecx edx] +#undef PLUGINCALL +#define PLUGINCALL +#endif - __declspec(dllexport) int utf8tocp1251(struct pluginlink * pluginlink, int argc, char** argv){ +PLUGINAPI int PLUGINCALL utf8tocp1251(struct pluginlink * pluginlink, int argc, char** argv){ static int loaded = 0; diff --git a/src/structures.h b/src/structures.h index 9f286be..6b96d60 100644 --- a/src/structures.h +++ b/src/structures.h @@ -162,7 +162,21 @@ typedef void (*TRAFCOUNTFUNC)(struct clientparam * param); typedef void * (*EXTENDFUNC) (struct node *node); typedef void (*CBFUNC)(void *cb, char * buf, int inbuf); typedef void (*PRINTFUNC) (struct node *node, CBFUNC cbf, void*cb); -typedef int (*PLUGINFUNC) (struct pluginlink *pluginlink, int argc, char** argv); + +#ifdef WIN32 + +#define PLUGINAPI __declspec(dllexport) +typedef int (__cdecl *PLUGINFUNC) (struct pluginlink *pluginlink, int argc, char** argv); +#define PLUGINCALL __cdecl + +#else + +#define PLUGINCALL +#define PLUGINAPI +typedef int (*PLUGINFUNC)(struct pluginlink *pluginlink, int argc, char** argv); + +#endif + struct auth { struct auth *next; @@ -752,8 +766,6 @@ typedef enum { TYPE_SERVER }DATA_TYPE; - - #ifdef __cplusplus } #endif