Path: blob/main/crypto/krb5/src/windows/leash/Lglobals.h
34889 views
//*****************************************************************************1// File: lgobals.h2// By: Arthur David Leather3// Created: 12/02/984// Copyright: @1998 Massachusetts Institute of Technology - All rights5// reserved.6// Description: H file for lgobals.cpp. Contains global variables and helper7// functions8//9// History:10//11// MM/DD/YY Inits Description of Change12// 02/02/98 ADL Original13//*****************************************************************************1415#if !defined LEASHGLOBALS_H16#define LEASHGLOBALS_H1718#include <tlhelp32.h>19#include <loadfuncs-com_err.h>20#include <loadfuncs-krb5.h>21////#include <loadfuncs-krb.h>22#include <loadfuncs-profile.h>23#include <loadfuncs-leash.h>24#include <krb5.h>2526// toolhelp functions27TYPEDEF_FUNC(28HANDLE,29WINAPI,30CreateToolhelp32Snapshot,31(DWORD, DWORD)32);33TYPEDEF_FUNC(34BOOL,35WINAPI,36Module32First,37(HANDLE, LPMODULEENTRY32)38);39TYPEDEF_FUNC(40BOOL,41WINAPI,42Module32Next,43(HANDLE, LPMODULEENTRY32)44);4546// psapi functions47TYPEDEF_FUNC(48DWORD,49WINAPI,50GetModuleFileNameExA,51(HANDLE, HMODULE, LPSTR, DWORD)52);53TYPEDEF_FUNC(54BOOL,55WINAPI,56EnumProcessModules,57(HANDLE, HMODULE*, DWORD, LPDWORD)58);5960#define pGetModuleFileNameEx pGetModuleFileNameExA6162extern DECL_FUNC_PTR(Leash_kdestroy);63extern DECL_FUNC_PTR(Leash_changepwd_dlg);64extern DECL_FUNC_PTR(Leash_changepwd_dlg_ex);65extern DECL_FUNC_PTR(Leash_kinit_dlg);66extern DECL_FUNC_PTR(Leash_kinit_dlg_ex);67extern DECL_FUNC_PTR(Leash_timesync);68extern DECL_FUNC_PTR(Leash_get_default_uppercaserealm);69extern DECL_FUNC_PTR(Leash_set_default_uppercaserealm);70extern DECL_FUNC_PTR(Leash_renew);7172// psapi functions73extern DECL_FUNC_PTR(GetModuleFileNameExA);74extern DECL_FUNC_PTR(EnumProcessModules);7576// toolhelp functions77extern DECL_FUNC_PTR(CreateToolhelp32Snapshot);78extern DECL_FUNC_PTR(Module32First);79extern DECL_FUNC_PTR(Module32Next);8081// com_err functions82extern DECL_FUNC_PTR(error_message);8384// krb5 functions85extern DECL_FUNC_PTR(krb5_cc_default_name);86extern DECL_FUNC_PTR(krb5_cc_set_default_name);87extern DECL_FUNC_PTR(krb5_get_default_config_files);88extern DECL_FUNC_PTR(krb5_free_config_files);89extern DECL_FUNC_PTR(krb5_free_context);90extern DECL_FUNC_PTR(krb5_get_default_realm);91extern DECL_FUNC_PTR(krb5_free_default_realm);92extern DECL_FUNC_PTR(krb5_cc_get_principal);93extern DECL_FUNC_PTR(krb5_build_principal);94extern DECL_FUNC_PTR(krb5_c_random_make_octets);95extern DECL_FUNC_PTR(krb5_get_init_creds_password);96extern DECL_FUNC_PTR(krb5_free_cred_contents);97extern DECL_FUNC_PTR(krb5_cc_resolve);98extern DECL_FUNC_PTR(krb5_unparse_name);99extern DECL_FUNC_PTR(krb5_free_unparsed_name);100extern DECL_FUNC_PTR(krb5_free_principal);101extern DECL_FUNC_PTR(krb5_cc_close);102extern DECL_FUNC_PTR(krb5_cc_default);103extern DECL_FUNC_PTR(krb5_cc_destroy);104extern DECL_FUNC_PTR(krb5_cc_set_flags);105extern DECL_FUNC_PTR(krb5_cc_get_name);106extern DECL_FUNC_PTR(krb5_cc_start_seq_get);107extern DECL_FUNC_PTR(krb5_cc_end_seq_get);108extern DECL_FUNC_PTR(krb5_cc_next_cred);109extern DECL_FUNC_PTR(krb5_cccol_cursor_new);110extern DECL_FUNC_PTR(krb5_cccol_cursor_next);111extern DECL_FUNC_PTR(krb5_cccol_cursor_free);112extern DECL_FUNC_PTR(krb5_decode_ticket);113extern DECL_FUNC_PTR(krb5_free_ticket);114extern DECL_FUNC_PTR(krb5_init_context);115extern DECL_FUNC_PTR(krb5_is_config_principal);116extern DECL_FUNC_PTR(krb5_cc_switch);117extern DECL_FUNC_PTR(krb5_build_principal_ext);118extern DECL_FUNC_PTR(krb5_get_renewed_creds);119extern DECL_FUNC_PTR(krb5_cc_initialize);120extern DECL_FUNC_PTR(krb5_cc_store_cred);121extern DECL_FUNC_PTR(krb5_cc_get_full_name);122extern DECL_FUNC_PTR(krb5_free_string);123extern DECL_FUNC_PTR(krb5_enctype_to_name);124extern DECL_FUNC_PTR(krb5_cc_get_type);125extern DECL_FUNC_PTR(krb5int_cc_user_set_default_name);126// extern DECL_FUNC_PTR(krb5_get_host_realm);127128// profile functions129extern DECL_FUNC_PTR(profile_release);130extern DECL_FUNC_PTR(profile_init);131extern DECL_FUNC_PTR(profile_flush);132extern DECL_FUNC_PTR(profile_rename_section);133extern DECL_FUNC_PTR(profile_update_relation);134extern DECL_FUNC_PTR(profile_clear_relation);135extern DECL_FUNC_PTR(profile_add_relation);136extern DECL_FUNC_PTR(profile_get_relation_names);137extern DECL_FUNC_PTR(profile_get_subsection_names);138extern DECL_FUNC_PTR(profile_get_values);139extern DECL_FUNC_PTR(profile_free_list);140extern DECL_FUNC_PTR(profile_abandon);141extern DECL_FUNC_PTR(profile_get_string);142extern DECL_FUNC_PTR(profile_release_string);143144#define SKIP_MINSIZE 0145#define LEFT_SIDE 1146#define RIGHT_SIDE 2147#define TOP_SIDE 3148#define RESET_MINSIZE 4149#define BOTTOM_SIDE 6150151#define ADMIN_SERVER "admin_server"152153#define ON 1154#define OFF 0155#define TRUE_FLAG 1156#define FALSE_FLAG 0157#ifdef _WIN64158#define LEASHDLL "leashw64.dll"159#define KERB5DLL "krb5_64.dll"160#define KERB5_PPROFILE_DLL "xpprof64.dll"161#else162#define LEASHDLL "leashw32.dll"163#define KERB5DLL "krb5_32.dll"164#define KERB5_PPROFILE_DLL "xpprof32.dll"165#endif166#define SECUR32DLL "secur32.dll"167#define KRB_FILE "KRB.CON"168#define KRBREALM_FILE "KRBREALM.CON"169#define TICKET_FILE "TICKET.KRB"170171#define LEASH_HELP_FILE "leash.chm"172173// Get ticket info for the default ccache only174extern void LeashKRB5ListDefaultTickets(TICKETINFO *ticketinfo);175// clean up ticket info176extern void LeashKRB5FreeTicketInfo(TICKETINFO *ticketinfo);177178// Allocate TICKETINFO for each ccache that contain tickets179extern void LeashKRB5ListAllTickets(TICKETINFO **ticketinfolist);180// clean up ticket info list181extern void LeashKRB5FreeTickets(TICKETINFO **ticketinfolist);182183class TicketInfoWrapper {184public:185HANDLE lockObj;186TICKETINFO Krb5;187};188extern TicketInfoWrapper ticketinfo;189190#endif191192193