From 65f9b75e71f9ec13c6b0d86a7ddce50f58369a74 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 22 Jun 2007 18:47:16 +0000 Subject: [PATCH] All exports in nidmgr32.dll are declared as __declspec(dllexport) using the KHMEXP macro in the header files. However, since the same header files are used to declare imports when building applications and plug-ins that use nidmgr32.dll, the KHMEXP macro should switch to __declspec(import) so that the relevant import table entries are created. To make this switch, the source files that go into nidmgr32.dll are compiled with the special macro _NIMLIB_ defined that indicates that the KHMEXP should expand to __declspec(dllexport). In the absence of this macro, KHMEXP will expand to __declspec(dllimport). ticket: 5584 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19618 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/identity/include/khdefs.h | 5 +++++ src/windows/identity/kconfig/kconfiginternal.h | 2 ++ src/windows/identity/kcreddb/kcreddbinternal.h | 2 ++ src/windows/identity/kherr/kherrinternal.h | 2 ++ src/windows/identity/kmm/kmminternal.h | 2 ++ src/windows/identity/kmm/kplugin.h | 6 +++--- src/windows/identity/kmq/kmqinternal.h | 2 ++ src/windows/identity/plugins/krb4/krb4main.c | 4 ++-- src/windows/identity/plugins/krb4/krbcred.h | 2 -- src/windows/identity/plugins/krb5/krb5main.c | 4 ++-- src/windows/identity/plugins/krb5/krbcred.h | 2 -- src/windows/identity/uilib/action.c | 2 ++ src/windows/identity/uilib/alert.c | 3 +++ src/windows/identity/uilib/configui.c | 2 ++ src/windows/identity/uilib/creddlg.c | 2 ++ src/windows/identity/uilib/propsheet.c | 2 ++ src/windows/identity/uilib/propwnd.c | 2 ++ src/windows/identity/uilib/rescache.c | 1 + src/windows/identity/uilib/trackerwnd.c | 3 +++ src/windows/identity/uilib/uibind.c | 3 +++ src/windows/identity/uilib/uilibmain.c | 2 ++ src/windows/identity/uilib/version.c | 2 ++ src/windows/identity/util/hashtable.c | 2 ++ src/windows/identity/util/mstring.c | 2 ++ src/windows/identity/util/perfstat.c | 2 ++ src/windows/identity/util/sync.c | 2 ++ 26 files changed, 54 insertions(+), 11 deletions(-) diff --git a/src/windows/identity/include/khdefs.h b/src/windows/identity/include/khdefs.h index 0d32356f6..c39d6f4ea 100644 --- a/src/windows/identity/include/khdefs.h +++ b/src/windows/identity/include/khdefs.h @@ -177,7 +177,12 @@ typedef unsigned __int64 khm_lparm; #define KHMEXP_EXP __declspec(dllexport) #define KHMEXP_IMP __declspec(dllimport) +#ifdef _NIMLIB_ #define KHMEXP KHMEXP_EXP +#else +#define KHMEXP KHMEXP_IMP +#endif + #endif /* Generic permission values */ diff --git a/src/windows/identity/kconfig/kconfiginternal.h b/src/windows/identity/kconfig/kconfiginternal.h index dc1bfa363..cd65877b3 100644 --- a/src/windows/identity/kconfig/kconfiginternal.h +++ b/src/windows/identity/kconfig/kconfiginternal.h @@ -27,6 +27,8 @@ #ifndef __KHIMAIRA_KCONFIGINTERNAL_H #define __KHIMAIRA_KCONFIGINTERNAL_H +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/kcreddb/kcreddbinternal.h b/src/windows/identity/kcreddb/kcreddbinternal.h index 2b80d1832..ac07aa75a 100644 --- a/src/windows/identity/kcreddb/kcreddbinternal.h +++ b/src/windows/identity/kcreddb/kcreddbinternal.h @@ -27,6 +27,8 @@ #ifndef __KHIMAIRA_KCREDDBINTERNAL_H__ #define __KHIMAIRA_KCREDDBINTERNAL_H__ +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/kherr/kherrinternal.h b/src/windows/identity/kherr/kherrinternal.h index fb6412aa2..b57686c23 100644 --- a/src/windows/identity/kherr/kherrinternal.h +++ b/src/windows/identity/kherr/kherrinternal.h @@ -27,6 +27,8 @@ #ifndef __KHIMAIRA_KHERRORINTERNAL_H #define __KHIMAIRA_KHERRORINTERNAL_H +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/kmm/kmminternal.h b/src/windows/identity/kmm/kmminternal.h index 1712e976c..b945d3509 100644 --- a/src/windows/identity/kmm/kmminternal.h +++ b/src/windows/identity/kmm/kmminternal.h @@ -27,6 +27,8 @@ #ifndef __KHIMAIRA_KMMINTERNAL_H #define __KHIMAIRA_KMMINTERNAL_H +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/kmm/kplugin.h b/src/windows/identity/kmm/kplugin.h index 6eb4e13c2..a5b7a088a 100644 --- a/src/windows/identity/kmm/kplugin.h +++ b/src/windows/identity/kmm/kplugin.h @@ -84,7 +84,7 @@ plugin. \note This callback is required. */ -KHMEXP khm_int32 KHMAPI init_module(kmm_module h_module); +KHMEXP_EXP khm_int32 KHMAPI init_module(kmm_module h_module); /*! \brief Type for init_module() */ typedef khm_int32 (KHMAPI *init_module_t)(kmm_module); @@ -104,7 +104,7 @@ typedef khm_int32 (KHMAPI *init_module_t)(kmm_module); Essentially, this is a message subscriber for KMQ messages. */ -KHMEXP khm_int32 KHMAPI _plugin_proc(khm_int32 msg_type, khm_int32 msg_subtype, khm_ui_4 uparam, void * vparam); +KHMEXP_EXP khm_int32 KHMAPI _plugin_proc(khm_int32 msg_type, khm_int32 msg_subtype, khm_ui_4 uparam, void * vparam); /*! \brief Type for init_plugin() */ typedef kmq_callback_t _plugin_proc_t; @@ -127,7 +127,7 @@ typedef kmq_callback_t _plugin_proc_t; \note This callback is not required. */ -KHMEXP khm_int32 KHMAPI exit_module(kmm_module h_module); +KHMEXP_EXP khm_int32 KHMAPI exit_module(kmm_module h_module); /*! \brief Type for exit_module() */ typedef khm_int32 (KHMAPI *exit_module_t)(kmm_module); diff --git a/src/windows/identity/kmq/kmqinternal.h b/src/windows/identity/kmq/kmqinternal.h index bd97f1bb6..8ae0ab67e 100644 --- a/src/windows/identity/kmq/kmqinternal.h +++ b/src/windows/identity/kmq/kmqinternal.h @@ -27,6 +27,8 @@ #ifndef __KHIMAIRA_KMQINTERNAL_H #define __KHIMAIRA_KMQINTERNAL_H +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/plugins/krb4/krb4main.c b/src/windows/identity/plugins/krb4/krb4main.c index 7ab2d71f3..6b1c395b2 100644 --- a/src/windows/identity/plugins/krb4/krb4main.c +++ b/src/windows/identity/plugins/krb4/krb4main.c @@ -58,7 +58,7 @@ void exit_krb() { } /* called by the NetIDMgr module manager */ -KHMEXP khm_int32 KHMAPI init_module(kmm_module h_module) { +KHMEXP_EXP khm_int32 KHMAPI init_module(kmm_module h_module) { khm_int32 rv = KHM_ERROR_SUCCESS; kmm_plugin_reg pi; wchar_t buf[256]; @@ -107,7 +107,7 @@ KHMEXP khm_int32 KHMAPI init_module(kmm_module h_module) { } /* called by the NetIDMgr module manager */ -KHMEXP khm_int32 KHMAPI exit_module(kmm_module h_module) { +KHMEXP_EXP khm_int32 KHMAPI exit_module(kmm_module h_module) { exit_imports(); exit_error_funcs(); diff --git a/src/windows/identity/plugins/krb4/krbcred.h b/src/windows/identity/plugins/krb4/krbcred.h index 53e22c892..0b6a148ee 100644 --- a/src/windows/identity/plugins/krb4/krbcred.h +++ b/src/windows/identity/plugins/krb4/krbcred.h @@ -56,8 +56,6 @@ void init_krb(); void exit_krb(); -KHMEXP khm_int32 KHMAPI init_module(kmm_module h_module); -KHMEXP khm_int32 KHMAPI exit_module(kmm_module h_module); /* globals */ extern kmm_module h_khModule; diff --git a/src/windows/identity/plugins/krb5/krb5main.c b/src/windows/identity/plugins/krb5/krb5main.c index befa7a980..4875a80f8 100644 --- a/src/windows/identity/plugins/krb5/krb5main.c +++ b/src/windows/identity/plugins/krb5/krb5main.c @@ -81,7 +81,7 @@ void exit_krb() { } /* called by the NetIDMgr module manager */ -KHMEXP khm_int32 KHMAPI init_module(kmm_module h_module) { +KHMEXP_EXP khm_int32 KHMAPI init_module(kmm_module h_module) { khm_int32 rv = KHM_ERROR_SUCCESS; kmm_plugin_reg pi; wchar_t buf[256]; @@ -426,7 +426,7 @@ _exit: } /* called by the NetIDMgr module manager */ -KHMEXP khm_int32 KHMAPI exit_module(kmm_module h_module) { +KHMEXP_EXP khm_int32 KHMAPI exit_module(kmm_module h_module) { exit_imports(); exit_error_funcs(); diff --git a/src/windows/identity/plugins/krb5/krbcred.h b/src/windows/identity/plugins/krb5/krbcred.h index 0048f7185..a194343ac 100644 --- a/src/windows/identity/plugins/krb5/krbcred.h +++ b/src/windows/identity/plugins/krb5/krbcred.h @@ -73,8 +73,6 @@ typedef enum tag_k5_lsa_import { void init_krb(); void exit_krb(); -KHMEXP khm_int32 KHMAPI init_module(kmm_module h_module); -KHMEXP khm_int32 KHMAPI exit_module(kmm_module h_module); /* globals */ extern kmm_module h_khModule; diff --git a/src/windows/identity/uilib/action.c b/src/windows/identity/uilib/action.c index d5556620d..be3860c81 100644 --- a/src/windows/identity/uilib/action.c +++ b/src/windows/identity/uilib/action.c @@ -26,6 +26,8 @@ /* $Id$ */ #define NOEXPORT +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/uilib/alert.c b/src/windows/identity/uilib/alert.c index 376eab6e1..02df7a1e3 100644 --- a/src/windows/identity/uilib/alert.c +++ b/src/windows/identity/uilib/alert.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include #include @@ -35,6 +37,7 @@ Alerter ***********************************************************************/ + khui_alert * kh_alerts = NULL; CRITICAL_SECTION cs_alerts; diff --git a/src/windows/identity/uilib/configui.c b/src/windows/identity/uilib/configui.c index 3de2573ea..f2994d840 100644 --- a/src/windows/identity/uilib/configui.c +++ b/src/windows/identity/uilib/configui.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/uilib/creddlg.c b/src/windows/identity/uilib/creddlg.c index 08b0a149d..eb883814f 100644 --- a/src/windows/identity/uilib/creddlg.c +++ b/src/windows/identity/uilib/creddlg.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/uilib/propsheet.c b/src/windows/identity/uilib/propsheet.c index 55c6cbb1b..068bcf00c 100644 --- a/src/windows/identity/uilib/propsheet.c +++ b/src/windows/identity/uilib/propsheet.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include #ifdef DEBUG diff --git a/src/windows/identity/uilib/propwnd.c b/src/windows/identity/uilib/propwnd.c index 2116f5ed4..ea36e28aa 100644 --- a/src/windows/identity/uilib/propwnd.c +++ b/src/windows/identity/uilib/propwnd.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include diff --git a/src/windows/identity/uilib/rescache.c b/src/windows/identity/uilib/rescache.c index 3134df825..7715cfdee 100644 --- a/src/windows/identity/uilib/rescache.c +++ b/src/windows/identity/uilib/rescache.c @@ -25,6 +25,7 @@ /* $Id$ */ #define NOEXPORT +#define _NIMLIB_ #include #include diff --git a/src/windows/identity/uilib/trackerwnd.c b/src/windows/identity/uilib/trackerwnd.c index 1ec2fda28..cc434d95f 100644 --- a/src/windows/identity/uilib/trackerwnd.c +++ b/src/windows/identity/uilib/trackerwnd.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include #include @@ -472,3 +474,4 @@ khui_tracker_kill_controls(khui_tracker * tc) { } + diff --git a/src/windows/identity/uilib/uibind.c b/src/windows/identity/uilib/uibind.c index be183b68f..f2f44cc3e 100644 --- a/src/windows/identity/uilib/uibind.c +++ b/src/windows/identity/uilib/uibind.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include @@ -57,3 +59,4 @@ khui_request_UI_callback(khm_ui_callback cb, void * rock) { } + diff --git a/src/windows/identity/uilib/uilibmain.c b/src/windows/identity/uilib/uilibmain.c index 5c13ad424..25cbcfe33 100644 --- a/src/windows/identity/uilib/uilibmain.c +++ b/src/windows/identity/uilib/uilibmain.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include extern void alert_init(void); diff --git a/src/windows/identity/uilib/version.c b/src/windows/identity/uilib/version.c index 6e3e48fe6..50a15543f 100644 --- a/src/windows/identity/uilib/version.c +++ b/src/windows/identity/uilib/version.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/util/hashtable.c b/src/windows/identity/util/hashtable.c index 5773d8021..7836179d6 100644 --- a/src/windows/identity/util/hashtable.c +++ b/src/windows/identity/util/hashtable.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/util/mstring.c b/src/windows/identity/util/mstring.c index d9eb9d350..176afc46c 100644 --- a/src/windows/identity/util/mstring.c +++ b/src/windows/identity/util/mstring.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/util/perfstat.c b/src/windows/identity/util/perfstat.c index 6a9dd8103..bcde1f229 100644 --- a/src/windows/identity/util/perfstat.c +++ b/src/windows/identity/util/perfstat.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include #include diff --git a/src/windows/identity/util/sync.c b/src/windows/identity/util/sync.c index c829ada7c..ba20424c4 100644 --- a/src/windows/identity/util/sync.c +++ b/src/windows/identity/util/sync.c @@ -24,6 +24,8 @@ /* $Id$ */ +#define _NIMLIB_ + #include #include #include -- 2.26.2