1 #ifndef __LEASH_INT_H__
2 #define __LEASH_INT_H__
12 #define MIT_PWD_DLL_CLASS "MITPasswordWndDLL"
15 Register_MITPasswordEditControl(
20 Unregister_MITPasswordEditControl(
24 // Some defines swiped from leash.h
25 // These are necessary but they must be kept sync'ed with leash.h
26 #define HELPFILE "leash32.hlp"
27 extern char KRB_HelpFile[_MAX_PATH];
29 // Function Prototypes.
30 int lsh_com_err_proc (LPSTR whoami, long code, LPSTR fmt, va_list args);
31 int DoNiftyErrorReport(long errnum, LPSTR what);
32 LONG Leash_timesync(int);
33 BOOL Leash_ms2mit(BOOL);
36 int not_an_API_LeashAFSGetToken(TICKETINFO * ticketinfo, TicketList** ticketList, char * kprinc);
37 long FAR not_an_API_LeashFreeTicketList(TicketList** ticketList) ;
54 unsigned long publicIP,
83 char * principal_name,
88 krb5_deltat renew_life,
112 LeashKRB5_renew(void);
115 write_registry_setting(
123 read_registry_setting_user(
130 read_registry_setting(
137 get_STRING_from_registry(
146 get_DWORD_from_registry(
154 config_boolean_to_int(
158 BOOL GetSecurityLogonSessionData(PSECURITY_LOGON_SESSION_DATA * ppSessionData);
159 BOOL IsKerberosLogon(VOID);
162 int Leash_krb5_error(krb5_error_code rc, LPCSTR FailedFunctionName,
163 int FreeContextFlag, krb5_context *ctx,
165 int Leash_krb5_initialize(krb5_context *);
167 Leash_krb5_cc_default(krb5_context *ctx, krb5_ccache *cache);
170 LPSTR err_describe(LPSTR buf, long code);
172 // toolhelp functions
176 CreateToolhelp32Snapshot,
183 (HANDLE, LPMODULEENTRY32)
189 (HANDLE, LPMODULEENTRY32)
196 GetModuleFileNameExA,
197 (HANDLE, HMODULE, LPSTR, DWORD)
203 (HANDLE, HMODULE*, DWORD, LPDWORD)
206 #define pGetModuleFileNameEx pGetModuleFileNameExA
207 #define TOOLHELPDLL "kernel32.dll"
208 #define PSAPIDLL "psapi.dll"
211 extern DECL_FUNC_PTR(GetModuleFileNameExA);
212 extern DECL_FUNC_PTR(EnumProcessModules);
214 // toolhelp functions
215 extern DECL_FUNC_PTR(CreateToolhelp32Snapshot);
216 extern DECL_FUNC_PTR(Module32First);
217 extern DECL_FUNC_PTR(Module32Next);
219 /* In order to avoid including the private CCAPI headers */
220 typedef int cc_int32;
222 #define CC_API_VER_1 1
223 #define CC_API_VER_2 2
225 #define CCACHE_API cc_int32
228 ** The Official Error Codes
232 #define CC_NOTFOUND 2
239 #define CC_BAD_API_VERSION 9
240 #define CC_NO_EXIST 10
241 #define CC_NOT_SUPP 11
242 #define CC_BAD_PARM 12
243 #define CC_ERR_CACHE_ATTACH 13
244 #define CC_ERR_CACHE_RELEASE 14
245 #define CC_ERR_CACHE_FULL 15
246 #define CC_ERR_CRED_VERSION 16
249 CC_CRED_VUNKNOWN = 0, // For validation
252 CC_CRED_VMAX = 3 // For validation
255 typedef struct opaque_dll_control_block_type* apiCB;
256 typedef struct _infoNC {
267 apiCB** cc_ctx, // < DLL's primary control structure.
268 // returned here, passed everywhere else
269 cc_int32 api_version, // > ver supported by caller (use CC_API_VER_1)
270 cc_int32* api_supported, // < if ~NULL, max ver supported by DLL
271 const char** vendor // < if ~NULL, vendor name in read only C string
280 apiCB** cc_ctx // <> DLL's primary control structure. NULL after
289 apiCB* cc_ctx, // > DLL's primary control structure
290 struct _infoNC*** ppNCi // < (NULL before call) null terminated,
291 // list of a structs (free via cc_free_infoNC())
301 struct _infoNC*** ppNCi // < free list of structs returned by
302 // cc_get_cache_names(). set to NULL on return
305 #define CCAPI_DLL "krbcc32.dll"
307 /* The following definitions are summarized from KRB4, KRB5, Leash32, and
308 * Leashw32 modules. They are current as of KfW 2.6.2. There is no
309 * guarrantee that changes to other modules will be updated in this list.
312 /* Must match the values used in Leash32.exe */
313 #define LEASH_SETTINGS_REGISTRY_KEY_NAME "Software\\MIT\\Leash32\\Settings"
314 #define LEASH_SETTINGS_REGISTRY_VALUE_AFS_STATUS "AfsStatus"
315 #define LEASH_SETTINGS_REGISTRY_VALUE_DEBUG_WINDOW "DebugWindow"
316 #define LEASH_SETTINGS_REGISTRY_VALUE_LARGE_ICONS "LargeIcons"
317 #define LEASH_SETTINGS_REGISTRY_VALUE_DESTROY_TKTS "DestroyTickets"
318 #define LEASH_SETTINGS_REGISTRY_VALUE_LOW_TKT_ALARM "LowTicketAlarm"
319 #define LEASH_SETTINGS_REGISTRY_VALUE_AUTO_RENEW_TKTS "AutoRenewTickets"
320 #define LEASH_SETTINGS_REGISTRY_VALUE_UPPERCASEREALM "UpperCaseRealm"
321 #define LEASH_SETTINGS_REGISTRY_VALUE_TIMEHOST "TIMEHOST"
322 #define LEASH_SETTINGS_REGISTRY_VALUE_CREATE_MISSING_CFG "CreateMissingConfig"
323 #define LEASH_SETTINGS_REGISTRY_VALUE_MSLSA_IMPORT "MsLsaImport"
325 /* These values are defined and used within Leashw32.dll */
326 #define LEASH_REGISTRY_KEY_NAME "Software\\MIT\\Leash"
327 #define LEASH_REGISTRY_VALUE_LIFETIME "lifetime"
328 #define LEASH_REGISTRY_VALUE_RENEW_TILL "renew_till"
329 #define LEASH_REGISTRY_VALUE_RENEWABLE "renewable"
330 #define LEASH_REGISTRY_VALUE_FORWARDABLE "forwardable"
331 #define LEASH_REGISTRY_VALUE_NOADDRESSES "noaddresses"
332 #define LEASH_REGISTRY_VALUE_PROXIABLE "proxiable"
333 #define LEASH_REGISTRY_VALUE_PUBLICIP "publicip"
334 #define LEASH_REGISTRY_VALUE_USEKRB4 "usekrb4"
335 #define LEASH_REGISTRY_VALUE_KINIT_OPT "hide_kinit_options"
336 #define LEASH_REGISTRY_VALUE_LIFE_MIN "life_min"
337 #define LEASH_REGISTRY_VALUE_LIFE_MAX "life_max"
338 #define LEASH_REGISTRY_VALUE_RENEW_MIN "renew_min"
339 #define LEASH_REGISTRY_VALUE_RENEW_MAX "renew_max"
340 #define LEASH_REGISTRY_VALUE_LOCK_LOCATION "lock_file_locations"
341 #define LEASH_REGISTRY_VALUE_PRESERVE_KINIT "preserve_kinit_options"
343 /* must match values used within krbv4w32.dll */
344 #define KRB4_REGISTRY_KEY_NAME "Software\\MIT\\Kerberos4"
345 #define KRB4_REGISTRY_VALUE_CONFIGFILE "config"
346 #define KRB4_REGISTRY_VALUE_KRB_CONF "krb.conf"
347 #define KRB4_REGISTRY_VALUE_KRB_REALMS "krb.realms"
348 #define KRB4_REGISTRY_VALUE_TICKETFILE "ticketfile"
350 /* must match values used within krb5_32.dll */
351 #define KRB5_REGISTRY_KEY_NAME "Software\\MIT\\Kerberos5"
352 #define KRB5_REGISTRY_VALUE_CCNAME "ccname"
353 #define KRB5_REGISTRY_VALUE_CONFIGFILE "config"
355 /* must match values used within wshelper.dll */
356 #define WSHELP_REGISTRY_KEY_NAME "Software\\MIT\\WsHelper"
357 #define WSHELP_REGISTRY_VALUE_DEBUG "DebugOn"
359 #endif /* __LEASH_INT_H__ */