1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3 * This file is now only used on Windows
7 * type functions split out of here to make things look nicer in the
8 * various include files which need these definitions, as well as in
9 * the util/ directories.
12 #ifndef _KRB5_WIN_MAC_H
13 #define _KRB5_WIN_MAC_H
16 #define ID_READ_PWD_DIALOG 10000
17 #define ID_READ_PWD_PROMPT 10001
18 #define ID_READ_PWD_PROMPT2 10002
19 #define ID_READ_PWD_PWD 10003
23 #define APSTUDIO_HIDDEN_SYMBOLS
26 #else /* ! RES_ONLY */
28 /* To ensure backward compatibility of the ABI use 32-bit time_t on
33 #error krb5.h included before k5-int.h
34 #endif /* KRB5_GENERAL__ */
35 #if _INTEGRAL_MAX_BITS >= 64 && _MSC_VER >= 1400 && !defined(_WIN64) && !defined(_USE_32BIT_TIME_T)
36 #if defined(_TIME_T_DEFINED) || defined(_INC_IO) || defined(_INC_TIME) || defined(_INC_WCHAR)
37 #error time_t has been defined as a 64-bit integer which is incompatible with Kerberos on this platform.
38 #endif /* _TIME_T_DEFINED */
39 #define _USE_32BIT_TIME_T
44 #define SIZEOF_SHORT 2
50 #ifndef SIZE_MAX /* in case Microsoft defines max size of size_t */
51 #ifdef MAX_SIZE /* Microsoft defines MAX_SIZE as max size of size_t */
52 #define SIZE_MAX MAX_SIZE
54 #define SIZE_MAX UINT_MAX
59 # define KRB5_CALLCONV __stdcall
60 # define KRB5_CALLCONV_C __cdecl
63 * Use this to mark an incorrect calling convention that has been
64 * "immortalized" because it was incorrectly exported in a previous
68 # define KRB5_CALLCONV_WRONG KRB5_CALLCONV_C
70 #endif /* !KRB5_CALLCONV */
72 #ifndef KRB5_SYSTYPES__
73 #define KRB5_SYSTYPES__
74 #include <sys/types.h>
75 typedef unsigned long u_long; /* Not part of sys/types.h on the pc */
76 typedef unsigned int u_int;
77 typedef unsigned short u_short;
78 typedef unsigned char u_char;
79 typedef unsigned int uint32_t;
81 #if _INTEGRAL_MAX_BITS >= 64
82 typedef unsigned __int64 uint64_t;
83 typedef __int64 int64_t;
85 #ifndef SSIZE_T_DEFINED
90 typedef __int64 ssize_t;
92 typedef _W64 int ssize_t;
94 #define SSIZE_T_DEFINED
96 #endif /* KRB5_SYSTYPES__ */
98 #define MAXHOSTNAMELEN 512
100 #define MAXPATHLEN 256 /* Also for Windows temp files */
104 #define HAVE_NETINET_IN_H
105 #define MSDOS_FILESYSTEM
106 #define HAVE_STRING_H
110 #define HAVE_GETADDRINFO
111 #define HAVE_GETNAMEINFO
114 #define HAVE_STRERROR
115 #define SYS_ERRLIST_DECLARED
116 /* if __STDC_VERSION__ >= 199901L this shouldn't be needed */
117 #define inline __inline
118 #define NEED_INSIXADDR_ANY
119 #define ENABLE_THREADS
122 #define WM_KERBEROS5_CHANGED "Kerberos5 Changed"
124 #define WM_KERBEROS_CHANGED "Kerberos Changed"
127 /* Kerberos Windows initialization file */
128 #define KERBEROS_INI "kerberos.ini"
130 #define KERBEROS_HLP "kerbnet.hlp"
132 #define KERBEROS_HLP "krb5clnt.hlp"
134 #define INI_DEFAULTS "Defaults"
135 #define INI_USER "User" /* Default user */
136 #define INI_INSTANCE "Instance" /* Default instance */
137 #define INI_REALM "Realm" /* Default realm */
138 #define INI_POSITION "Position"
139 #define INI_OPTIONS "Options"
140 #define INI_DURATION "Duration" /* Ticket duration in minutes */
141 #define INI_EXPIRATION "Expiration" /* Action on expiration (alert or beep) */
142 #define INI_ALERT "Alert"
143 #define INI_BEEP "Beep"
144 #define INI_FILES "Files"
146 #define INI_KRB_CONF "krb.conf" /* Location of krb.conf file */
147 #define DEF_KRB_CONF "krb.conf" /* Default name for krb.conf file */
149 #define INI_KRB5_CONF "krb5.ini" /* From k5-config.h */
150 #define INI_KRB_CONF INI_KRB5_CONF /* Location of krb.conf file */
151 #define DEF_KRB_CONF INI_KRB5_CONF /* Default name for krb.conf file */
152 #define INI_TICKETOPTS "TicketOptions" /* Ticket options */
153 #define INI_FORWARDABLE "Forwardable" /* get forwardable tickets */
154 #define INI_KRB_CCACHE "krb5cc" /* From k5-config.h */
156 #define INI_KRB_REALMS "krb.realms" /* Location of krb.realms file */
157 #define DEF_KRB_REALMS "krb.realms" /* Default name for krb.realms file */
158 #define INI_RECENT_LOGINS "Recent Logins"
159 #define INI_LOGIN "Login"
162 #define HAS_VOID_TYPE
163 #define HAVE_STDARG_H
164 #define HAVE_SYS_TYPES_H
165 #define HAVE_STDLIB_H
168 /* This controls which encryption routines libcrypto will provide */
169 #define PROVIDE_DES_CBC_MD5
170 #define PROVIDE_DES_CBC_CRC
171 #define PROVIDE_DES_CBC_RAW
172 #define PROVIDE_DES_CBC_CKSUM
173 #define PROVIDE_CRC32
174 #define PROVIDE_RSA_MD4
175 #define PROVIDE_RSA_MD5
176 /* #define PROVIDE_DES3_CBC_SHA */
177 /* #define PROVIDE_DES3_CBC_RAW */
178 /* #define PROVIDE_NIST_SHA */
180 /* Ugly. Microsoft, in stdc mode, doesn't support the low-level i/o
181 * routines directly. Rather, they only export the _<function> version.
182 * The following defines works around this problem.
184 #include <sys\types.h>
185 #include <sys\stat.h>
189 #include <wincrypt.h>
192 /* Only needed by util/et/error_message.c but let's keep the source clean */
193 #define sys_nerr _sys_nerr
194 #define sys_errlist _sys_errlist
198 * Functions with slightly different names on the PC
201 #define strcasecmp _stricmp
204 #define strncasecmp _strnicmp
207 /* VS2005 has deprecated strdup */
209 #define strdup _strdup
212 /* Windows has its own name for reentrant strtok. */
213 #define strtok_r strtok_s
215 HINSTANCE get_lib_instance(void);
217 #define GETSOCKNAME_ARG2_TYPE struct sockaddr
218 #define GETSOCKNAME_ARG3_TYPE size_t
219 #define GETPEERNAME_ARG2_TYPE GETSOCKNAME_ARG2_TYPE
220 #define GETPEERNAME_ARG3_TYPE GETSOCKNAME_ARG3_TYPE
222 #endif /* !RES_ONLY */
226 #define THREEPARAMOPEN(x,y,z) open(x,y,z)
228 #ifndef KRB5_CALLCONV
229 #define KRB5_CALLCONV
232 #ifndef KRB5_CALLCONV_C
233 #define KRB5_CALLCONV_C
236 #endif /* _KRB5_WIN_MAC_H */