OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/WINNT/netidmgr_plugin/extensions/sample/credprov.h
00001 /*
00002  * Copyright (c) 2006 Secure Endpoints Inc.
00003  *
00004  * Permission is hereby granted, free of charge, to any person
00005  * obtaining a copy of this software and associated documentation
00006  * files (the "Software"), to deal in the Software without
00007  * restriction, including without limitation the rights to use, copy,
00008  * modify, merge, publish, distribute, sublicense, and/or sell copies
00009  * of the Software, and to permit persons to whom the Software is
00010  * furnished to do so, subject to the following conditions:
00011  *
00012  * The above copyright notice and this permission notice shall be
00013  * included in all copies or substantial portions of the Software.
00014  *
00015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00016  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00017  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00018  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00019  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00020  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00021  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00022  * SOFTWARE.
00023  */
00024 
00025 /* $Id$ */
00026 
00027 /* only include this header file once */
00028 #pragma once
00029 
00030 #ifndef _UNICODE
00031 #ifndef RC_INVOKED
00032 /* This template relies on _UNICODE being defined to call the correct
00033    APIs. */
00034 #error  This template needs to be compiled with _UNICODE
00035 #endif
00036 #endif
00037 
00038 /* Pull in configuration macros from the Makefile */
00039 #include "credacq_config.h"
00040 
00041 /* declare a few macros about our plugin */
00042 
00043 /* The following macro will be used throughout the template to refer
00044    to the name of the plugin.  The macro is actually defined the
00045    Makefile generated configuration header file.  Modify the
00046    PLUGINNAME Makefile macro.*/
00047 #ifndef MYPLUGIN_NAME
00048 #error  MYPLUGIN_NAME not defined
00049 #endif
00050 
00051 /* Also define the unicde equivalent of the name.  In general strings
00052    in NetIDMgr are unicode. */
00053 #define MYPLUGIN_NAMEW _T(MYPLUGIN_NAME)
00054 
00055 /* The name of the module.  This is distinct from the name of the
00056    plugin for several reasons.  One of which is that a single module
00057    can provide multiple plugins.  Also, having a module name distinct
00058    from a plugin name allows multiple vendors to provide the same
00059    plugin.  For example, the module name for the MIT Kerberos 5 plugin
00060    is MITKrb5 while the plugin name is Krb5Cred.  The macro is
00061    actually defined in the Makefile generated configuration header
00062    file.  Modify the MODULENAME Makefile macro.*/
00063 #ifndef MYMODULE_NAME
00064 #error  MYMODULE_NAME not defined
00065 #endif
00066 
00067 #define MYMODULE_NAMEW _T(MYMODULE_NAME)
00068 
00069 /* When logging events from our plugin, the event logging API can
00070    optionally take a facility name to provide a friendly label to
00071    identify where each event came from.  We will default to the plugin
00072    name, although it can be anything. */
00073 #define MYPLUGIN_FACILITYW MYPLUGIN_NAMEW
00074 
00075 /* Base name of the DLL that will be providing the plugin.  We use it
00076    to construct names of the DLLs that will contain localized
00077    resources.  This is defined in the Makefile and fed in to the build
00078    through there.  The macro to change in the Makefile is
00079    DLLBASENAME. */
00080 #ifndef MYPLUGIN_DLLBASE
00081 #error   MYPLUGIN_DLLBASE Not defined!
00082 #endif
00083 
00084 #define MYPLUGIN_DLLBASEW _T(MYPLUGIN_DLLBASE)
00085 
00086 /* Name of the authentication method that will be registered by the
00087    plugin.  This macro is actually defined in the Makefile generated
00088    configuration header file.  Change the AUTHMETHODNAME macro in the
00089    Makefile. */
00090 #ifndef AUTHMETHOD_NAME
00091 #error  AUTHMETHOD_NAME not defined
00092 #endif
00093 
00094 #define AUTHMETHOD_NAMEW _T(AUTHMETHOD_NAME)
00095 
00096 /* Configuration node names.  We just concatenate a few strings
00097    together, although you should feel free to completely define your
00098    own. */
00099 
00100 #define CONFIGNODE_MAIN   AUTHMETHOD_NAMEW L"Config"
00101 
00102 #include<windows.h>
00103 /* include the standard NetIDMgr header files */
00104 #include<netidmgr.h>
00105 
00106 /* And the AFS plug-in extension header file */
00107 #include "afspext.h"
00108 #include<tchar.h>
00109 
00110 /* declarations for language resources */
00111 #include "langres.h"
00112 
00113 #ifndef NOSTRSAFE
00114 #include<strsafe.h>
00115 #endif
00116 
00117 /***************************************************
00118  Externals
00119 ***************************************************/
00120 
00121 extern kmm_module h_khModule;
00122 extern HINSTANCE  hInstance;
00123 extern HMODULE    hResModule;
00124 extern afs_tk_method tk_method;
00125 
00126 extern const wchar_t * my_facility;
00127 
00128 /* Function declarations */
00129 
00130 /* in afspext.c */
00131 khm_int32 KHMAPI
00132 handle_AFS_MSG(khm_int32 msg_type,
00133                khm_int32 msg_subtype,
00134                khm_ui_4  uparam,
00135                void *    vparam);
00136 
00137 /* in plugin.c */
00138 khm_int32 KHMAPI
00139 plugin_msg_proc(khm_int32 msg_type,
00140                 khm_int32 msg_subtype,
00141                 khm_ui_4  uparam,
00142                 void * vparam);
00143 
00144 /* in config_main.c */
00145 INT_PTR CALLBACK
00146 config_dlgproc(HWND hwndDlg,
00147                UINT uMsg,
00148                WPARAM wParam,
00149                LPARAM lParam);
 All Data Structures Files Functions Variables