Only in krb5-beta5/src: .cvsignore Only in krb5-beta5/src: .rconf Only in krb5-beta5/src: ChangeLog Only in krb5-beta5/src: Makefile Only in krb5-beta5/src: Makefile.in Only in krb5-beta5/src: admin Only in krb5-beta5/src: appl Only in krb5-sap: changelog Only in krb5-beta5/src/clients: .cvsignore Only in krb5-beta5/src/clients: ChangeLog Only in krb5-beta5/src/clients: Makefile.in Only in krb5-beta5/src/clients: configure Only in krb5-beta5/src/clients: configure.in Only in krb5-beta5/src/clients: kdestroy Only in krb5-beta5/src/clients/kinit: .cvsignore Only in krb5-beta5/src/clients/kinit: ChangeLog Only in krb5-beta5/src/clients/kinit: Makefile.in Only in krb5-sap/clients/kinit: changelog Only in krb5-beta5/src/clients/kinit: configure Only in krb5-beta5/src/clients/kinit: configure.in Only in krb5-sap/clients/kinit: getopt.c Only in krb5-beta5/src/clients/kinit: kinit.M diff -ru --exclude=^configure$ krb5-beta5/src/clients/kinit/kinit.c krb5-sap/clients/kinit/kinit.c --- krb5-beta5/src/clients/kinit/kinit.c Tue Mar 28 20:57:38 1995 +++ krb5-sap/clients/kinit/kinit.c Mon Aug 21 22:49:02 1995 @@ -24,7 +24,12 @@ * Initialize a credentials cache. */ +#ifdef WIN32 +extern int getopt(int argc, char **argv, char *optstring); +#endif + #include "k5-int.h" +#include "krb5.h" #include "com_err.h" #include @@ -207,8 +212,25 @@ exit(1); } #else /* HAVE_PWD_H */ +#ifdef WIN32 + char username[32]; + DWORD buflen=31; + + if ( GetUserName(username, &buflen) ) { + username[31]= username[buflen]= '\0'; + if (code = krb5_parse_name (kcontext,username, &me)) { + com_err (argv[0], code, "when parsing name %s", + username); + exit(1); + } + } else { + fprintf(stderr, "GetUserName() failed\n"); + exit(1); + } +#else fprintf(stderr, "Unable to identify user\n"); exit(1); +#endif #endif /* HAVE_PWD_H */ } } Only in krb5-sap/clients/kinit: kinit.m Only in krb5-sap/clients/kinit: makefile Only in krb5-beta5/src/clients/klist: .cvsignore Only in krb5-beta5/src/clients/klist: ChangeLog Only in krb5-beta5/src/clients/klist: Makefile.in Only in krb5-sap/clients/klist: changelog Only in krb5-beta5/src/clients/klist: configure Only in krb5-beta5/src/clients/klist: configure.in Only in krb5-beta5/src/clients/klist: klist.M diff -ru --exclude=^configure$ krb5-beta5/src/clients/klist/klist.c krb5-sap/clients/klist/klist.c --- krb5-beta5/src/clients/klist/klist.c Thu May 4 04:58:13 1995 +++ krb5-sap/clients/klist/klist.c Mon Aug 21 23:01:36 1995 @@ -24,6 +24,10 @@ * List out the contents of your credential cache. */ +#ifdef WIN32 +extern int getopt(int argc, char **argv, char *optstring); +#endif + #include "krb5.h" #include "com_err.h" #include Only in krb5-sap/clients/klist: klist.m Only in krb5-sap/clients/klist: makefile Only in krb5-beta5/src/clients: ksu Only in krb5-beta5/src/config: ChangeLog Only in krb5-sap/config: changelog Only in krb5-beta5/src/config: doc Only in krb5-beta5/src/config: mac-config.README Only in krb5-sap/config: mac-config.readme diff -ru --exclude=^configure$ krb5-beta5/src/config/windows.in krb5-sap/config/windows.in --- krb5-beta5/src/config/windows.in Thu Apr 13 20:48:08 1995 +++ krb5-sap/config/windows.in Mon Aug 21 21:36:50 1995 @@ -14,12 +14,14 @@ # /* The name of the C compiler for the target */ CC=cl /nologo CL= -CCOPTS=/ALw /Zp /GD2s /Os /Zi /Od /W3 $(XTRA) -CCOPTS2=/AL /Zp /G2s /Os /Zi /Od /W3 -DINTERFACE= -DINTERFACE_C= $(XTRA) +CCOPTS=/Zp /Os /Zi /Od /W3 $(XTRA) -DWIN32 -D__STDC__=1 -D_WINDOWS -D_MSDOS +CCOPTS2=/Zp /Os /Zi /Od /W3 -DINTERFACE= -DINTERFACE_C= $(XTRA) -DWIN32 -D_WINDOWS -D_MSDOS CPPFLAGS = -I$(SRCTOP)/include -I$(SRCTOP)/include/krb5 DEFS = $(CPPFLAGS) CFLAGS2 = $(CCOPTS2) $(DEFS) +RCOPTS= # /nologo + # /Zi gives debug info in each object file. # /Zp packs structures: Required for Windows API (but is not default!!!) # /Za strict ansi compliance @@ -58,7 +60,8 @@ $(CC) $(CFLAGS) /c $*.c !if defined(LIBNAME) !if "$(LIBCMD)"!="rem" - $(LIBCMD) /nologo $(LIBNAME) -+$@; + if EXIST $(LIBNAME) $(LIBCMD) /nologo /OUT:$(LIBNAME) $(LIBNAME) $@ + IF NOT EXIST $(LIBNAME) $(LIBCMD) /nologo /OUT:$(LIBNAME) $@ !endif !endif Only in krb5-beta5/src: config-files Only in krb5-beta5/src/include: .cvsignore Only in krb5-beta5/src/include: .rconf Only in krb5-beta5/src/include: ChangeLog Only in krb5-beta5/src/include: Makefile.in Only in krb5-sap/include: changelog Only in krb5-beta5/src/include: kerberosIV Only in krb5-beta5/src/include/krb5: .cvsignore Only in krb5-beta5/src/include/krb5: .rconf Only in krb5-beta5/src/include/krb5: AddressXlation.h Only in krb5-beta5/src/include/krb5: ChangeLog Only in krb5-beta5/src/include/krb5: GetMyIPAddr.h Only in krb5-beta5/src/include/krb5: MacTCPCommonTypes.h Only in krb5-beta5/src/include/krb5: Makefile.in Only in krb5-beta5/src/include/krb5: TCPPB.h Only in krb5-beta5/src/include/krb5: UDPPB.h Only in krb5-sap/include/krb5: addressxlation.h Only in krb5-sap/include/krb5: adm_err.h Only in krb5-beta5/src/include/krb5: asn.1 Only in krb5-sap/include/krb5: asn1_err.h Only in krb5-sap/include/krb5: changelog Only in krb5-sap/include/krb5: getmyipaddr.h diff -ru --exclude=^configure$ krb5-beta5/src/include/krb5/k5-config.h krb5-sap/include/krb5/k5-config.h --- krb5-beta5/src/include/krb5/k5-config.h Thu Apr 27 21:18:10 1995 +++ krb5-sap/include/krb5/k5-config.h Mon Aug 21 11:42:54 1995 @@ -25,7 +25,7 @@ #ifndef KRB5_CONFIG__ #define KRB5_CONFIG__ -#ifdef _MSDOS +#if defined(_MSDOS) || defined(WIN32) /* * Machine-type definitions: PC Clone 386 running Microloss Windows */ @@ -39,17 +39,27 @@ #endif #define INI_KRB_CCACHE "krb5cc" /* Location of the ccache */ #define INI_KRB5_CONF "krb5.ini" /* Location of krb5.conf file */ +#define INI_KRB_KEYTAB "v5srvtab" /* Location of keytab file */ #define KRB5_DBM_COMPAT__ /* Don't load dbm.h */ #define KRB5_KDB5__ /* Don't load kdb.h */ #define KRB5_KDB5_DBM__ /* Don't load kdb_dbm.h */ -#define BITS16 -#define SIZEOF_INT 2 -#define SIZEOF_SHORT 2 -#define SIZEOF_LONG 4 -#define MAXHOSTNAMELEN 512 -#define MAXPATHLEN 128 +#ifdef WIN32 +# define BITS32 +# define SIZEOF_INT 4 +# define SIZEOF_SHORT 2 +# define SIZEOF_LONG 4 +# define MAXHOSTNAMELEN 512 +# define MAXPATHLEN 512 +#else +# define BITS16 +# define SIZEOF_INT 2 +# define SIZEOF_SHORT 2 +# define SIZEOF_LONG 4 +# define MAXHOSTNAMELEN 512 +# define MAXPATHLEN 128 +#endif /* !WIN32 */ #define KRB5_USE_INET #define MSDOS_FILESYSTEM @@ -83,6 +93,30 @@ typedef unsigned char u_char; #endif /* KRB5_SYSTYPES__ */ +#ifdef WIN32 + +#include + +#ifndef FAR +# define FAR +#endif +#ifndef NEAR +# define NEAR +#endif +#define _far +#define _near +#define _pascal +#define _cdecl +#define _huge + +#ifndef INTERFACE +#define INTERFACE APIENTRY +#define INTERFACE_C APIENTRY + +#endif + +#else /* !WIN32 */ + #ifndef INTERFACE #define INTERFACE __far __export __pascal #define INTERFACE_C __far __export __cdecl @@ -99,6 +133,8 @@ #define _pascal __pascal #define _cdecl __cdecl #define _huge __huge + +#endif /* !WIN32 */ #ifdef NEED_WINDOWS #include Only in krb5-sap/include/krb5: kdb5_err.h Only in krb5-sap/include/krb5: krb5_err.h Only in krb5-sap/include/krb5: kv5m_err.h diff -ru --exclude=^configure$ krb5-beta5/src/include/krb5/los-proto.h krb5-sap/include/krb5/los-proto.h --- krb5-beta5/src/include/krb5/los-proto.h Thu Apr 13 20:48:42 1995 +++ krb5-sap/include/krb5/los-proto.h Sat Aug 12 01:57:14 1995 @@ -35,7 +35,7 @@ PROTOTYPE((krb5_context)); /* libos.spec */ -krb5_error_code krb5_read_password +krb5_error_code INTERFACE krb5_read_password PROTOTYPE((krb5_context, char *, char *, Only in krb5-sap/include/krb5: mactcpcommontypes.h Only in krb5-sap/include/krb5: makefile Only in krb5-sap/include/krb5: makefile.in Only in krb5-beta5/src/include/krb5/stock: ChangeLog Only in krb5-sap/include/krb5/stock: changelog Only in krb5-sap/include/krb5: tcppb.h Only in krb5-sap/include/krb5: udppb.h diff -ru --exclude=^configure$ krb5-beta5/src/include/krb5/winsock.h krb5-sap/include/krb5/winsock.h --- krb5-beta5/src/include/krb5/winsock.h Wed Mar 1 18:52:21 1995 +++ krb5-sap/include/krb5/winsock.h Fri Aug 11 17:39:24 1995 @@ -11,18 +11,18 @@ * Change log: * * Fri Apr 23 16:31:01 1993 Mark Towfiq (towfiq@Microdyne.COM) - * New version from David Treadwell which adds extern "C" around - * __WSAFDIsSet() and removes "const" from buf param of - * WSAAsyncGetHostByAddr(). Added change log. + * New version from David Treadwell which adds extern "C" around + * __WSAFDIsSet() and removes "const" from buf param of + * WSAAsyncGetHostByAddr(). Added change log. * * Sat May 15 10:55:00 1993 David Treadwell (davidtr@microsoft.com) - * Fix the IN_CLASSC macro to account for class-D multicasts. - * Add AF_IPX == AF_NS. + * Fix the IN_CLASSC macro to account for class-D multicasts. + * Add AF_IPX == AF_NS. * * Tue Oct 19 13:05:02 1993 Mark Towfiq (Mark.Towfiq@Sun.COM) - * New version from David Treadwell which changes type of counter in - * fd_set to u_int instead of u_short, so that it is correctly - * promoted in Winsdows NT and other 32-bit environments. + * New version from David Treadwell which changes type of counter in + * fd_set to u_int instead of u_short, so that it is correctly + * promoted in Winsdows NT and other 32-bit environments. */ #ifndef _WINSOCKAPI_ @@ -62,8 +62,8 @@ #endif /* FD_SETSIZE */ typedef struct fd_set { - u_int fd_count; /* how many are SET? */ - SOCKET fd_array[FD_SETSIZE]; /* an array of SOCKETs */ + u_int fd_count; /* how many are SET? */ + SOCKET fd_array[FD_SETSIZE]; /* an array of SOCKETs */ } fd_set; #ifdef __cplusplus @@ -79,21 +79,21 @@ #define FD_CLR(fd, set) do { \ u_int __i; \ for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \ - if (((fd_set FAR *)(set))->fd_array[__i] == fd) { \ - while (__i < ((fd_set FAR *)(set))->fd_count-1) { \ - ((fd_set FAR *)(set))->fd_array[__i] = \ - ((fd_set FAR *)(set))->fd_array[__i+1]; \ - __i++; \ - } \ - ((fd_set FAR *)(set))->fd_count--; \ - break; \ - } \ + if (((fd_set FAR *)(set))->fd_array[__i] == fd) { \ + while (__i < ((fd_set FAR *)(set))->fd_count-1) { \ + ((fd_set FAR *)(set))->fd_array[__i] = \ + ((fd_set FAR *)(set))->fd_array[__i+1]; \ + __i++; \ + } \ + ((fd_set FAR *)(set))->fd_count--; \ + break; \ + } \ } \ } while(0) #define FD_SET(fd, set) do { \ if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) \ - ((fd_set FAR *)(set))->fd_array[((fd_set FAR *)(set))->fd_count++]=fd;\ + ((fd_set FAR *)(set))->fd_array[((fd_set FAR *)(set))->fd_count++]=fd;\ } while(0) #define FD_ZERO(set) (((fd_set FAR *)(set))->fd_count=0) @@ -104,8 +104,8 @@ * Structure used in select() call, taken from the BSD file sys/time.h. */ struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ + long tv_sec; /* seconds */ + long tv_usec; /* and microseconds */ }; /* @@ -115,8 +115,8 @@ */ #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) #define timercmp(tvp, uvp, cmp) \ - ((tvp)->tv_sec cmp (uvp)->tv_sec || \ - (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) + ((tvp)->tv_sec cmp (uvp)->tv_sec || \ + (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 /* @@ -134,8 +134,8 @@ #define IOC_OUT 0x40000000 /* copy out parameters */ #define IOC_IN 0x80000000 /* copy in parameters */ #define IOC_INOUT (IOC_IN|IOC_OUT) - /* 0x20000000 distinguishes new & - old ioctl's */ + /* 0x20000000 distinguishes new & + old ioctl's */ #define _IO(x,y) (IOC_VOID|(x<<8)|y) #define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y) @@ -160,11 +160,11 @@ */ struct hostent { - char FAR * h_name; /* official name of host */ - char FAR * FAR * h_aliases; /* alias list */ - short h_addrtype; /* host address type */ - short h_length; /* length of address */ - char FAR * FAR * h_addr_list; /* list of addresses */ + char FAR * h_name; /* official name of host */ + char FAR * FAR * h_aliases; /* alias list */ + short h_addrtype; /* host address type */ + short h_length; /* length of address */ + char FAR * FAR * h_addr_list; /* list of addresses */ #define h_addr h_addr_list[0] /* address, for backward compat */ }; @@ -173,23 +173,23 @@ * fits in 32 bits. */ struct netent { - char FAR * n_name; /* official name of net */ - char FAR * FAR * n_aliases; /* alias list */ - short n_addrtype; /* net address type */ - u_long n_net; /* network # */ + char FAR * n_name; /* official name of net */ + char FAR * FAR * n_aliases; /* alias list */ + short n_addrtype; /* net address type */ + u_long n_net; /* network # */ }; struct servent { - char FAR * s_name; /* official service name */ - char FAR * FAR * s_aliases; /* alias list */ - short s_port; /* port # */ - char FAR * s_proto; /* protocol to use */ + char FAR * s_name; /* official service name */ + char FAR * FAR * s_aliases; /* alias list */ + short s_port; /* port # */ + char FAR * s_proto; /* protocol to use */ }; struct protoent { - char FAR * p_name; /* official protocol name */ - char FAR * FAR * p_aliases; /* alias list */ - short p_proto; /* protocol # */ + char FAR * p_name; /* official protocol name */ + char FAR * FAR * p_aliases; /* alias list */ + short p_proto; /* protocol # */ }; /* @@ -251,7 +251,7 @@ #define IPPORT_BIFFUDP 512 #define IPPORT_WHOSERVER 513 #define IPPORT_ROUTESERVER 520 - /* 520+1 also used */ + /* 520+1 also used */ /* * Ports < IPPORT_RESERVED are reserved for @@ -270,23 +270,23 @@ * Internet address (old style... should be updated) */ struct in_addr { - union { - struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; - struct { u_short s_w1,s_w2; } S_un_w; - u_long S_addr; - } S_un; + union { + struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; + struct { u_short s_w1,s_w2; } S_un_w; + u_long S_addr; + } S_un; #define s_addr S_un.S_addr - /* can be used for most tcp & ip code */ + /* can be used for most tcp & ip code */ #define s_host S_un.S_un_b.s_b2 - /* host on imp */ + /* host on imp */ #define s_net S_un.S_un_b.s_b1 - /* network */ + /* network */ #define s_imp S_un.S_un_w.s_w2 - /* imp */ + /* imp */ #define s_impno S_un.S_un_b.s_b4 - /* imp # */ + /* imp # */ #define s_lh S_un.S_un_b.s_b3 - /* logical host */ + /* logical host */ }; /* @@ -320,23 +320,23 @@ * Socket address, internet style. */ struct sockaddr_in { - short sin_family; - u_short sin_port; - struct in_addr sin_addr; - char sin_zero[8]; + short sin_family; + u_short sin_port; + struct in_addr sin_addr; + char sin_zero[8]; }; #define WSADESCRIPTION_LEN 256 #define WSASYS_STATUS_LEN 128 typedef struct WSAData { - WORD wVersion; - WORD wHighVersion; - char szDescription[WSADESCRIPTION_LEN+1]; - char szSystemStatus[WSASYS_STATUS_LEN+1]; - unsigned short iMaxSockets; - unsigned short iMaxUdpDg; - char FAR * lpVendorInfo; + WORD wVersion; + WORD wHighVersion; + char szDescription[WSADESCRIPTION_LEN+1]; + char szSystemStatus[WSASYS_STATUS_LEN+1]; + unsigned short iMaxSockets; + unsigned short iMaxUdpDg; + char FAR * lpVendorInfo; } WSADATA; typedef WSADATA FAR *LPWSADATA; @@ -430,8 +430,8 @@ * addresses. */ struct sockaddr { - u_short sa_family; /* address family */ - char sa_data[14]; /* up to 14 bytes of direct address */ + u_short sa_family; /* address family */ + char sa_data[14]; /* up to 14 bytes of direct address */ }; /* @@ -439,8 +439,8 @@ * information in raw sockets. */ struct sockproto { - u_short sp_family; /* address family */ - u_short sp_protocol; /* protocol */ + u_short sp_family; /* address family */ + u_short sp_protocol; /* protocol */ }; /* @@ -472,8 +472,8 @@ * Structure used for manipulating linger option. */ struct linger { - u_short l_onoff; /* option on/off */ - u_short l_linger; /* linger time */ + u_short l_onoff; /* option on/off */ + u_short l_linger; /* linger time */ }; /* @@ -634,10 +634,14 @@ #define ETIMEDOUT WSAETIMEDOUT #define ECONNREFUSED WSAECONNREFUSED #define ELOOP WSAELOOP -#define ENAMETOOLONG WSAENAMETOOLONG +#ifndef ENAMETOOLONG +# define ENAMETOOLONG WSAENAMETOOLONG +#endif /* collision with errno.h */ #define EHOSTDOWN WSAEHOSTDOWN #define EHOSTUNREACH WSAEHOSTUNREACH -#define ENOTEMPTY WSAENOTEMPTY +#ifndef ENOTEMPTY +# define ENOTEMPTY WSAENOTEMPTY +#endif /* collision with errno.h */ #define EPROCLIM WSAEPROCLIM #define EUSERS WSAEUSERS #define EDQUOT WSAEDQUOT @@ -651,7 +655,7 @@ #endif SOCKET PASCAL FAR accept (SOCKET s, struct sockaddr FAR *addr, - int FAR *addrlen); + int FAR *addrlen); int PASCAL FAR bind (SOCKET s, const struct sockaddr FAR *addr, int namelen); @@ -662,13 +666,13 @@ int PASCAL FAR ioctlsocket (SOCKET s, long cmd, u_long FAR *argp); int PASCAL FAR getpeername (SOCKET s, struct sockaddr FAR *name, - int FAR * namelen); + int FAR * namelen); int PASCAL FAR getsockname (SOCKET s, struct sockaddr FAR *name, - int FAR * namelen); + int FAR * namelen); int PASCAL FAR getsockopt (SOCKET s, int level, int optname, - char FAR * optval, int FAR *optlen); + char FAR * optval, int FAR *optlen); u_long PASCAL FAR htonl (u_long hostlong); @@ -687,18 +691,18 @@ int PASCAL FAR recv (SOCKET s, char FAR * buf, int len, int flags); int PASCAL FAR recvfrom (SOCKET s, char FAR * buf, int len, int flags, - struct sockaddr FAR *from, int FAR * fromlen); + struct sockaddr FAR *from, int FAR * fromlen); int PASCAL FAR select (int nfds, fd_set FAR *readfds, fd_set FAR *writefds, - fd_set FAR *exceptfds, const struct timeval FAR *timeout); + fd_set FAR *exceptfds, const struct timeval FAR *timeout); int PASCAL FAR send (SOCKET s, const char FAR * buf, int len, int flags); int PASCAL FAR sendto (SOCKET s, const char FAR * buf, int len, int flags, - const struct sockaddr FAR *to, int tolen); + const struct sockaddr FAR *to, int tolen); int PASCAL FAR setsockopt (SOCKET s, int level, int optname, - const char FAR * optval, int optlen); + const char FAR * optval, int optlen); int PASCAL FAR shutdown (SOCKET s, int how); @@ -707,7 +711,7 @@ /* Database function prototypes */ struct hostent FAR * PASCAL FAR gethostbyaddr(const char FAR * addr, - int len, int type); + int len, int type); struct hostent FAR * PASCAL FAR gethostbyname(const char FAR * name); @@ -716,7 +720,7 @@ struct servent FAR * PASCAL FAR getservbyport(int port, const char FAR * proto); struct servent FAR * PASCAL FAR getservbyname(const char FAR * name, - const char FAR * proto); + const char FAR * proto); struct protoent FAR * PASCAL FAR getprotobynumber(int proto); @@ -741,34 +745,34 @@ int PASCAL FAR WSACancelBlockingCall(void); HANDLE PASCAL FAR WSAAsyncGetServByName(HWND hWnd, u_int wMsg, - const char FAR * name, - const char FAR * proto, - char FAR * buf, int buflen); + const char FAR * name, + const char FAR * proto, + char FAR * buf, int buflen); HANDLE PASCAL FAR WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, int port, - const char FAR * proto, char FAR * buf, - int buflen); + const char FAR * proto, char FAR * buf, + int buflen); HANDLE PASCAL FAR WSAAsyncGetProtoByName(HWND hWnd, u_int wMsg, - const char FAR * name, char FAR * buf, - int buflen); + const char FAR * name, char FAR * buf, + int buflen); HANDLE PASCAL FAR WSAAsyncGetProtoByNumber(HWND hWnd, u_int wMsg, - int number, char FAR * buf, - int buflen); + int number, char FAR * buf, + int buflen); HANDLE PASCAL FAR WSAAsyncGetHostByName(HWND hWnd, u_int wMsg, - const char FAR * name, char FAR * buf, - int buflen); + const char FAR * name, char FAR * buf, + int buflen); HANDLE PASCAL FAR WSAAsyncGetHostByAddr(HWND hWnd, u_int wMsg, - const char FAR * addr, int len, int type, - char FAR * buf, int buflen); + const char FAR * addr, int len, int type, + char FAR * buf, int buflen); int PASCAL FAR WSACancelAsyncRequest(HANDLE hAsyncTaskHandle); int PASCAL FAR WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg, - long lEvent); + long lEvent); #ifdef __cplusplus } diff -ru --exclude=^configure$ krb5-beta5/src/include/krb5.h krb5-sap/include/krb5.h --- krb5-beta5/src/include/krb5.h Wed May 3 11:23:07 1995 +++ krb5-sap/include/krb5.h Mon Aug 21 13:40:04 1995 @@ -32,7 +32,7 @@ #include "autoconf.h" #endif -#ifdef _MSDOS +#if defined(_MSDOS) && !defined(WIN32) #define SIZEOF_INT 2 #define SIZEOF_LONG 4 @@ -63,14 +63,61 @@ #endif /* !KRB5_CONFIG */ #else /* !_MSDOS */ #ifndef KRB5_CONFIG__ +#ifndef WIN32 #define INTERFACE #define INTERFACE_C -#define FAR -#define NEAR +#endif +#ifndef FAR +# define FAR +# define NEAR +#endif +#ifndef __far +# define __far +# define __near +#endif #endif /* !KRB5_CONFIG__ */ #include #endif /* _MSDOS */ + +#ifdef WIN32 +#include + +#define SIZEOF_SHORT 2 +#define SIZEOF_INT 4 +#define SIZEOF_LONG 4 + +#ifdef INTERFACE +#undef INTERFACE +#undef INTERFACE_C +#endif +#define INTERFACE APIENTRY +#define INTERFACE_C APIENTRY + +#ifndef KRB5_CONFIG__ +#define KRB5_PROVIDE_PROTOTYPES +#define HAS_VOID_TYPE +#define HAVE_STDARG_H +#ifndef FAR +# define FAR +# define NEAR +#endif +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif /* !_SIZE_T_DEFINED */ +#ifndef KRB5_SYSTYPES__ +#define KRB5_SYSTYPES__ +#include +typedef unsigned long u_long; /* Not part of sys/types.h on the pc */ +typedef unsigned int u_int; +typedef unsigned short u_short; +typedef unsigned char u_char; +#endif /* KRB5_SYSTYPES__ */ + +#endif /* !KRB5_CONFIG */ +#endif /* WIN32 */ + /* * begin wordsize.h */ @@ -1430,7 +1477,7 @@ krb5_error_code krb5_kt_register PROTOTYPE((krb5_context, krb5_kt_ops * )); -krb5_error_code krb5_kt_resolve +krb5_error_code INTERFACE krb5_kt_resolve PROTOTYPE((krb5_context, const char *, krb5_keytab * )); @@ -1464,7 +1511,7 @@ /* librc.spec--see rcache.h */ /* libcc.spec */ -krb5_error_code krb5_cc_resolve +krb5_error_code INTERFACE krb5_cc_resolve PROTOTYPE((krb5_context, char *, krb5_ccache * )); @@ -1674,7 +1721,7 @@ krb5_creds *, krb5_kdc_rep ** )); -krb5_error_code krb5_get_in_tkt_with_keytab +krb5_error_code INTERFACE krb5_get_in_tkt_with_keytab PROTOTYPE((krb5_context, const krb5_flags, krb5_address * const *, Only in krb5-sap/include: makefile Only in krb5-sap/include: makefile.in Only in krb5-sap/include: profile.h Only in krb5-beta5/src/include/sys: ChangeLog Only in krb5-sap/include/sys: changelog Only in krb5-beta5/src: kadmin Only in krb5-beta5/src: kadmin.old Only in krb5-beta5/src: kadmin.v4 Only in krb5-beta5/src: kdc Only in krb5-beta5/src: krb524 Only in krb5-beta5/src/lib: .cvsignore Only in krb5-beta5/src/lib: .rconf Only in krb5-beta5/src/lib: ChangeLog Only in krb5-beta5/src/lib: Makefile.in Only in krb5-sap/lib: changelog Only in krb5-beta5/src/lib/crypto: .cvsignore Only in krb5-beta5/src/lib/crypto: ChangeLog Only in krb5-beta5/src/lib/crypto: Makefile.in Only in krb5-sap/lib/crypto: changelog Only in krb5-beta5/src/lib/crypto/crc32: .cvsignore Only in krb5-beta5/src/lib/crypto/crc32: ChangeLog Only in krb5-beta5/src/lib/crypto/crc32: Makefile.in Only in krb5-sap/lib/crypto/crc32: changelog Only in krb5-sap/lib/crypto/crc32: makefile Only in krb5-sap/lib/crypto/crc32: makefile.in Only in krb5-beta5/src/lib/crypto/des: .cvsignore Only in krb5-beta5/src/lib/crypto/des: .rconf Only in krb5-beta5/src/lib/crypto/des: ChangeLog Only in krb5-beta5/src/lib/crypto/des: FUNCTIONS Only in krb5-beta5/src/lib/crypto/des: Makefile.in Only in krb5-sap/lib/crypto/des: changelog Only in krb5-beta5/src/lib/crypto/des: doc Only in krb5-beta5/src/lib/crypto/des: f_README Only in krb5-sap/lib/crypto/des: f_readme Only in krb5-sap/lib/crypto/des: functions Only in krb5-sap/lib/crypto/des: makefile Only in krb5-sap/lib/crypto/des: makefile.in Only in krb5-sap/lib/crypto: makefile Only in krb5-sap/lib/crypto: makefile.in Only in krb5-beta5/src/lib/crypto/md4: .cvsignore Only in krb5-beta5/src/lib/crypto/md4: .rconf Only in krb5-beta5/src/lib/crypto/md4: ChangeLog Only in krb5-beta5/src/lib/crypto/md4: Makefile.in Only in krb5-sap/lib/crypto/md4: changelog Only in krb5-sap/lib/crypto/md4: makefile Only in krb5-sap/lib/crypto/md4: makefile.in diff -ru --exclude=^configure$ krb5-beta5/src/lib/crypto/md4/md4.c krb5-sap/lib/crypto/md4/md4.c --- krb5-beta5/src/lib/crypto/md4/md4.c Thu Apr 13 20:49:42 1995 +++ krb5-sap/lib/crypto/md4/md4.c Sat Aug 19 00:47:36 1995 @@ -38,14 +38,14 @@ #include "k5-int.h" #include "rsa-md4.h" -#if defined(__STDC__) || defined(_WINDOWS) +#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32) #define UL(x) x##UL #else #define UL(x) ((krb5_ui_4) x) #endif /* forward declaration */ -#if defined(__STDC__) || defined(KRB5_PROVIDE_PROTOTYPES) || defined(_WINDOWS) +#if defined(__STDC__) || defined(KRB5_PROVIDE_PROTOTYPES) || defined(_WINDOWS) || defined(WIN32) static void Transform (krb5_ui_4 FAR *, krb5_ui_4 FAR *); #else static void Transform (); diff -ru --exclude=^configure$ krb5-beta5/src/lib/crypto/md4/rsa-md4.h krb5-sap/lib/crypto/md4/rsa-md4.h --- krb5-beta5/src/lib/crypto/md4/rsa-md4.h Thu Apr 20 11:39:52 1995 +++ krb5-sap/lib/crypto/md4/rsa-md4.h Sat Aug 19 01:00:28 1995 @@ -83,7 +83,7 @@ unsigned char digest[16]; /* actual digest after MD4Final call */ } MD4_CTX; -#if defined(__STDC__) || defined(_WINDOWS) +#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32) extern void MD4Init(MD4_CTX FAR *); extern void MD4Update(MD4_CTX FAR *, unsigned char FAR *, unsigned int); extern void MD4Final(MD4_CTX FAR *); Only in krb5-beta5/src/lib/crypto/md5: .cvsignore Only in krb5-beta5/src/lib/crypto/md5: ChangeLog Only in krb5-beta5/src/lib/crypto/md5: Makefile.in Only in krb5-sap/lib/crypto/md5: changelog Only in krb5-sap/lib/crypto/md5: makefile Only in krb5-sap/lib/crypto/md5: makefile.in diff -ru --exclude=^configure$ krb5-beta5/src/lib/crypto/md5/md5.c krb5-sap/lib/crypto/md5/md5.c --- krb5-beta5/src/lib/crypto/md5/md5.c Thu Apr 13 20:49:54 1995 +++ krb5-sap/lib/crypto/md5/md5.c Sat Aug 19 00:48:12 1995 @@ -38,7 +38,7 @@ #include "k5-int.h" #include "rsa-md5.h" -#if defined(__STDC__) || defined(_WINDOWS) +#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32) #define UL(x) x##UL #else #define UL(x) ((krb5_ui_4) x) Only in krb5-beta5/src/lib/crypto/os: .cvsignore Only in krb5-beta5/src/lib/crypto/os: ChangeLog Only in krb5-beta5/src/lib/crypto/os: Makefile.in Only in krb5-sap/lib/crypto/os: changelog Only in krb5-sap/lib/crypto/os: makefile Only in krb5-sap/lib/crypto/os: makefile.in Only in krb5-beta5/src/lib/des425: .cvsignore Only in krb5-beta5/src/lib/des425: ChangeLog Only in krb5-beta5/src/lib/des425: Makefile.in Only in krb5-sap/lib/des425: changelog Only in krb5-sap/lib/des425: key_sched1.c Only in krb5-sap/lib/des425: makefile Only in krb5-sap/lib/des425: makefile.in Only in krb5-sap/lib/des425: random_key1.c diff -ru --exclude=^configure$ krb5-beta5/src/lib/des425/unix_time.c krb5-sap/lib/des425/unix_time.c --- krb5-beta5/src/lib/des425/unix_time.c Thu Apr 13 20:50:21 1995 +++ krb5-sap/lib/des425/unix_time.c Thu Aug 10 01:06:50 1995 @@ -50,13 +50,18 @@ krb5_ui_4 *usecptr; { struct tm tm; +#ifndef WIN32 union _REGS inregs; /* For calling BIOS */ union _REGS outregs; - struct _timeb now; time_t time; +#endif + struct _timeb now; long convert; /* MSC 7.00 bug work around */ krb5_ui_4 retval; /* What we return */ +#ifdef WIN32 + retval= time(0); +#else _ftime(&now); /* Daylight savings time */ /* Get time from AT hardware clock INT 0x1A, AH=2 */ @@ -88,6 +93,7 @@ convert = win_time_get_epoch(); retval = time + convert; +#endif if (usecptr) *usecptr = retval; Only in krb5-beta5/src/lib/gssapi: .cvsignore Only in krb5-beta5/src/lib/gssapi: ChangeLog Only in krb5-beta5/src/lib/gssapi: Makefile.in Only in krb5-beta5/src/lib/gssapi: Makefile.original Only in krb5-beta5/src/lib/gssapi: README_SAMPLE_APP Only in krb5-sap/lib/gssapi: changelog Only in krb5-beta5/src/lib/gssapi/generic: .cvsignore Only in krb5-beta5/src/lib/gssapi/generic: ChangeLog Only in krb5-beta5/src/lib/gssapi/generic: Makefile.in Only in krb5-beta5/src/lib/gssapi/generic: Makefile.original Only in krb5-sap/lib/gssapi/generic: changelog diff -ru --exclude=^configure$ krb5-beta5/src/lib/gssapi/generic/gssapi.h krb5-sap/lib/gssapi/generic/gssapi.h --- krb5-beta5/src/lib/gssapi/generic/gssapi.h Sat Apr 29 23:10:55 1995 +++ krb5-sap/lib/gssapi/generic/gssapi.h Mon Aug 21 19:51:38 1995 @@ -33,7 +33,7 @@ * First, define the platform-dependent types. */ -#ifdef _MSDOS +#if defined(_MSDOS) && !defined(WIN32) #define GSS_SIZEOF_INT 2 #define GSS_SIZEOF_SHORT 2 #define GSS_SIZEOF_LONG 4 @@ -55,7 +55,15 @@ #define GSS_SIZEOF_SHORT 2 #ifndef FAR #define FAR -#define INTERFACE +#endif +#ifndef INTERFACE +# ifdef WIN32 +# include +# define INTERFACE APIENTRY +# define INTERFACE_C APIENTRY +# else +# define INTERFACE +# endif #endif /* FAR */ #endif @@ -72,7 +80,7 @@ typedef void FAR * gss_ctx_id_t; #if !defined(PROTOTYPE) -#if defined(__STDC__) || defined(_WINDOWS) +#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32) #define PROTOTYPE(x) x #else #define PROTOTYPE(x) () Only in krb5-beta5/src/lib/gssapi/generic: gssapiP_generic.h Only in krb5-sap/lib/gssapi/generic: gssapi_err_generic.c Only in krb5-sap/lib/gssapi/generic: gssapi_err_generic.h diff -ru --exclude=^configure$ krb5-beta5/src/lib/gssapi/generic/gssapi_generic.c krb5-sap/lib/gssapi/generic/gssapi_generic.c --- krb5-beta5/src/lib/gssapi/generic/gssapi_generic.c Sat Aug 20 01:37:33 1994 +++ krb5-sap/lib/gssapi/generic/gssapi_generic.c Mon Aug 14 17:01:10 1995 @@ -53,3 +53,4 @@ const_gss_OID gss_nt_machine_uid_name = oids+1; const_gss_OID gss_nt_string_uid_name = oids+2; const_gss_OID gss_nt_service_name = oids+3; + Only in krb5-sap/lib/gssapi/generic: gssapip_generic.h Only in krb5-sap/lib/gssapi/generic: makefile Only in krb5-sap/lib/gssapi/generic: makefile.in Only in krb5-sap/lib/gssapi/generic: makefile.original Only in krb5-beta5/src/lib/gssapi/krb5: .cvsignore Only in krb5-beta5/src/lib/gssapi/krb5: ChangeLog Only in krb5-beta5/src/lib/gssapi/krb5: Makefile.in Only in krb5-beta5/src/lib/gssapi/krb5: Makefile.original Only in krb5-sap/lib/gssapi/krb5: changelog Only in krb5-beta5/src/lib/gssapi/krb5: gssapiP_krb5.h Only in krb5-sap/lib/gssapi/krb5: gssapi_err_krb5.c Only in krb5-sap/lib/gssapi/krb5: gssapi_err_krb5.h Only in krb5-sap/lib/gssapi/krb5: gssapip_krb5.h diff -ru --exclude=^configure$ krb5-beta5/src/lib/gssapi/krb5/inq_context.c krb5-sap/lib/gssapi/krb5/inq_context.c --- krb5-beta5/src/lib/gssapi/krb5/inq_context.c Thu Apr 13 20:51:07 1995 +++ krb5-sap/lib/gssapi/krb5/inq_context.c Wed Jul 5 16:30:00 1995 @@ -68,8 +68,16 @@ return(GSS_S_FAILURE); } - if ((lifetime = ctx->endtime - now) < 0) - lifetime = 0; + if ( ctx->endtime==0 ) { + lifetime= GSS_C_INDEFINITE; + } else { + if ( (unsigned long)ctx->endtime <= (unsigned long)now ) { + lifetime= 0; + } else { + lifetime= (long) ((unsigned long)ctx->endtime - (unsigned long) now +); + } + } if (initiator_name) { if (code = krb5_copy_principal(context, diff -ru --exclude=^configure$ krb5-beta5/src/lib/gssapi/krb5/inq_cred.c krb5-sap/lib/gssapi/krb5/inq_cred.c --- krb5-beta5/src/lib/gssapi/krb5/inq_cred.c Thu Apr 13 20:51:08 1995 +++ krb5-sap/lib/gssapi/krb5/inq_cred.c Wed Jul 5 16:23:30 1995 @@ -66,8 +66,16 @@ return(GSS_S_FAILURE); } - if ((lifetime = cred->tgt_expire - now) < 0) - lifetime = 0; + if ( cred->tgt_expire==0 ) { + lifetime= GSS_C_INDEFINITE; + } else { + if ( (unsigned long)cred->tgt_expire <= (unsigned long)now ) { + lifetime= 0; + } else { + lifetime= (long) ((unsigned long)cred->tgt_expire - (unsigned long) now +); + } + } if (name) { if (code = krb5_copy_principal(context, cred->princ, &ret_name)) { Only in krb5-sap/lib/gssapi/krb5: makefile Only in krb5-sap/lib/gssapi/krb5: makefile.in Only in krb5-sap/lib/gssapi/krb5: makefile.original Only in krb5-sap/lib/gssapi: makefile Only in krb5-sap/lib/gssapi: makefile.in Only in krb5-sap/lib/gssapi: makefile.original Only in krb5-sap/lib/gssapi: readme_sample_app Only in krb5-beta5/src/lib/gssapi: sample diff -ru --exclude=^configure$ krb5-beta5/src/lib/gssapi.def krb5-sap/lib/gssapi.def --- krb5-beta5/src/lib/gssapi.def Thu Apr 13 20:48:56 1995 +++ krb5-sap/lib/gssapi.def Fri Aug 18 21:50:58 1995 @@ -4,32 +4,31 @@ LIBRARY GSSAPI DESCRIPTION 'Base Generic Security Service API' -EXETYPE WINDOWS -CODE PRELOAD MOVEABLE DISCARDABLE -DATA PRELOAD MOVEABLE SINGLE -HEAPSIZE 8192 + +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE SINGLE EXPORTS - WEP @1001 RESIDENTNAME - LIBMAIN @1002 - GSS_ACQUIRE_CRED @1 - GSS_RELEASE_CRED @2 - GSS_INIT_SEC_CONTEXT @3 - GSS_ACCEPT_SEC_CONTEXT @4 - GSS_PROCESS_CONTEXT_TOKEN @5 - GSS_DELETE_SEC_CONTEXT @6 - GSS_CONTEXT_TIME @7 - GSS_SIGN @8 - GSS_VERIFY @9 - GSS_SEAL @10 - GSS_UNSEAL @11 - GSS_DISPLAY_STATUS @12 - GSS_INDICATE_MECHS @13 - GSS_COMPARE_NAME @14 - GSS_DISPLAY_NAME @15 - GSS_IMPORT_NAME @16 - GSS_RELEASE_NAME @17 - GSS_RELEASE_BUFFER @18 - GSS_RELEASE_OID_SET @19 - GSS_INQUIRE_CRED @20 + gss_acquire_cred @1 + gss_release_cred @2 + gss_init_sec_context @3 + gss_accept_sec_context @4 + gss_process_context_token @5 + gss_delete_sec_context @6 + gss_context_time @7 + gss_sign @8 + gss_verify @9 + gss_seal @10 + gss_unseal @11 + gss_display_status @12 + gss_indicate_mechs @13 + gss_compare_name @14 + gss_display_name @15 + gss_import_name @16 + gss_release_name @17 + gss_release_buffer @18 + gss_release_oid_set @19 + gss_inquire_cred @20 + + gss_inquire_context Only in krb5-sap/lib: gssapi.def.16bit Only in krb5-beta5/src/lib: kadm Only in krb5-beta5/src/lib: kdb Only in krb5-beta5/src/lib: kdb4 Only in krb5-beta5/src/lib: krb4 Only in krb5-beta5/src/lib/krb425: .cvsignore Only in krb5-beta5/src/lib/krb425: ChangeLog Only in krb5-beta5/src/lib/krb425: Makefile.in Only in krb5-beta5/src/lib/krb425: README Only in krb5-sap/lib/krb425: changelog Only in krb5-sap/lib/krb425: makefile.in Only in krb5-sap/lib/krb425: readme Only in krb5-beta5/src/lib/krb5: .cvsignore Only in krb5-beta5/src/lib/krb5: ChangeLog Only in krb5-beta5/src/lib/krb5: Makefile.in Only in krb5-beta5/src/lib/krb5/asn.1: .cvsignore Only in krb5-beta5/src/lib/krb5/asn.1: .rconf Only in krb5-beta5/src/lib/krb5/asn.1: .saberinit Only in krb5-beta5/src/lib/krb5/asn.1: ChangeLog Only in krb5-beta5/src/lib/krb5/asn.1: KRB5-asn.py Only in krb5-beta5/src/lib/krb5/asn.1: Makefile.in Only in krb5-sap/lib/krb5/asn.1: changelog Only in krb5-sap/lib/krb5/asn.1: krb5-asn.py Only in krb5-sap/lib/krb5/asn.1: makefile Only in krb5-sap/lib/krb5/asn.1: makefile.in Only in krb5-beta5/src/lib/krb5/ccache: .cvsignore Only in krb5-beta5/src/lib/krb5/ccache: ChangeLog Only in krb5-beta5/src/lib/krb5/ccache: Makefile.in diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/ccache/ccbase.c krb5-sap/lib/krb5/ccache/ccbase.c --- krb5-beta5/src/lib/krb5/ccache/ccbase.c Thu Apr 13 20:51:58 1995 +++ krb5-sap/lib/krb5/ccache/ccbase.c Sat Aug 12 02:28:20 1995 @@ -73,7 +73,7 @@ * particular cache type. */ -krb5_error_code +krb5_error_code INTERFACE krb5_cc_resolve (context, name, cache) krb5_context context; char *name; Only in krb5-sap/lib/krb5/ccache: changelog Only in krb5-beta5/src/lib/krb5/ccache/file: .cvsignore Only in krb5-beta5/src/lib/krb5/ccache/file: .rconf Only in krb5-beta5/src/lib/krb5/ccache/file: ChangeLog Only in krb5-beta5/src/lib/krb5/ccache/file: Makefile.in Only in krb5-beta5/src/lib/krb5/ccache/file: README Only in krb5-sap/lib/krb5/ccache/file: changelog diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/ccache/file/fcc_errs.c krb5-sap/lib/krb5/ccache/file/fcc_errs.c --- krb5-beta5/src/lib/krb5/ccache/file/fcc_errs.c Thu Apr 13 20:52:05 1995 +++ krb5-sap/lib/krb5/ccache/file/fcc_errs.c Thu Aug 10 00:51:28 1995 @@ -45,7 +45,9 @@ #ifdef ELOOP case ELOOP: /* XXX */ #endif +#ifdef ETXTBSY case ETXTBSY: +#endif case EBUSY: case EROFS: retval = KRB5_FCC_PERM; diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/ccache/file/fcc_ops.c krb5-sap/lib/krb5/ccache/file/fcc_ops.c --- krb5-beta5/src/lib/krb5/ccache/file/fcc_ops.c Wed Mar 22 17:35:42 1995 +++ krb5-sap/lib/krb5/ccache/file/fcc_ops.c Sat Aug 19 00:51:54 1995 @@ -46,7 +46,7 @@ krb5_fcc_set_flags, }; -#ifdef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) /* * krb5_change_cache should be called after the cache changes. Only in krb5-sap/lib/krb5/ccache/file: makefile Only in krb5-sap/lib/krb5/ccache/file: makefile.in Only in krb5-sap/lib/krb5/ccache/file: readme Only in krb5-sap/lib/krb5/ccache: makefile Only in krb5-sap/lib/krb5/ccache: makefile.in Only in krb5-beta5/src/lib/krb5/ccache/stdio: .cvsignore Only in krb5-beta5/src/lib/krb5/ccache/stdio: .rconf Only in krb5-beta5/src/lib/krb5/ccache/stdio: ChangeLog Only in krb5-beta5/src/lib/krb5/ccache/stdio: Makefile.in Only in krb5-beta5/src/lib/krb5/ccache/stdio: README Only in krb5-sap/lib/krb5/ccache/stdio: changelog Only in krb5-sap/lib/krb5/ccache/stdio: makefile Only in krb5-sap/lib/krb5/ccache/stdio: makefile.in Only in krb5-sap/lib/krb5/ccache/stdio: readme diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/ccache/stdio/scc_gennew.c krb5-sap/lib/krb5/ccache/stdio/scc_gennew.c --- krb5-beta5/src/lib/krb5/ccache/stdio/scc_gennew.c Thu Apr 13 20:52:14 1995 +++ krb5-sap/lib/krb5/ccache/stdio/scc_gennew.c Sat Aug 19 00:52:36 1995 @@ -86,7 +86,7 @@ strcpy(((krb5_scc_data *) lid->data)->filename, scratch); /* Make sure the file name is useable */ -#if defined(__STDC__) || defined(_WINDOWS) +#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32) f = fopen (((krb5_scc_data *) lid->data)->filename, "wb+"); #else f = fopen (((krb5_scc_data *) lid->data)->filename, "w+"); Only in krb5-sap/lib/krb5: changelog Only in krb5-sap/lib/krb5: error_ta Only in krb5-beta5/src/lib/krb5: error_tables Only in krb5-beta5/src/lib/krb5/free: .cvsignore Only in krb5-beta5/src/lib/krb5/free: ChangeLog Only in krb5-beta5/src/lib/krb5/free: Makefile.in Only in krb5-sap/lib/krb5/free: changelog Only in krb5-sap/lib/krb5/free: makefile Only in krb5-sap/lib/krb5/free: makefile.in Only in krb5-beta5/src/lib/krb5/keytab: .cvsignore Only in krb5-beta5/src/lib/krb5/keytab: ChangeLog Only in krb5-beta5/src/lib/krb5/keytab: Makefile.in Only in krb5-sap/lib/krb5/keytab: changelog Only in krb5-beta5/src/lib/krb5/keytab/file: .cvsignore Only in krb5-beta5/src/lib/krb5/keytab/file: ChangeLog Only in krb5-beta5/src/lib/krb5/keytab/file: Makefile.in Only in krb5-sap/lib/krb5/keytab/file: changelog diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/keytab/file/ktf_util.c krb5-sap/lib/krb5/keytab/file/ktf_util.c --- krb5-beta5/src/lib/krb5/keytab/file/ktf_util.c Thu Apr 13 20:53:21 1995 +++ krb5-sap/lib/krb5/keytab/file/ktf_util.c Fri Aug 11 22:15:42 1995 @@ -68,8 +68,8 @@ */ #define NEED_SOCKETS -#include "krb5.h" #include "k5-int.h" +#include "krb5.h" #include #include "ktfile.h" Only in krb5-sap/lib/krb5/keytab/file: makefile Only in krb5-sap/lib/krb5/keytab/file: makefile.in diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/keytab/ktbase.c krb5-sap/lib/krb5/keytab/ktbase.c --- krb5-beta5/src/lib/krb5/keytab/ktbase.c Thu Apr 13 20:53:00 1995 +++ krb5-sap/lib/krb5/keytab/ktbase.c Sat Aug 12 01:18:10 1995 @@ -68,7 +68,7 @@ * particular keytab type. */ -krb5_error_code +krb5_error_code INTERFACE krb5_kt_resolve (context, name, ktid) krb5_context context; const char *name; Only in krb5-sap/lib/krb5/keytab: makefile Only in krb5-sap/lib/krb5/keytab: makefile.in Only in krb5-beta5/src/lib/krb5/krb: .cvsignore Only in krb5-beta5/src/lib/krb5/krb: ChangeLog Only in krb5-beta5/src/lib/krb5/krb: Makefile.in Only in krb5-sap/lib/krb5/krb: changelog diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/krb/in_tkt_ktb.c krb5-sap/lib/krb5/krb/in_tkt_ktb.c --- krb5-beta5/src/lib/krb5/krb/in_tkt_ktb.c Thu Apr 13 20:54:16 1995 +++ krb5-sap/lib/krb5/krb/in_tkt_ktb.c Sat Aug 12 01:41:08 1995 @@ -107,7 +107,7 @@ returns system errors, encryption errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_get_in_tkt_with_keytab(context, options, addrs, etypes, pre_auth_types, keytab, ccache, creds, ret_as_reply) krb5_context context; diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/krb/in_tkt_sky.c krb5-sap/lib/krb5/krb/in_tkt_sky.c --- krb5-beta5/src/lib/krb5/krb/in_tkt_sky.c Thu Apr 13 20:54:21 1995 +++ krb5-sap/lib/krb5/krb/in_tkt_sky.c Sat Aug 12 01:56:48 1995 @@ -26,6 +26,7 @@ */ #include "k5-int.h" +#include "los-proto.h" struct skey_keyproc_arg { const krb5_keyblock *key; Only in krb5-sap/lib/krb5/krb: makefile Only in krb5-sap/lib/krb5/krb: makefile.in diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/krb/parse.c krb5-sap/lib/krb5/krb/parse.c --- krb5-beta5/src/lib/krb5/krb/parse.c Mon Apr 24 20:55:52 1995 +++ krb5-sap/lib/krb5/krb/parse.c Sat Aug 19 00:50:44 1995 @@ -186,12 +186,12 @@ else krb5_princ_component(context, principal, i)->length = size; if (i + 1 != components) { -#ifndef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) + /* Need to come up with windows error handling mechanism */ +#else fprintf(stderr, "Programming error in krb5_parse_name!"); exit(1); -#else - /* Need to come up with windows error handling mechanism */ #endif } } else { Only in krb5-sap/lib/krb5: makefile Only in krb5-sap/lib/krb5: makefile.in Only in krb5-beta5/src/lib/krb5/os: .cvsignore Only in krb5-beta5/src/lib/krb5/os: ChangeLog Only in krb5-beta5/src/lib/krb5/os: DNR.c Only in krb5-beta5/src/lib/krb5/os: Makefile.in diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/os/ccdefname.c krb5-sap/lib/krb5/os/ccdefname.c --- krb5-beta5/src/lib/krb5/os/ccdefname.c Thu Apr 13 20:55:13 1995 +++ krb5-sap/lib/krb5/os/ccdefname.c Sat Aug 19 00:41:20 1995 @@ -40,7 +40,7 @@ #ifdef HAVE_MACSOCK_H strcpy (name_buf, "STDIO:krb5cc"); #else -#ifdef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) { char defname[160]; /* Default value */ Only in krb5-sap/lib/krb5/os: changelog Only in krb5-sap/lib/krb5/os: dnr.c diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/os/hst_realm.c krb5-sap/lib/krb5/os/hst_realm.c --- krb5-beta5/src/lib/krb5/os/hst_realm.c Sat Apr 22 00:24:49 1995 +++ krb5-sap/lib/krb5/os/hst_realm.c Sat Aug 19 00:55:12 1995 @@ -83,7 +83,7 @@ extern char *krb5_trans_file; -#ifdef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) /* * Windows DLL can't use the fscanf routine. We need fscanf to read * in the host and realm. Read_2str with read_1str duplicate the needed @@ -189,7 +189,7 @@ (void) sprintf(scanstring, "%%%ds %%%ds", sizeof(trans_host)-1,sizeof(trans_realm)-1); while (1) { -#ifdef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) scanval = read_2str (trans_file, trans_host, sizeof(trans_host)-1, trans_realm, sizeof(trans_realm)-1); #else diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/os/init_os_ctx.c krb5-sap/lib/krb5/os/init_os_ctx.c --- krb5-beta5/src/lib/krb5/os/init_os_ctx.c Mon May 1 23:19:24 1995 +++ krb5-sap/lib/krb5/os/init_os_ctx.c Sat Aug 19 00:55:54 1995 @@ -47,7 +47,7 @@ ctx->os_context = (void *) os_ctx; #ifndef OLD_CONFIG_FILES -#ifdef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) { char defname[160]; /* Default value */ char krb5conf[160]; /* Actual value */ diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/os/ktdefname.c krb5-sap/lib/krb5/os/ktdefname.c --- krb5-beta5/src/lib/krb5/os/ktdefname.c Thu Apr 13 20:55:30 1995 +++ krb5-sap/lib/krb5/os/ktdefname.c Mon Aug 21 12:53:26 1995 @@ -34,8 +34,29 @@ char *name; int namesize; { - strncpy(name, krb5_defkeyname, namesize); - if ((size_t) namesize < strlen(krb5_defkeyname)) + char *ptr; + int len; + int drop_it= 0; + + if ( (ptr= getenv("KRB5_KEYTAB"))==NULL ) { + if (!context || (context->magic != KV5M_CONTEXT)) + return KV5M_CONTEXT; + + profile_get_string(context->profile, "libdefaults", + "default_keytab", 0, 0, + &ptr); + if ( ptr!=NULL ) { + drop_it= 1; /* need to free memory ... */ + } else { + ptr= krb5_defkeyname; + } + } + + strncpy(name, ptr, namesize); + len= strlen(ptr); + if (drop_it) + free(ptr); + if ((size_t) namesize < len) return KRB5_CONFIG_NOTENUFSPACE; else return 0; Only in krb5-sap/lib/krb5/os: makefile Only in krb5-sap/lib/krb5/os: makefile.in diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/os/osconfig.c krb5-sap/lib/krb5/os/osconfig.c --- krb5-beta5/src/lib/krb5/os/osconfig.c Sun Apr 30 16:07:25 1995 +++ krb5-sap/lib/krb5/os/osconfig.c Sat Aug 19 00:45:32 1995 @@ -58,11 +58,13 @@ krb5_error_code krb5_find_config_files () { -#ifdef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) static char cnfname[160]; /* For krb.con */ static char realmsname[160]; /* For krb.rea */ + static char keytabname[160]; /* For v5srvtab */ char defname[160]; /* Default value */ + /* First locate krb.con file */ GetWindowsDirectory(defname, sizeof(defname)); strcat (defname, "\\"); @@ -77,8 +79,16 @@ GetPrivateProfileString(INI_FILES, INI_KRB_REALMS, defname, realmsname, sizeof(realmsname), KERBEROS_INI); + strcpy(defname, "FILE:"); + GetWindowsDirectory(&(defname[5]), sizeof(defname)-5); + strcat (defname, "\\"); + strcat (defname, DEFAULT_KEYTAB_NAME); + GetPrivateProfileString(INI_FILES, INI_KRB_KEYTAB, defname, + keytabname, sizeof(keytabname), KERBEROS_INI); + krb5_config_file = cnfname; krb5_trans_file = realmsname; + krb5_defkeyname = keytabname; #endif /* _WINDOWS */ diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/os/read_pwd.c krb5-sap/lib/krb5/os/read_pwd.c --- krb5-beta5/src/lib/krb5/os/read_pwd.c Thu Apr 13 20:55:43 1995 +++ krb5-sap/lib/krb5/os/read_pwd.c Sat Aug 19 00:56:54 1995 @@ -25,9 +25,9 @@ */ #include "k5-int.h" -#ifndef _MSDOS #include #include +#if !defined(_MSDOS) && !defined(WIN32) #include #include @@ -81,7 +81,7 @@ int *size_return; { /* adapted from Kerberos v4 des/read_password.c */ -#if defined(__STDC__) || defined(mips) || defined(_WINDOWS) +#if defined(__STDC__) || defined(mips) || defined(_WINDOWS) || defined(WIN32) /* readin_string is used after a longjmp, so must be volatile */ volatile #endif @@ -254,7 +254,10 @@ /* Don't expect to be called, just define it for sanity and the linker. */ -krb5_error_code +#include +#define cleanup(x) return(x) + +krb5_error_code INTERFACE krb5_read_password(context, prompt, prompt2, return_pwd, size_return) krb5_context context; char *prompt; @@ -262,7 +265,89 @@ char *return_pwd; int *size_return; { - *size_return = 0; - return 0; + char *readin_string = 0; + register char *ptr; + int i; + char ch; + + /* put out the prompt */ + (void) fputs(prompt,stdout); + (void) fflush(stdout); + (void) memset(return_pwd, 0, *size_return); + + i=0; + do { + ch= _getch(); + switch(ch) + { + case 0x00: + case 0xe0: _getch(); break; + + case '\b': return_pwd[i]= '\0'; + i -= (i>0) ? 1: 0; break; + + case '\n': + case '\r': break; + + default: if ( ch>0x00 && ch<0x7f && i<*size_return ) { return_pwd[i++]= ch; } + } + } while ( ch!='\r' && ch!='\n' ); + + return_pwd[*size_return-1]= '\0'; + (void) putchar('\n'); + + /* replace newline with null */ + if (ptr = strchr(return_pwd, '\n')) + *ptr = '\0'; + + if (prompt2) { + /* put out the prompt */ + (void) fputs(prompt2,stdout); + (void) fflush(stdout); + readin_string = malloc(*size_return); + if (!readin_string) { + (void) memset(return_pwd, 0, *size_return); + cleanup(ENOMEM); + } + (void) memset((char *)readin_string, 0, *size_return); + + i=0; + do { + ch= _getch(); + switch(ch) + { + case 0x00: + case 0xe0: _getch(); break; + + case '\b': return_pwd[i]= '\0'; + i -= (i>0) ? 1: 0; break; + + case '\n': + case '\r': break; + + default: if ( ch>0x00 && ch<0x7f && i<*size_return ) { return_pwd[i++]= ch; } + } + } while ( ch!='\r' && ch!='\n' ); + + return_pwd[*size_return-1]= '\0'; + (void) putchar('\n'); + + if (ptr = strchr((char *)readin_string, '\n')) + *ptr = '\0'; + + /* compare */ + if (strncmp(return_pwd, (char *)readin_string, *size_return)) { + (void) memset((char *)readin_string, 0, *size_return); + (void) memset(return_pwd, 0, *size_return); + krb5_xfree(readin_string); + cleanup(KRB5_LIBOS_BADPWDMATCH); + } + (void) memset((char *)readin_string, 0, *size_return); + krb5_xfree(readin_string); + } + + *size_return = strlen(return_pwd); + + return 0; } #endif /* !MSDOS */ diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/os/realm_dom.c krb5-sap/lib/krb5/os/realm_dom.c --- krb5-beta5/src/lib/krb5/os/realm_dom.c Fri Apr 21 20:59:31 1995 +++ krb5-sap/lib/krb5/os/realm_dom.c Sat Aug 19 00:57:36 1995 @@ -53,7 +53,7 @@ extern char *krb5_trans_file; -#ifdef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) /* * Windows DLL can't use the fscanf routine. We need fscanf to read * in the host and realm. Read_2str with read_1str duplicate the needed @@ -135,7 +135,7 @@ (void) sprintf(scanstring, "%%%ds %%%ds", sizeof(trans_host)-1,sizeof(trans_realm)-1); while (1) { -#ifdef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) scanval = read_2str (trans_file, trans_host, sizeof(trans_host)-1, trans_realm, sizeof(trans_realm)-1); #else diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/os/timeofday.c krb5-sap/lib/krb5/os/timeofday.c --- krb5-beta5/src/lib/krb5/os/timeofday.c Tue Mar 7 18:13:00 1995 +++ krb5-sap/lib/krb5/os/timeofday.c Wed Aug 9 23:53:28 1995 @@ -40,6 +40,7 @@ extern int errno; #endif + krb5_error_code INTERFACE krb5_timeofday(context, timeret) krb5_context context; diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/os/ustime.c krb5-sap/lib/krb5/os/ustime.c --- krb5-beta5/src/lib/krb5/os/ustime.c Tue Mar 28 21:46:28 1995 +++ krb5-sap/lib/krb5/os/ustime.c Wed Aug 9 23:53:12 1995 @@ -229,6 +229,7 @@ static time_t win_gettime (); static long win_time_get_epoch(); /* Adjust for MSC 7.00 bug */ + krb5_error_code INTERFACE krb5_us_timeofday(context, seconds, microseconds) krb5_context context; @@ -238,7 +239,7 @@ static krb5_int32 last_sec = 0; static krb5_int32 last_usec = 0; - sec = win_gettime (); /* Get the current time */ + sec = time(0); usec = 0; /* Can't do microseconds */ if (sec == last_sec) { /* Same as last time??? */ @@ -256,6 +257,8 @@ return 0; } + +#ifndef WIN32 static time_t win_gettime () { struct tm tm; @@ -292,12 +295,13 @@ tm.tm_yday = 0; tm.tm_isdst = now.dstflag; - time = mktime(&tm); - + time = mktime(&tm)-32400; + convert = win_time_get_epoch(); return time + convert; } +#endif /* * This routine figures out the current time epoch and returns the * conversion factor. It exists because @@ -310,13 +314,14 @@ static long epoch = 0; static int epoch_set = 0; + long win_time_get_epoch() { if (!epoch_set) { epoch = 0 - mktime (&jan_1_70); /* Seconds til 1970 localtime */ - epoch += _timezone; /* Seconds til 1970 GMT */ + epoch += _timezone; /* Seconds til 1970 GMT */ epoch_set = 1; } return epoch; Only in krb5-beta5/src/lib/krb5/posix: .cvsignore Only in krb5-beta5/src/lib/krb5/posix: ChangeLog Only in krb5-beta5/src/lib/krb5/posix: Makefile.in Only in krb5-sap/lib/krb5/posix: changelog Only in krb5-sap/lib/krb5/posix: makefile Only in krb5-sap/lib/krb5/posix: makefile.in diff -ru --exclude=^configure$ krb5-beta5/src/lib/krb5/posix/syslog.c krb5-sap/lib/krb5/posix/syslog.c --- krb5-beta5/src/lib/krb5/posix/syslog.c Thu Apr 13 20:55:52 1995 +++ krb5-sap/lib/krb5/posix/syslog.c Thu Aug 10 01:01:40 1995 @@ -33,7 +33,7 @@ * Modified to use UNIX domain IPC by Ralph Campbell */ -#ifndef _WINDOWS +#if !defined(_WINDOWS) && !defined(WIN32) #if defined(__STDC__) || defined(_WINDOWS) #include Only in krb5-beta5/src/lib/krb5/rcache: .cvsignore Only in krb5-beta5/src/lib/krb5/rcache: .rconf Only in krb5-beta5/src/lib/krb5/rcache: ChangeLog Only in krb5-beta5/src/lib/krb5/rcache: Makefile.in Only in krb5-beta5/src/lib/krb5/rcache: README Only in krb5-beta5/src/lib/krb5/rcache: RELEASE Only in krb5-sap/lib/krb5/rcache: changelog Only in krb5-sap/lib/krb5/rcache: makefile Only in krb5-sap/lib/krb5/rcache: makefile.in Only in krb5-sap/lib/krb5/rcache: readme Only in krb5-sap/lib/krb5/rcache: release Only in krb5-sap/lib: krb5-32.def Only in krb5-beta5/src/lib: krb5.saber.warnings Only in krb5-sap/lib: makefile Only in krb5-sap/lib: makefile.in diff -ru --exclude=^configure$ krb5-beta5/src/lib/win_glue.c krb5-sap/lib/win_glue.c --- krb5-beta5/src/lib/win_glue.c Thu Apr 20 16:01:40 1995 +++ krb5-sap/lib/win_glue.c Fri Aug 11 16:57:20 1995 @@ -35,6 +35,20 @@ return 0; } +#ifdef WIN32 + +BOOL APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReserved) +{ + win_socket_initialize (); + return 1; + UNREFERENCED_PARAMETER(hInst); + UNREFERENCED_PARAMETER(ul_reason_being_called); + UNREFERENCED_PARAMETER(lpReserved); +} + + +#else + BOOL CALLBACK LibMain (hInst, wDataSeg, cbHeap, CmdLine) HINSTANCE hInst; @@ -46,7 +60,13 @@ return 1; } +#endif + +#ifdef WIN32 +int APIENTRY +#else int CALLBACK __export +#endif WEP(nParam) int nParam; { Only in krb5-sap: makefile Only in krb5-sap: makefile.bak Only in krb5-sap: makefile.in Only in krb5-beta5/src: prototype Only in krb5-beta5/src: slave Only in krb5-beta5/src: tests Only in krb5-beta5/src/util: .cvsignore Only in krb5-beta5/src/util: ChangeLog Only in krb5-beta5/src/util: Makefile.in Only in krb5-beta5/src/util: Sanitize Only in krb5-beta5/src/util: autoconf Only in krb5-beta5/src/util: configure Only in krb5-beta5/src/util: configure.in Only in krb5-beta5/src/util: depfix.sed Only in krb5-beta5/src/util/et: .cvsignore Only in krb5-beta5/src/util/et: ChangeLog Only in krb5-beta5/src/util/et: Makefile.in Only in krb5-sap/util/et: changelog diff -ru --exclude=^configure$ krb5-beta5/src/util/et/com_err.c krb5-sap/util/et/com_err.c --- krb5-beta5/src/util/et/com_err.c Thu Apr 13 20:56:10 1995 +++ krb5-sap/util/et/com_err.c Sat Aug 19 01:06:28 1995 @@ -4,11 +4,12 @@ * For copyright info, see mit-sipb-copyright.h. */ +#include "k5-int.h" #include #include #include "mit-sipb-copyright.h" -#if defined(HAVE_STDARG_H) || defined(_WINDOWS) +#if defined(HAVE_STDARG_H) || defined(_WINDOWS) || defined(WIN32) #include #else #include @@ -35,14 +36,14 @@ * should fix up com_err.h so that it's safe to #include here * directly. */ -#if defined(__STDC__) || defined(_WINDOWS) +#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32) extern char const * INTERFACE error_message (long); #else extern char * INTERFACE error_message (); #endif static void -#if defined(__STDC__) || defined(_WINDOWS) +#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32) default_com_err_proc (const char *whoami, long code, const char *fmt, va_list args) #else default_com_err_proc (whoami, code, fmt, args) @@ -66,7 +67,7 @@ if (fmt) { vsprintf (errbuf + strlen (errbuf), fmt, args); } -#ifdef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) MessageBox (NULL, errbuf, "Kerboros", MB_ICONEXCLAMATION); #else fputs (errbuf, stderr); @@ -77,7 +78,7 @@ #endif } -#if defined(__STDC__) || defined(_WINDOWS) +#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32) typedef void (*errf) (const char *, long, const char *, va_list); #else typedef void (*errf) (); diff -ru --exclude=^configure$ krb5-beta5/src/util/et/com_err.h krb5-sap/util/et/com_err.h --- krb5-beta5/src/util/et/com_err.h Fri Apr 14 08:49:53 1995 +++ krb5-sap/util/et/com_err.h Mon Aug 21 11:28:02 1995 @@ -14,7 +14,7 @@ #ifndef HAVE_STDARG_H /* End-user programs may need this -- oh well */ -#if defined(__STDC__) || defined(_WINDOWS) +#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32) #define HAVE_STDARG_H 1 #endif #endif @@ -30,19 +30,29 @@ * come up with a better way of handling this problem. */ #ifndef INTERFACE -#ifdef _WINDOWS -#define INTERFACE __far __export __pascal -#define INTERFACE_C __far __export __cdecl +#if defined(_WINDOWS) && !defined(WIN32) +# define INTERFACE __far __export __pascal +# define INTERFACE_C __far __export __cdecl +# undef FAR +# define FAR __far #else -#define INTERFACE -#define INTERFACE_C +# ifdef WIN32 +# include +# define INTERFACE APIENTRY +# define INTERFACE_C APIENTRY +# undef FAR +# define FAR +# else +# define INTERFACE +# define INTERFACE_C +# undef FAR +# define FAR +# endif #endif #endif -#ifndef FAR -#define FAR -#endif -#if defined(__STDC__) || defined(_WINDOWS) + +#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32) /* ANSI C -- use prototypes etc */ extern void INTERFACE_C com_err (const char FAR *, long, const char FAR *, ...); extern char const FAR * INTERFACE error_message (long); @@ -60,4 +70,5 @@ #endif #define __COM_ERR_H + #endif /* ! defined(__COM_ERR_H) */ diff -ru --exclude=^configure$ krb5-beta5/src/util/et/compile_et.c krb5-sap/util/et/compile_et.c --- krb5-beta5/src/util/et/compile_et.c Thu Apr 13 20:56:11 1995 +++ krb5-sap/util/et/compile_et.c Sat Aug 19 01:06:54 1995 @@ -76,7 +76,7 @@ }; static const char * const krc_src_prolog[] = { - "#if defined(__STDC__) || defined(_WINDOWS)\n", + "#if defined(__STDC__) || defined(_WINDOWS) || defined(WIN32)\n", "#define NOARGS void\n", "#else\n", "#define NOARGS\n", diff -ru --exclude=^configure$ krb5-beta5/src/util/et/error_table.h krb5-sap/util/et/error_table.h --- krb5-beta5/src/util/et/error_table.h Thu Apr 13 20:56:12 1995 +++ krb5-sap/util/et/error_table.h Mon Aug 21 11:29:20 1995 @@ -12,17 +12,27 @@ place here what is needed from that file. Later we may decide to do it differently. */ -#ifdef _WINDOWS -#define INTERFACE __far __export __pascal -#define INTERFACE_C __far __export __cdecl -#define sys_nerr _sys_nerr -#define sys_errlist _sys_errlist -int __far __pascal MessageBox (void __far *, const char __far*, const char __far*, unsigned int); -#define MB_ICONEXCLAMATION 0x0030 +#if defined(_WINDOWS) && !defined(WIN32) +# define INTERFACE __far __export __pascal +# define INTERFACE_C __far __export __cdecl + int __far __pascal MessageBox (void __far *, const char __far*, const char __far*, unsigned int); +# define MB_ICONEXCLAMATION 0x0030 +# define sys_nerr _sys_nerr +# define sys_errlist _sys_errlist #else -#define INTERFACE -#define INTERFACE_C -extern int errno; +# if defined(WIN32) +# ifndef INTERFACE +# include +# define INTERFACE APIENTRY +# define INTERFACE_C APIENTRY +# endif +# define sys_nerr _sys_nerr +# define sys_errlist _sys_errlist +# else +# define INTERFACE +# define INTERFACE_C + extern int errno; +# endif #endif struct error_table { @@ -39,7 +49,7 @@ #define ERRCODE_RANGE 8 /* # of bits to shift table number */ #define BITS_PER_CHAR 6 /* # bits to shift per character in name */ -#if defined(__STDC__) || defined(KRB5_PROVIDE_PROTOTYPES) || defined(_WINDOWS) +#if defined(__STDC__) || defined(KRB5_PROVIDE_PROTOTYPES) || defined(_WINDOWS) || defined(WIN32) extern const char *error_table_name (long); #else extern const char *error_table_name (); Only in krb5-sap/util/et: makefile Only in krb5-sap/util/et: makefile.in Only in krb5-beta5/src/util: kbuild Only in krb5-beta5/src/util: kfrags Only in krb5-beta5/src/util: libupdate.sh Only in krb5-beta5/src/util: lndir Only in krb5-beta5/src/util: makedepend Only in krb5-beta5/src/util/profile: .cvsignore Only in krb5-beta5/src/util/profile: ChangeLog Only in krb5-beta5/src/util/profile: Makefile.in Only in krb5-sap/util/profile: changelog Only in krb5-sap/util/profile: makefile Only in krb5-sap/util/profile: makefile.in Only in krb5-sap/util/profile: prof_err.c Only in krb5-sap/util/profile: prof_err.h diff -ru --exclude=^configure$ krb5-beta5/src/util/profile/prof_file.c krb5-sap/util/profile/prof_file.c --- krb5-beta5/src/util/profile/prof_file.c Thu Apr 27 14:08:20 1995 +++ krb5-sap/util/profile/prof_file.c Fri Aug 18 22:24:20 1995 @@ -11,7 +11,7 @@ #include "prof_int.h" -#ifdef _WINDOWS +#if defined(_WINDOWS) || defined(WIN32) #define stat _stat #endif diff -ru --exclude=^configure$ krb5-beta5/src/util/profile/prof_parse.c krb5-sap/util/profile/prof_parse.c --- krb5-beta5/src/util/profile/prof_parse.c Fri Apr 28 15:58:06 1995 +++ krb5-sap/util/profile/prof_parse.c Sat Aug 19 01:08:28 1995 @@ -194,7 +194,7 @@ return 0; } -#ifndef _WINDOWS +#if !defined(_WINDOWS) && !defined(WIN32) void dump_profile(root, level) struct profile_node *root; Only in krb5-sap/util/profile: profile.h Only in krb5-beta5/src/util: reconf Only in krb5-beta5/src/util: ss Only in krb5-beta5/src/util: unifdef diff -ru --exclude=^configure$ krb5-beta5/src/windows/cns/cns.c krb5-sap/windows/cns/cns.c --- krb5-beta5/src/windows/cns/cns.c Thu Apr 27 17:00:31 1995 +++ krb5-sap/windows/cns/cns.c Mon Aug 21 16:26:32 1995 @@ -16,6 +16,10 @@ #define KRB5 1 #endif +#include +#ifdef WIN32 +# define __export +#endif #include #include #include @@ -112,7 +116,7 @@ return FALSE; } - rc = (BOOL) PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); + rc = (BOOL) PeekMessage(&msg, (HWND)NULL, (UINT)0, (UINT)0, (UINT)PM_REMOVE); if (!rc) return FALSE; @@ -254,7 +258,7 @@ hwnd = GetWindow(hwnd, GW_CHILD); while (hwnd != NULL) { - SendMessage(hwnd, WM_SETFONT, (WPARAM) hfont, 0); + SendMessage(hwnd, WM_SETFONT, (WPARAM) hfont, (LPARAM)0); hwnd = GetWindow(hwnd, GW_HWNDNEXT); } @@ -301,11 +305,21 @@ { static struct tm jan_1_70 = {0, 0, 0, 1, 0, 70}; time_t epoch = 0; +#ifdef WIN32 + struct tm *mtm; + time_t long_time; + time(&long_time); + mtm= localtime(&long_time); epoch = -mktime(&jan_1_70); /* Seconds til 1970 localtime */ epoch += _timezone; /* Seconds til 1970 GMT */ - - return epoch; + if ( mtm->tm_isdst>0 ) + epoch += 3600; +#else + epoch = -mktime(&jan_1_70); /* Seconds til 1970 localtime */ + epoch += _timezone; /* Seconds til 1970 GMT */ +#endif + return epoch; } /* kwin_get_epoch */ @@ -570,7 +584,7 @@ strlen(newpw1) && strlen(newpw2); EnableWindow(GetDlgItem(hwnd, IDOK), b); id = (b) ? IDOK : IDD_PASSWORD_CR; - SendMessage(hwnd, DM_SETDEFID, id, 0); + SendMessage(hwnd, DM_SETDEFID, (WPARAM)id, (LPARAM)0); return FALSE; } @@ -596,7 +610,7 @@ SetDlgItemText(hwnd, IDD_NEW_PASSWORD1, ""); SetDlgItemText(hwnd, IDD_NEW_PASSWORD2, ""); PostMessage(hwnd, WM_NEXTDLGCTL, - GetDlgItem(hwnd, IDD_NEW_PASSWORD1), MAKELONG(1, 0)); + (WPARAM) GetDlgItem(hwnd, IDD_NEW_PASSWORD1), MAKELONG(1, 0)); return TRUE; } @@ -608,7 +622,7 @@ EndDialog(hwnd, IDOK); else PostMessage(hwnd, WM_NEXTDLGCTL, - GetDlgItem(hwnd, IDD_OLD_PASSWORD), MAKELONG(1, 0)); + (WPARAM)GetDlgItem(hwnd, IDD_OLD_PASSWORD), MAKELONG(1, 0)); end_blocking_hook(); SetCursor(hcursor); @@ -628,9 +642,9 @@ if (id == IDD_NEW_PASSWORD2) PostMessage(hwnd, WM_NEXTDLGCTL, - GetDlgItem(hwnd, IDD_PASSWORD_NAME), MAKELONG(1, 0)); + (WPARAM)GetDlgItem(hwnd, IDD_PASSWORD_NAME), MAKELONG(1, 0)); else - PostMessage(hwnd, WM_NEXTDLGCTL, 0, 0); + PostMessage(hwnd, WM_NEXTDLGCTL, (WPARAM)0, (LPARAM)0); return TRUE; @@ -732,7 +746,7 @@ return password_initdialog(hwnd, wparam, lparam); case WM_COMMAND: - password_command(hwnd, wparam, lparam); + rc= password_command(hwnd, wparam, lparam); return (BOOL) rc; case WM_SETCURSOR: @@ -850,11 +864,11 @@ GetPrivateProfileString(INI_EXPIRATION, INI_ALERT, "No", defname, sizeof(defname), KERBEROS_INI); alert = _stricmp(defname, "Yes") == 0; - SendDlgItemMessage(hwnd, IDD_ALERT, BM_SETCHECK, alert, 0); + SendDlgItemMessage(hwnd, IDD_ALERT, BM_SETCHECK, (WPARAM)alert, (LPARAM)0); GetPrivateProfileString(INI_EXPIRATION, INI_BEEP, "No", defname, sizeof(defname), KERBEROS_INI); beep = _stricmp(defname, "Yes") == 0; - SendDlgItemMessage(hwnd, IDD_BEEP, BM_SETCHECK, beep, 0); + SendDlgItemMessage(hwnd, IDD_BEEP, BM_SETCHECK, (WPARAM)beep, (LPARAM)0); return TRUE; @@ -1373,7 +1387,7 @@ hwnditem = GetDlgItem(hwnd, IDD_LOGIN_PASSWORD); } - PostMessage(hwnd, WM_NEXTDLGCTL, hwnditem, MAKELONG(1, 0)); + PostMessage(hwnd, WM_NEXTDLGCTL, (WPARAM)hwnditem, MAKELONG(1, 0)); } /* kwin_set_default_focus */ @@ -1917,6 +1931,7 @@ int id; #ifdef KRB4 char instance[INST_SZ]; + int lifetime; int krc; #endif @@ -1929,6 +1944,14 @@ krb5_int32 sec, usec; #endif + int menupoint; + +#ifdef WIN32 + menupoint= LOWORD(wparam); +#else + menupoint= wparam; +#endif + #ifdef KRB4 EnableWindow(GetDlgItem(hwnd, IDD_TICKET_DELETE), krb_get_num_cred() > 0); #endif @@ -1954,19 +1977,23 @@ EnableWindow(GetDlgItem(hwnd, IDD_LOGIN), blogin); id = (blogin) ? IDD_LOGIN : IDD_PASSWORD_CR2; - SendMessage(hwnd, DM_SETDEFID, id, 0); + SendMessage(hwnd, DM_SETDEFID, (WPARAM)id, (LPARAM)0); - if (HIWORD(lparam) != BN_CLICKED && HIWORD(lparam) != 0 && HIWORD(lparam) != 1) +#ifdef WIN32 + if (HIWORD(wparam) != BN_CLICKED && HIWORD(wparam) != 0 && HIWORD(wparam) != 1) +#else + if (HIWORD(lparam) != BN_CLICKED && HIWORD(lparam) != 0 && HIWORD(lparam) != 1) +#endif return FALSE; - if (wparam >= IDM_FIRST_LOGIN && wparam < IDM_FIRST_LOGIN + FILE_MENU_MAX_LOGINS) { + if (menupoint >= IDM_FIRST_LOGIN && menupoint < IDM_FIRST_LOGIN + FILE_MENU_MAX_LOGINS) { hmenu = GetMenu(hwnd); assert(hmenu != NULL); hmenu = GetSubMenu(hmenu, 0); assert(hmenu != NULL); - if (!GetMenuString(hmenu, wparam, menuitem, sizeof(menuitem), MF_BYCOMMAND)) + if (!GetMenuString(hmenu, menupoint, menuitem, sizeof(menuitem), MF_BYCOMMAND)) return TRUE; if (menuitem[0]) @@ -1975,7 +2002,7 @@ return TRUE; } - switch (wparam) { + switch (menupoint) { case IDM_EXIT: if (isblocking) WSACancelBlockingCall(); @@ -1990,7 +2017,7 @@ if (id == IDD_MAX_EDIT) PostMessage(hwnd, WM_NEXTDLGCTL, - GetDlgItem(hwnd, IDD_MIN_EDIT), MAKELONG(1, 0)); + (WPARAM)GetDlgItem(hwnd, IDD_MIN_EDIT), MAKELONG(1, 0)); else PostMessage(hwnd, WM_NEXTDLGCTL, 0, 0); @@ -2093,7 +2120,7 @@ switch (action) { case LOGIN_AND_EXIT: - SendMessage(hwnd, WM_COMMAND, IDM_EXIT, 0); + SendMessage(hwnd, WM_COMMAND, (WPARAM)IDM_EXIT, (LPARAM)0); break; case LOGIN_AND_MINIMIZE: @@ -2191,7 +2218,7 @@ kwin_set_default_focus(hwnd); if ((wparam & 0xFFF0) == SC_CLOSE) { - SendMessage(hwnd, WM_COMMAND, IDM_EXIT, 0); + SendMessage(hwnd, WM_COMMAND, (WPARAM)IDM_EXIT, (LPARAM)0); return 0; } @@ -2282,7 +2309,7 @@ hdc = BeginPaint(hwnd, &ps); GetClientRect(hwnd, &r); - DefWindowProc(hwnd, WM_ICONERASEBKGND, hdc, 0); + DefWindowProc(hwnd, WM_ICONERASEBKGND, (WPARAM)hdc, (LPARAM)0); if (expiration == 0) { strcpy(buf, KWIN_DIALOG_NAME); @@ -2673,6 +2700,8 @@ char buf[MAX_K_NAME_SZ + 9]; char name[MAX_K_NAME_SZ]; + _putenv("TZ=MEZ-1MESZ"); + _tzset(); strcpy(buf, cmdline); action = LOGIN_AND_RUN; name[0] = 0; @@ -2700,9 +2729,13 @@ hwnd = FindWindow(KWIN_DIALOG_CLASS, NULL); if (IsWindow(hwnd) && IsWindowVisible(hwnd)) { +#ifdef WIN32 + if (GetWindowLong(hwnd, GWL_HINSTANCE) == (LONG)hprevinstance) { +#else if (GetWindowWord(hwnd, GWW_HINSTANCE) == hprevinstance) { +#endif if (name[0]) - SendMessage(hwnd, WM_KWIN_SETNAME, 0, (LONG) name); + SendMessage(hwnd, WM_KWIN_SETNAME, (WPARAM)0, (LPARAM) name); ShowWindow(hwnd, ncmdshow); SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, @@ -2735,7 +2768,7 @@ haccel = LoadAccelerators(hinstance, MAKEINTRESOURCE(IDA_KWIN)); assert(hwnd != NULL); - while (GetMessage(&msg, NULL, 0, 0)) { + while (GetMessage(&msg, (HWND)NULL, (UINT)0, (UINT)0)) { if (!TranslateAccelerator(hwnd, haccel, &msg) && !IsDialogMessage(hwnd, &msg)) { TranslateMessage(&msg); diff -ru --exclude=^configure$ krb5-beta5/src/windows/cns/cns.rc krb5-sap/windows/cns/cns.rc --- krb5-beta5/src/windows/cns/cns.rc Thu Apr 27 17:00:33 1995 +++ krb5-sap/windows/cns/cns.rc Fri Aug 11 23:39:28 1995 @@ -65,7 +65,7 @@ CONTROL "&Realm", IDD_LOGIN_REALM_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 184, 69, 26, 8 CONTROL "", IDD_LOGIN_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 6, 79, 84, 12 CONTROL "", IDD_LOGIN_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 95, 79, 84, 12 - CONTROL "", IDD_LOGIN_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_UPPERCASE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 184, 79, 84, 12 + CONTROL "", IDD_LOGIN_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_UPPERCASE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 184, 79, 84, 12 #endif CONTROL "&Change Password...", IDD_CHANGE_PASSWORD, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 6, 96, 74, 14 CONTROL "&Delete", IDD_TICKET_DELETE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 122, 96, 52, 14 diff -ru --exclude=^configure$ krb5-beta5/src/windows/cns/makefile krb5-sap/windows/cns/makefile --- krb5-beta5/src/windows/cns/makefile Tue Apr 18 19:23:13 1995 +++ krb5-sap/windows/cns/makefile Mon Aug 21 16:12:42 1995 @@ -29,8 +29,16 @@ ##### C Compiler CC = cl -CFLAGS_RELEASE = /f- /nologo /W3 /AL /GAs /G2 /Zp /O2 /DNDEBUG=1 -CFLAGS_DEBUG = /f /nologo /W3 /AL /GAs /G2 /Zp /O2 /Od /Zi +!if "$(CPU)" == "i386" +# WIN32 Visual C++ 2.x +CFLAGS_RELEASE = /nologo /W3 /O2 /D NDEBUG /D "WIN32" /D "_WINDOWS" /D "_MSDOS" +CFLAGS_DEBUG = /nologo /W3 /Zi /Od /D _DEBUG /D "WIN32" /D "_WINDOWS" /D "_MSDOS" /Fd"CNS.PDB" +!else +# WIN16 Visual C++ 1.5x +CFLAGS_RELEASE = /nologo /W3 /AL /GAs /Gx /O1 /DNDEBUG +CFLAGS_DEBUG = /nologo /W3 /AL /GAs /Gx /G2 /Zi /Od /D_DEBUG /Fd"CNS.PDB" +!endif + !if $(DEBUG) CFLAGS = $(CFLAGS_DEBUG) $(INCLUDES) /D$(KRB)=1 !else @@ -39,23 +47,41 @@ ##### RC Compiler RC = rc -RFLAGS = /nologo /D$(KRB)=1 $(INCLUDES) +RFLAGS = /D$(KRB)=1 $(INCLUDES) ##### Linker LINK = link + +!if "$(CPU)" == "i386" +# WIN32 +KLIB = ../../lib/krb5-32.lib +LIBS = $(KLIB) +SYSLIBS = /NODEFAULTLIB libc.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib wsock32.lib +LFLAGS_DEBUG = /debugtype:cv /debug:full +LFLAGS_RELEASE = /debug:none +LINK_ARGS = $(OBJS) $*.res /OUT:$@ $(LIBS) $(SYSLIBS) +!else +# WIN16 LIBS = $(KLIB) $(WLIB) SYSLIBS = libw llibcew +LFLAGS_DEBUG = /co /nologo /nod /nopackcode /map:full +LFLAGS_RELEASE = /nologo /nod /nopackcode +RC_WORK = $(RC) $(RFLAGS) /k $*.res $@ +LINK_ARGS = $(OBJS), $@, $*.map, $(LIBS) $(SYSLIBS), $*.def +!endif + !if $(DEBUG) -LFLAGS = /co /nologo /nod /nopackcode /map:full +LFLAGS= $(LFLAGS_DEBUG) !else -LFLAGS = /nologo /nod /nopackcode +LFLAGS= $(LFLAGS_RELEASE) !endif + all:: makefile $(NAME).exe $(NAME).exe: $*.def $*.res $(OBJS) $(LIBS) - $(LINK) $(LFLAGS) $(OBJS), $@, $*.map, $(LIBS) $(SYSLIBS), $*.def - $(RC) $(RFLAGS) /k $*.res $@ + $(LINK) $(LFLAGS) $(LINK_ARGS) + $(RC_WORK) $(OBJS) cns.res: cns.h tktlist.h diff -ru --exclude=^configure$ krb5-beta5/src/windows/cns/tktlist.c krb5-sap/windows/cns/tktlist.c --- krb5-beta5/src/windows/cns/tktlist.c Thu Apr 20 16:01:50 1995 +++ krb5-sap/windows/cns/tktlist.c Mon Aug 14 20:24:52 1995 @@ -26,6 +26,7 @@ #endif #ifdef KRB5 + #include "k5-int.h" #include "winsock.h" #include "krb5.h" #include "com_err.h" @@ -391,7 +392,16 @@ /* * Display centered string */ +#ifdef WIN32 + { + SIZE size; + + GetTextExtentPoint(lpdi->hDC, "X", 1, &size); + textheight= size.cy; + } +#else textheight = HIWORD(GetTextExtent(lpdi->hDC, "X", 1)); +#endif alignment = SetTextAlign(lpdi->hDC, TA_TOP | TA_LEFT); if (lpinfo->ticket) Only in krb5-beta5/src/windows/gss: gss-clie.c Only in krb5-sap/windows/gss: gss-client.c diff -ru --exclude=^configure$ krb5-beta5/src/windows/gss/gss.c krb5-sap/windows/gss/gss.c --- krb5-beta5/src/windows/gss/gss.c Fri Apr 28 20:09:02 1995 +++ krb5-sap/windows/gss/gss.c Mon Aug 21 19:59:04 1995 @@ -60,13 +60,21 @@ ** Does the actual call to GSS-client ** ***************************************************************************/ +#include void do_gssapi_test (char *name) { int n; // Return value HCURSOR hcursor; // For the hourglass cursor + char *nix; + long tz; parse_name(name); // Get host, service and port + _putenv("TZ=MEZ-1MESZ"); + _tzset(); + nix= _tzname[0]; + tz= _timezone; + hcursor = SetCursor(LoadCursor(NULL, IDC_WAIT)); n = gss (szHost, szServiceName, "Test Gssapi Message", port); SetCursor(hcursor); @@ -95,7 +103,8 @@ { HDC hDC; // For getting graphic info DWORD Ext; // Size of dialog - int xExt, yExt; // Size broken apart + int xExt, yExt; + int id; // Size broken apart char hostname[128]; // What the user typed switch (message) { @@ -116,11 +125,16 @@ read_hosts (); // Get the host list fill_combo (hDlg); // Put into combo box - SendMessage(hDlg, WM_SETFOCUS, NULL, NULL); + SendMessage(hDlg, WM_SETFOCUS, (WPARAM)NULL, (LPARAM)NULL); return (TRUE); case WM_COMMAND: - switch (wParam) { +#ifdef WIN32 + id= LOWORD(wParam); +#else + id= wParam; +#endif + switch (id) { case GSS_CANCEL: // Only way out of the dialog case IDCANCEL: // From the menu EndDialog(hDlg, FALSE); @@ -129,7 +143,7 @@ case GSS_OK: GetDlgItemText(hDlg, GSS_CONNECT_NAME, hostname, 128); SendDlgItemMessage(hDlg, GSS_CONNECT_NAME, CB_SHOWDROPDOWN, - FALSE, NULL); + (WPARAM)FALSE, (LPARAM)NULL); if (! *hostname) { MessageBox(hDlg, "You must enter a host name", @@ -167,7 +181,7 @@ port = atoi (ptr+1); *ptr = '\0'; } - wsprintf (szServiceName, "host@%s", szHost); // Make the service name + wsprintf (szServiceName, "sample@%s", szHost); // Make the service name } /*+************************************************************************* ** @@ -243,15 +257,15 @@ fill_combo (HWND hDlg) { int i; // Index - SendDlgItemMessage(hDlg, GSS_CONNECT_NAME, CB_RESETCONTENT, NULL, NULL); + SendDlgItemMessage(hDlg, GSS_CONNECT_NAME, CB_RESETCONTENT, (WPARAM)NULL, (LPARAM)NULL); SetDlgItemText(hDlg, GSS_CONNECT_NAME, hosts[0]); - SendDlgItemMessage(hDlg, GSS_CONNECT_NAME, CB_SETEDITSEL, NULL, NULL); + SendDlgItemMessage(hDlg, GSS_CONNECT_NAME, CB_SETEDITSEL, (WPARAM)NULL, (LPARAM)NULL); for (i = 1; i < MAX_HOSTS; ++i) { // Fill in the list box if (*hosts[i] == '\0') break; - SendDlgItemMessage(hDlg, GSS_CONNECT_NAME, CB_ADDSTRING, 0, + SendDlgItemMessage(hDlg, GSS_CONNECT_NAME, CB_ADDSTRING, (WPARAM)0, (LPARAM) ((LPSTR) hosts[i])); } } diff -ru --exclude=^configure$ krb5-beta5/src/windows/gss/makefile krb5-sap/windows/gss/makefile --- krb5-beta5/src/windows/gss/makefile Fri Apr 28 14:34:37 1995 +++ krb5-sap/windows/gss/makefile Mon Aug 21 19:46:06 1995 @@ -14,8 +14,16 @@ ##### C Compiler CC = cl +!if "$(CPU)" == "i386" +# WIN32 Visual C++ 2.x +CFLAGS_RELEASE = /nologo /W3 /O2 /D NDEBUG /D "WIN32" /D "_WINDOWS" /D "_MSDOS" +CFLAGS_DEBUG = /nologo /W3 /Zi /Od /D _DEBUG /D "WIN32" /D "_WINDOWS" /D "_MSDOS" +!else +# WIN16 Visual C++ 1.5x CFLAGS_RELEASE = /nologo /W3 /AL /GAs /Gy /G2 /Zp /O2 /DNDEBUG=1 CFLAGS_DEBUG = /nologo /W3 /AL /GAs /Gy /G2 /Zp /O2 /Od /Zi +!endif + !if $(DEBUG) CFLAGS = $(CFLAGS_DEBUG) $(INCLUDES) !else @@ -24,23 +32,40 @@ ##### RC Compiler RC = rc -RFLAGS = /nologo $(INCLUDES) +RFLAGS = $(INCLUDES) ##### Linker LINK = link -LIBS = $(GLIB) $(WLIB) -SYSLIBS = libw llibcew +!if "$(CPU)" == "i386" +# WIN32 +GLIB = ../../lib/gssapi.lib +LIBS = $(GLIB) +SYSLIBS = /NODEFAULTLIB libc.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib wsock32.lib +LFLAGS_DEBUG = /debugtype:cv /debug:full +LFLAGS_RELEASE = /debug:none +RC_WORK = +LINK_ARGS = $(OBJS) $(XOBJS) $*.res /OUT:$@ $(LIBS) $(SYSLIBS) +!else +# WIN16 +LIBS = $(GLIB) $(WLIB) +SYSLIBS = libw llibcew +LFLAGS_DEBUG = /co /nologo /nod /nopackcode /map:full +LFLAGS_RELEASE = /nologo /nod /nopackcode +RC_WORK = $(RC) $(RFLAGS) /k $*.res $@ +LINK_ARGS = $(OBJS), $@, $*.map, $(LIBS) $(SYSLIBS), $*.def +!endif + !if $(DEBUG) -LFLAGS = /co /nologo /nod /nopackcode /map:full +LFLAGS = $(LFLAGS_DEBUG) !else -LFLAGS = /nologo /nod /nopackcode +LFLAGS = $(LFLAGS_RELEASE) !endif all:: makefile $(NAME).exe $(NAME).exe: $*.def $*.res $(OBJS) $(LIBS) - $(LINK) $(LFLAGS) $(OBJS), $@, $*.map, $(LIBS) $(SYSLIBS), $*.def - $(RC) $(RFLAGS) /k $*.res $@ + $(LINK) $(LFLAGS) $(LINK_ARGS) + $(RC_WORK) $(OBJS) $(NAME).res: gss.h diff -ru --exclude=^configure$ krb5-beta5/src/windows/wintel/auth.c krb5-sap/windows/wintel/auth.c --- krb5-beta5/src/windows/wintel/auth.c Fri Mar 31 19:55:42 1995 +++ krb5-sap/windows/wintel/auth.c Mon Aug 14 19:10:36 1995 @@ -628,18 +628,22 @@ static int k5_auth_reply (int how, unsigned char *data, int cnt) { static int mutual_complete = 0; + char buffer[512]; data += 4; /* Point to status byte */ switch (*data++) { case K5_REJECT: - if (cnt > 0) - wsprintf (strTmp, - "Kerberos V5 refuses authentication because %.*s", - cnt, data); + strncpy(buffer, data, cnt); + buffer[cnt]= '\0'; + if (cnt > 0) + wsprintf (strTmp, + "Kerberos V5 refuses authentication because %s", + buffer); else wsprintf (strTmp, "Kerberos V5 refuses authentication"); - MessageBox (HWND_DESKTOP, strTmp, "", MB_OK | MB_ICONEXCLAMATION); + + MessageBox (HWND_DESKTOP, strTmp, "", MB_OK | MB_ICONEXCLAMATION); return KFAILURE; diff -ru --exclude=^configure$ krb5-beta5/src/windows/wintel/emul.c krb5-sap/windows/wintel/emul.c --- krb5-beta5/src/windows/wintel/emul.c Thu Apr 27 16:14:11 1995 +++ krb5-sap/windows/wintel/emul.c Mon Aug 21 13:22:12 1995 @@ -386,7 +386,7 @@ pScr->y = pScr->top; ScreenRange(pScr); escflg = 0; - SendMessage(pScr->hWnd, WM_PAINT, NULL, NULL); + SendMessage(pScr->hWnd, WM_PAINT, (WPARAM)NULL, (LPARAM)NULL); break; case 'B': /* cursor down (CUD) */ @@ -403,7 +403,7 @@ pScr->y = pScr->bottom; ScreenRange(pScr); escflg = 0; - SendMessage(pScr->hWnd, WM_PAINT, NULL, NULL); + SendMessage(pScr->hWnd, WM_PAINT, (WPARAM)NULL, (LPARAM)NULL); break; case 'C': /* cursor forward (right) (CUF) */ @@ -420,7 +420,7 @@ if (pScr->x > pScr->width) pScr->x = pScr->width; escflg = 0; - SendMessage(pScr->hWnd, WM_PAINT, NULL, NULL); + SendMessage(pScr->hWnd, WM_PAINT, (WPARAM)NULL, (LPARAM)NULL); break; case 'D': /* cursor backward (left) (CUB) */ @@ -435,7 +435,7 @@ pScr->x -= pScr->parms[0]; ScreenRange(pScr); escflg = 0; - SendMessage(pScr->hWnd, WM_PAINT, NULL, NULL); + SendMessage(pScr->hWnd, WM_PAINT, (WPARAM)NULL, (LPARAM)NULL); break; case 'f': /* horizontal & vertical position (HVP) */ @@ -449,7 +449,7 @@ pScr->y = pScr->parms[0] - 1; ScreenRange(pScr); /* make certain the cursor position is valid */ escflg = 0; - SendMessage(pScr->hWnd, WM_PAINT, NULL, NULL); + SendMessage(pScr->hWnd, WM_PAINT, (WPARAM)NULL, (LPARAM)NULL); break; case 'J': /* erase in display (ED) */ @@ -585,7 +585,7 @@ case 6: /* send active position */ wsprintf(stat, "\033[%d;%dR", pScr->y, pScr->x); for (i = 0; stat[i]; i++) - SendMessage(pScr->hwndTel, WM_MYSCREENCHAR, stat[i], (LPARAM) pScr); + SendMessage(pScr->hwndTel, WM_MYSCREENCHAR, (WPARAM)stat[i], (LPARAM) pScr); break; } /* end switch */ escflg = 0; diff -ru --exclude=^configure$ krb5-beta5/src/windows/wintel/intern.c krb5-sap/windows/wintel/intern.c --- krb5-beta5/src/windows/wintel/intern.c Thu Apr 27 16:14:14 1995 +++ krb5-sap/windows/wintel/intern.c Mon Aug 21 13:19:44 1995 @@ -533,7 +533,7 @@ rc.top = pScr->cyChar * y1; rc.bottom = pScr->cyChar * (y1+1); InvalidateRect(pScr->hWnd, &rc, TRUE); - SendMessage(pScr->hWnd, WM_PAINT, NULL, NULL); + SendMessage(pScr->hWnd, WM_PAINT, (WPARAM)NULL, (LPARAM)NULL); } /* ScreenEraseLine */ @@ -731,7 +731,7 @@ rc.top = pScr->cyChar * (pScr->y - 1); rc.bottom = pScr->cyChar * pScr->y; InvalidateRect(pScr->hWnd, &rc, TRUE); - SendMessage(pScr->hWnd, WM_PAINT, NULL, NULL); + SendMessage(pScr->hWnd, WM_PAINT, (WPARAM)NULL, (LPARAM)NULL); } /* ScreenInsChar */ @@ -762,7 +762,7 @@ rc.bottom = pScr->cyChar * (pScr->y + 1); InvalidateRect(pScr->hWnd, &rc, TRUE); - SendMessage(pScr->hWnd, WM_PAINT, NULL, NULL); + SendMessage(pScr->hWnd, WM_PAINT, (WPARAM)NULL, (LPARAM)NULL); } /* ScreenInsString */ @@ -812,7 +812,7 @@ rc.top = pScr->cyChar * pScr->y; rc.bottom = pScr->cyChar * (pScr->y + 1); InvalidateRect(pScr->hWnd, &rc, TRUE); - SendMessage(pScr->hWnd, WM_PAINT, NULL, NULL); + SendMessage(pScr->hWnd, WM_PAINT, (WPARAM)NULL, (LPARAM)NULL); } /* ScreenDraw */ diff -ru --exclude=^configure$ krb5-beta5/src/windows/wintel/makefile krb5-sap/windows/wintel/makefile --- krb5-beta5/src/windows/wintel/makefile Mon Mar 27 23:51:36 1995 +++ krb5-sap/windows/wintel/makefile Mon Aug 21 19:40:10 1995 @@ -33,8 +33,16 @@ ##### C Compiler CC = cl +!if "$(CPU)" == "i386" +# WIN32 Visual C++ 2.x +CFLAGS_RELEASE = /nologo /W3 /O2 /D NDEBUG /D "WIN32" /D "_WINDOWS" /D "_MSDOS" +CFLAGS_DEBUG = /nologo /W3 /Zi /Od /D _DEBUG /D "WIN32" /D "_WINDOWS" /D "_MSDOS" /Fd"TELNET.PDB" +!else +# WIN16 Visual C++ 1.5x CFLAGS_RELEASE = /nologo /W3 /AL /GAs /Gx /O1 /DNDEBUG -CFLAGS_DEBUG = /nologo /W3 /AL /GAs /Gx /G2 /Zi /Od /D_DEBUG /Fd"TELNET.PDB" +CFLAGS_DEBUG = /nologo /W3 /AL /GAs /Gx /G2 /Zi /Od /D_DEBUG /Fd"TELNET.PDB" +!endif + !if $(DEBUG) CFLAGS = $(CFLAGS_DEBUG) $(INCLUDES) /D$(KRB)=1 !else @@ -43,8 +51,8 @@ ##### RC Compiler RC = rc -RFLAGS_RELEASE = /nologo -RFLAGS_DEBUG = /nologo /D_DEBUG +RFLAGS_RELEASE = +RFLAGS_DEBUG = /D_DEBUG !if $(DEBUG) RFLAGS = $(RFLAGS_DEBUG) $(INCLUDES) !else @@ -53,20 +61,37 @@ ##### Linker LINK = link + +!if "$(CPU)" == "i386" +# WIN32 +KLIB = ../../lib/krb5-32.lib +LIBS = $(KLIB) +SYSLIBS = /NODEFAULTLIB libc.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib wsock32.lib +LFLAGS_DEBUG = /debugtype:cv /debug:full +LFLAGS_RELEASE = /debug:none +RC_WORK = +LINK_ARGS = $(OBJS) $(XOBJS) $*.res /OUT:$@ $(LIBS) $(SYSLIBS) +!else +# WIN16 LIBS = $(KLIB) $(WLIB) SYSLIBS = libw llibcew commdlg +LFLAGS_DEBUG = /co /nol /nod /packc:61440 /stack:32768 /align:16 /onerror:noexe +LFLAGS_RELEASE = /nol /nod /packc:61440 /stack:32768 /align:16 /onerror:noexe +RC_WORK = $(RC) $(RFLAGS) /k $*.res $@ +LINK_ARGS = $(OBJS) $(XOBJS), $@, $*.map, $(LIBS) $(SYSLIBS), $*.def +!endif + !if $(DEBUG) -LFLAGS = /co /nol /nod /packc:61440 /stack:32768 /align:16 /onerror:noexe +LFLAGS= $(LFLAGS_DEBUG) !else -LFLAGS = /nol /nod /packc:61440 /stack:32768 /align:16 /onerror:noexe +LFLAGS= $(LFLAGS_RELEASE) !endif all: makefile $(NAME).exe $(NAME).exe: $*.def $*.res $(OBJS) $(XOBJS) $(LIBS) - $(LINK) $(LFLAGS) $(OBJS) $(XOBJS), $@, $*.map, \ - $(LIBS) $(SYSLIBS), $*.def - $(RC) $(RFLAGS) /k $*.res $@ + $(LINK) $(LFLAGS) $(LINK_ARGS) + install: copy telnet.exe ..\floppy diff -ru --exclude=^configure$ krb5-beta5/src/windows/wintel/screen.c krb5-sap/windows/wintel/screen.c --- krb5-beta5/src/windows/wintel/screen.c Thu Apr 27 16:14:15 1995 +++ krb5-sap/windows/wintel/screen.c Mon Aug 21 13:35:34 1995 @@ -8,6 +8,12 @@ #include "telnet.h" #include "ini.h" +#ifdef WIN32 +# define LOWWORD_WPARAM(x) ((WPARAM)(MAKELONG(x,0))) +#else +# define LOWWORD_WPARAM(x) ((WPARAM)(x)) +#endif + extern char *cInvertedArray; extern int bMouseDown; extern int bSelection; @@ -662,14 +668,14 @@ hMenu = GetMenu(hWnd); CheckMenuItem(hMenu, IDM_BACKSPACE, MF_CHECKED); CheckMenuItem(hMenu, IDM_DELETE, MF_UNCHECKED); - SendMessage(pScr->hwndTel, WM_MYSCREENCHANGEBKSP, VK_BACK, (LPARAM) pScr); + SendMessage(pScr->hwndTel, WM_MYSCREENCHANGEBKSP, (WPARAM)VK_BACK, (LPARAM) pScr); break; case IDM_DELETE: hMenu = GetMenu(hWnd); CheckMenuItem(hMenu, IDM_BACKSPACE, MF_UNCHECKED); CheckMenuItem(hMenu, IDM_DELETE, MF_CHECKED); - SendMessage(pScr->hwndTel, WM_MYSCREENCHANGEBKSP, 0x7f, (LPARAM) pScr); + SendMessage(pScr->hwndTel, WM_MYSCREENCHANGEBKSP, (WPARAM)0x7f, (LPARAM) pScr); break; case IDM_FONT: @@ -838,9 +844,9 @@ case WM_KEYDOWN: if (wParam == VK_INSERT) { if (GetKeyState(VK_SHIFT) < 0) - PostMessage(hWnd, WM_COMMAND, IDM_PASTE, NULL); + PostMessage(hWnd, WM_COMMAND, LOWWORD_WPARAM(IDM_PASTE), (LPARAM)NULL); else if (GetKeyState(VK_CONTROL) < 0) - PostMessage(hWnd, WM_COMMAND, IDM_COPY, NULL); + PostMessage(hWnd, WM_COMMAND, LOWWORD_WPARAM(IDM_COPY), (LPARAM)NULL); break; } if (wParam < VK_PRIOR || wParam > VK_DOWN) @@ -849,19 +855,19 @@ switch (wParam) { case VK_PRIOR: /* Page up */ - SendMessage(hWnd, WM_VSCROLL, SB_PAGEUP, NULL); + SendMessage(hWnd, WM_VSCROLL, LOWWORD_WPARAM(SB_PAGEUP), (LPARAM)NULL); break; case VK_NEXT: /* Page down */ - SendMessage(hWnd, WM_VSCROLL, SB_PAGEDOWN, NULL); + SendMessage(hWnd, WM_VSCROLL, LOWWORD_WPARAM(SB_PAGEDOWN), (LPARAM)NULL); break; case VK_UP: /* Line up */ - SendMessage(hWnd, WM_VSCROLL, SB_LINEUP, NULL); + SendMessage(hWnd, WM_VSCROLL, LOWWORD_WPARAM(SB_LINEUP), (LPARAM)NULL); break; case VK_DOWN: /* Line down */ - SendMessage(hWnd, WM_VSCROLL, SB_LINEDOWN, NULL); + SendMessage(hWnd, WM_VSCROLL, LOWWORD_WPARAM(SB_LINEDOWN), (LPARAM)NULL); break; } @@ -871,7 +877,7 @@ case WM_CHAR: pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); assert (pScr != NULL); - SendMessage(pScr->hwndTel, WM_MYSCREENCHAR, wParam, (LPARAM) pScr); + SendMessage(pScr->hwndTel, WM_MYSCREENCHAR, (WPARAM)wParam, (LPARAM) pScr); break; case WM_SYSCHAR: @@ -897,7 +903,7 @@ pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); if (pScr == NULL) // Used on creation when window word not set pScr = ScreenList; - lpmmi = (MINMAXINFO *) lParam; + lpmmi = (MINMAXINFO *) lParam; if (FRAME_WIDTH + MAX_LINE_WIDTH * pScr->cxChar < lpmmi->ptMaxSize.x) lpmmi->ptMaxSize.x = FRAME_WIDTH + MAX_LINE_WIDTH * pScr->cxChar; lpmmi->ptMaxTrackSize.x = lpmmi->ptMaxSize.x; @@ -966,7 +972,7 @@ if (MessageBox(hWnd, "Terminate this connection?", "Telnet", MB_OKCANCEL) == IDOK) { pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); assert (pScr != NULL); - SendMessage(pScr->hwndTel, WM_MYSCREENCLOSE, NULL, (LPARAM) pScr); + SendMessage(pScr->hwndTel, WM_MYSCREENCLOSE, (WPARAM)NULL, (LPARAM) pScr); return (DefWindowProc(hWnd, message, wParam, lParam)); } break; @@ -1004,7 +1010,7 @@ assert (pScr != NULL); if (SetInternalScreenSize(pScr, LOWORD(lParam), HIWORD(lParam))) { - SendMessage(pScr->hwndTel, WM_MYSCREENSIZE, 0, + SendMessage(pScr->hwndTel, WM_MYSCREENSIZE, (WPARAM)0, MAKELONG(pScr->width, pScr->height)); } MakeWindowTitle(pScr->title, pScr->width, pScr->height, title, sizeof(title)); @@ -1026,7 +1032,7 @@ return(DefWindowProc(hWnd, message, wParam, lParam)); } - return(NULL); + return((long)NULL); } /* ScreenWndProc */ diff -ru --exclude=^configure$ krb5-beta5/src/windows/wintel/screen.h krb5-sap/windows/wintel/screen.h --- krb5-beta5/src/windows/wintel/screen.h Thu Apr 27 16:14:17 1995 +++ krb5-sap/windows/wintel/screen.h Mon Aug 14 18:52:54 1995 @@ -33,6 +33,7 @@ #define WM_MYSCREENSIZE (WM_USER+6) #define WM_NETWORKEVENT (WM_USER+7) #define WM_HOSTNAMEFOUND (WM_USER+8) +#define WM_HOSTADDR (WM_USER+9) #define FRAME_HEIGHT ((2* GetSystemMetrics(SM_CYFRAME))+GetSystemMetrics(SM_CYCAPTION)+GetSystemMetrics(SM_CYMENU)+3) #define FRAME_WIDTH (2*GetSystemMetrics(SM_CXFRAME)+GetSystemMetrics(SM_CXVSCROLL)) diff -ru --exclude=^configure$ krb5-beta5/src/windows/wintel/telnet.c krb5-sap/windows/wintel/telnet.c --- krb5-beta5/src/windows/wintel/telnet.c Thu Apr 27 16:14:19 1995 +++ krb5-sap/windows/wintel/telnet.c Mon Aug 21 14:19:20 1995 @@ -41,6 +41,8 @@ char szUserName[64]; // Used in auth.c char szHostName[64]; +unsigned long HostAddr; + #ifdef KRB4 #define WINDOW_CLASS "K4_telnetWClass" #endif @@ -95,7 +97,7 @@ /* Acquire and dispatch messages until a WM_QUIT message is received. */ - while (GetMessage(&msg, NULL, NULL, NULL)) { + while (GetMessage(&msg, (HWND)NULL, (UINT)NULL, (UINT)NULL)) { TranslateMessage(&msg); DispatchMessage(&msg); } @@ -295,7 +297,7 @@ wParam = con->backspace; else if (wParam == 0x7f) wParam = con->ctrl_backspace; - TelnetSend(con->ks, (char *) &wParam, 1, NULL); + TelnetSend(con->ks, (char *) &wParam, 1, (int)NULL); break; case WM_MYSYSCHAR: @@ -312,11 +314,11 @@ name.sin_addr.S_un.S_un_b.s_b2, name.sin_addr.S_un.S_un_b.s_b3, name.sin_addr.S_un.S_un_b.s_b4); - TelnetSend(con->ks, buf, lstrlen(buf), NULL); + TelnetSend(con->ks, buf, lstrlen(buf), (int)NULL); break; case 'x': - PostMessage(con->pScreen->hWnd, WM_CLOSE, NULL, NULL); + PostMessage(con->pScreen->hWnd, WM_CLOSE, (WPARAM)NULL, (LPARAM)NULL); break; } @@ -327,7 +329,7 @@ break; hBuffer = (HGLOBAL) wParam; lpBuffer = GlobalLock(hBuffer); - TelnetSend(con->ks, lpBuffer, lstrlen(lpBuffer), NULL); + TelnetSend(con->ks, lpBuffer, lstrlen(lpBuffer), (int)NULL); GlobalUnlock(hBuffer); break; @@ -355,7 +357,7 @@ switch (iEvent) { case FD_READ: - cnt = recv(con->socket, buf, 1024, NULL); + cnt = recv(con->socket, buf, 1024, (int)NULL); /* The following line has been removed until kstream supports non-blocking IO or larger size reads (jrivlin@fusion.com). @@ -403,12 +405,16 @@ } remote_host = (struct hostent *) hostdata; - remote_addr.sin_family = AF_INET; remote_addr.sin_addr.S_un.S_un_b.s_b1 = remote_host->h_addr[0]; remote_addr.sin_addr.S_un.S_un_b.s_b2 = remote_host->h_addr[1]; remote_addr.sin_addr.S_un.S_un_b.s_b3 = remote_host->h_addr[2]; remote_addr.sin_addr.S_un.S_un_b.s_b4 = remote_host->h_addr[3]; - remote_addr.sin_port = htons(port_no); + if ( 0 ) { + case WM_HOSTADDR: + remote_addr.sin_addr.S_un.S_addr = HostAddr; + } + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons((unsigned short)port_no); connect(con->socket, (struct sockaddr *) &remote_addr, sizeof(struct sockaddr)); @@ -428,7 +434,7 @@ default: // Passes it on if unproccessed return(DefWindowProc(hWnd, message, wParam, lParam)); } - return (NULL); + return ((long)NULL); } /* MainWndProc */ @@ -518,11 +524,11 @@ int OpenTelnetConnection(void) { - int nReturn, ret; + int nReturn, ret, i; struct sockaddr_in sockaddr; char *p; static struct kstream_crypt_ctl_block ctl; - char buf[128]; + char buf[128], ch; tmpConfig = calloc(sizeof(CONFIG), 1); @@ -609,8 +615,22 @@ strcpy(szHostName, ++p); } - WSAAsyncGetHostByName(hWnd, WM_HOSTNAMEFOUND, szHostName, hostdata, - MAXGETHOSTSTRUCT); + for ( i=strlen(szHostName)-1 ; i>=0 ; i-- ) { + /* check for numeric IP address instead of alphanumeric hostname */ + ch= szHostName[i]; + if ( ch=='.' || isdigit(ch) ) + continue; + break; + } + + if ( i<0 ) { + HostAddr= inet_addr(szHostName); + PostMessage(hWnd, WM_HOSTADDR, (WPARAM)0, (LPARAM)0 ); + } else { + WSAAsyncGetHostByName(hWnd, WM_HOSTNAMEFOUND, szHostName, hostdata, + MAXGETHOSTSTRUCT); + } + free(tmpConfig); ctl.encrypt = auth_encrypt; @@ -715,7 +735,7 @@ if (tmpCommaLoc) *tmpCommaLoc = '\0'; if (tmpName[0]) - SendDlgItemMessage(hDlg, TEL_CONNECT_NAME, CB_ADDSTRING, 0, + SendDlgItemMessage(hDlg, TEL_CONNECT_NAME, CB_ADDSTRING, (WPARAM)0, (LPARAM) ((LPSTR) tmpName)); else break; @@ -725,12 +745,16 @@ (GetSystemMetrics(SM_CYSCREEN)/2)-(yExt/2), 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW); ReleaseDC(hDlg, hDC); - SendMessage(hEdit, WM_USER+1, NULL, NULL); - SendMessage(hDlg, WM_SETFOCUS, NULL, NULL); + SendMessage(hEdit, WM_USER+1, (WPARAM)NULL, (LPARAM)NULL); + SendMessage(hDlg, WM_SETFOCUS, (WPARAM)NULL, (LPARAM)NULL); return (TRUE); case WM_COMMAND: +#ifdef WIN32 + switch (LOWORD(wParam)) { +#else switch (wParam) { +#endif case TEL_CANCEL: EndDialog(hDlg, FALSE); break;