summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>2011-09-28 20:55:18 +0000
committerSam Hartman <hartmans@mit.edu>2011-09-28 20:55:18 +0000
commit43b0bdc2bfbb8ce198a0f031e394bcc35cde12f3 (patch)
treea75b35f72a0068981004b3fcc6b664981ae30a94 /src/include
parentebf757101939bf391061c366ecec8d34b4c190c3 (diff)
downloadkrb5-43b0bdc2bfbb8ce198a0f031e394bcc35cde12f3.tar.gz
krb5-43b0bdc2bfbb8ce198a0f031e394bcc35cde12f3.tar.xz
krb5-43b0bdc2bfbb8ce198a0f031e394bcc35cde12f3.zip
Moved LoadFuncs/UnloadFuncs() to windows/lib
Signed-off-by: Alexey Melnikov <aamelnikov@gmail.com> git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25257 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
-rw-r--r--src/include/loadfuncs.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/include/loadfuncs.h b/src/include/loadfuncs.h
new file mode 100644
index 000000000..7aef62d21
--- /dev/null
+++ b/src/include/loadfuncs.h
@@ -0,0 +1,41 @@
+#ifndef __LOADFUNCS_H__
+#define __LOADFUNCS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <windows.h>
+
+typedef struct _FUNC_INFO {
+ void** func_ptr_var;
+ char* func_name;
+} FUNC_INFO;
+
+#define DECL_FUNC_PTR(x) FP_##x p##x
+#define MAKE_FUNC_INFO(x) { (void**) &p##x, #x }
+#define END_FUNC_INFO { 0, 0 }
+#define TYPEDEF_FUNC(ret, call, name, args) typedef ret (call *FP_##name) args
+
+void
+UnloadFuncs(
+ FUNC_INFO fi[],
+ HINSTANCE h
+ );
+
+int
+LoadFuncs(
+ const char* dll_name,
+ FUNC_INFO fi[],
+ HINSTANCE* ph, // [out, optional] - DLL handle
+ int* pindex, // [out, optional] - index of last func loaded (-1 if none)
+ int cleanup, // cleanup function pointers and unload on error
+ int go_on, // continue loading even if some functions cannot be loaded
+ int silent // do not pop-up a system dialog if DLL cannot be loaded
+ );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __LOADFUNCS_H__ */