svn rev #25245: trunk/src/ windows/ windows/leashdll/ windows/leashdll/include/ ...

hartmans@MIT.EDU hartmans at MIT.EDU
Wed Sep 28 16:54:28 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25245
Commit By: hartmans
Log Message:
Initial update to KFW related source to build with K5 1.9 on Windows

From: Alexey Melnikov <alexey.melnikov at isode.com>


Changed Files:
U   trunk/src/Makefile.in
U   trunk/src/windows/Makefile.in
U   trunk/src/windows/leashdll/AFSroutines.c
A   trunk/src/windows/leashdll/Makefile.in
U   trunk/src/windows/leashdll/include/leashwin.h
U   trunk/src/windows/leashdll/krb5routines.c
U   trunk/src/windows/leashdll/leashdll.c
U   trunk/src/windows/leashdll/leashdll.h
U   trunk/src/windows/leashdll/leasherr.c
U   trunk/src/windows/leashdll/lsh_pwd.c
U   trunk/src/windows/leashdll/lshcallb.c
U   trunk/src/windows/leashdll/lshfunc.c
U   trunk/src/windows/leashdll/timesync.c
U   trunk/src/windows/leashdll/winerr.c
U   trunk/src/windows/lib/registry.c
U   trunk/src/windows/version.rc
A   trunk/src/windows/wshelper/Makefile.in
U   trunk/src/windows/wshelper/hesiod.c
U   trunk/src/windows/wshelper/resource.rc
Modified: trunk/src/Makefile.in
===================================================================
--- trunk/src/Makefile.in	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/Makefile.in	2011-09-28 20:54:28 UTC (rev 25245)
@@ -190,10 +190,10 @@
 	util\et\Makefile util\profile\Makefile util\profile\testmod\Makefile \
 	util\support\Makefile \
 	util\windows\Makefile \
-	windows\Makefile windows\lib\Makefile \
+	windows\Makefile windows\wshelper\Makefile windows\lib\Makefile \
 	windows\cns\Makefile windows\gina\Makefile \
 	windows\gss\Makefile windows\ms2mit\Makefile \
-	windows\wintel\Makefile windows\kfwlogon\Makefile
+	windows\wintel\Makefile windows\kfwlogon\Makefile windows\leashdll\Makefile
 
 ##DOS##Makefile-windows:: $(MKFDEP) $(WINMAKEFILES)
 
@@ -307,6 +307,8 @@
 ##DOS##	$(WCONFIG) config < $@.in > $@
 ##DOS##windows\cns\Makefile: windows\cns\Makefile.in $(MKFDEP)
 ##DOS##	$(WCONFIG) config < $@.in > $@
+##DOS##windows\wshelper\Makefile: windows\wshelper\Makefile.in $(MKFDEP)
+##DOS##	$(WCONFIG) config < $@.in > $@
 ##DOS##windows\gina\Makefile: windows\gina\Makefile.in $(MKFDEP)
 ##DOS##	$(WCONFIG) config < $@.in > $@
 ##DOS##windows\gss\Makefile: windows\gss\Makefile.in $(MKFDEP)
@@ -317,6 +319,8 @@
 ##DOS##	$(WCONFIG) config < $@.in > $@
 ##DOS##windows\kfwlogon\Makefile: windows\kfwlogon\Makefile.in $(MKFDEP)
 ##DOS##	$(WCONFIG) config < $@.in > $@
+##DOS##windows\leashdll\Makefile: windows\leashdll\Makefile.in $(MKFDEP)
+##DOS##	$(WCONFIG) config < $@.in > $@
 
 clean-windows:: Makefile-windows
 
@@ -359,9 +363,9 @@
     ccapi/lib/* ccapi/lib/win/* ccapi/lib/win/OldCC/* \
     ccapi/server/* ccapi/server/win/* \
     ccapi/test/* \
-    util/windows/* windows/* windows/lib/* windows/cns/* \
+    util/windows/* windows/* windows/wshelper/* windows/lib/* windows/cns/* \
 	windows/wintel/* windows/gss/* windows/gina/* windows/ms2mit/* \
-	windows/kfwlogon/*
+	windows/kfwlogon/* windows/leashdll/*
 
 WINBINARYFILES=	windows/*/*.ico windows/*/*.doc windows/*/*.hlp \
 	windows/*/*.hpj

Modified: trunk/src/windows/Makefile.in
===================================================================
--- trunk/src/windows/Makefile.in	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/Makefile.in	2011-09-28 20:54:28 UTC (rev 25245)
@@ -3,4 +3,4 @@
 !if "$(KRB5_KFW_COMPILE)"=="1"
 KFWLOGON= kfwlogon
 !endif
-SUBDIRS= lib cns gss gina ms2mit $(KFWLOGON)
+SUBDIRS= wshelper lib leashdll cns gss gina ms2mit $(KFWLOGON)

Modified: trunk/src/windows/leashdll/AFSroutines.c
===================================================================
--- trunk/src/windows/leashdll/AFSroutines.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/AFSroutines.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -1,18 +1,21 @@
 //* Module name: AFSroutines.c
 
 #include <windows.h>
+#include <winsock2.h>
 #include <stdio.h>
 #include <time.h>
 
 /* Private Include files */
 #include <conf.h>
 #include <leasherr.h>
-#include <krb.h>
 #include "leashdll.h"
 #include <leashwin.h>
 
 #ifndef NO_AFS
-#include "afscompat.h"
+#include <afs/stds.h>
+#include <afs/auth.h>
+#include <afs/krb.h>
+#include <afs/cellconfig.h>
 #endif
 #include "leash-int.h"
 
@@ -267,10 +270,12 @@
     int LifeTime
     )
 {
-#ifdef NO_AFS
+/////#ifdef NO_AFS
+#if defined(NO_AFS) || defined(NO_KRB4)
     return(0);
 #else
     long	rc;
+////This is defined in krb.h:
     CREDENTIALS	creds;
     KTEXT_ST	ticket;
     struct ktc_principal	aserver;
@@ -348,12 +353,15 @@
         try_krb5 = 1;
     }
 #endif /* NO_KRB5 */
+
+#ifndef NO_KRB4
     if ( !try_krb5 || !realm_of_user[0] ) {
         if ((rc = (*pkrb_get_tf_realm)((*ptkt_string)(), realm_of_user)) != KSUCCESS)
         {
             return(rc);
         }
     }
+#endif
     strcpy(realm_of_cell, afs_realm_of_cell(&ak_cellconfig));
 
     if (strlen(service) == 0)
@@ -519,6 +527,7 @@
 #endif /* NO_KRB5 */
     {
       use_krb4:
+#ifndef NO_KRB4
         rc = (*pkrb_get_cred)(ServiceName, CellName, RealmName, &creds);
 		if (rc == NO_TKT_FIL) {
 			// if the problem is that we have no krb4 tickets
@@ -527,9 +536,13 @@
 		}
         if (rc != KSUCCESS)
             rc = (*pkrb_get_cred)(ServiceName, "", RealmName, &creds);
+#else
+	rc = KFAILURE;
+#endif
     }
     if (rc != KSUCCESS)
     {
+#ifndef NO_KRB4
         if ((rc = (*pkrb_mk_req)(&ticket, ServiceName, CellName, RealmName, 0)) == KSUCCESS)
         {
             if ((rc = (*pkrb_get_cred)(ServiceName, CellName, RealmName, &creds)) != KSUCCESS)
@@ -546,8 +559,11 @@
         }
         else
         {
+#endif
             return(rc);
+#ifndef NO_KRB4
         }
+#endif
     }
 
 	memset(&aserver, '\0', sizeof(aserver));
@@ -645,11 +661,13 @@
     }
 #endif /* NO_KRB5 */
 
+#ifndef NO_KRB4
     if ( !krbrlm[0] ) {
         strcpy(krbrlm, (char *)(*pkrb_realmofhost)(cellconfig->hostName[0]));
         if ((*pkrb_get_krbhst)(krbhst, krbrlm, 1) != KSUCCESS)
             krbrlm[0] = '\0';
     }
+#endif /* NO_KRB4 */
 
     if ( !krbrlm[0] )
     {

Added: trunk/src/windows/leashdll/Makefile.in
===================================================================
--- trunk/src/windows/leashdll/Makefile.in	                        (rev 0)
+++ trunk/src/windows/leashdll/Makefile.in	2011-09-28 20:54:28 UTC (rev 25245)
@@ -0,0 +1,76 @@
+BUILDTOP=..\..
+
+!ifndef NO_AFS
+###AFS_BASE=
+AFS_INCLUDES=-I$(AFS_BASE)\Include
+AFS_LIB=$(AFS_BASE)\lib
+AFS_LIBS=$(AFS_LIB)\afsauthent.lib
+!else
+AFS_INCLUDES=
+AFS_LIBS=
+!endif
+
+DLL_NAME=leashw32
+
+# Use 64-bit DLL_NAME and DEF_FILE on 64-bit platforms
+!if ("$(CPU)" == "IA64") || ("$(CPU)" == "AMD64") || ("$(CPU)" == "ALPHA64")
+DLL_NAME=leashw64
+!endif
+
+DEF_FILE=leashw32.def
+
+OBJS=	$(OUTPRE)AFSroutines.$(OBJEXT) \
+	$(OUTPRE)krb5routines.$(OBJEXT) \
+	$(OUTPRE)leashdll.$(OBJEXT) \
+	$(OUTPRE)leasherr.$(OBJEXT) \
+	$(OUTPRE)lsh_pwd.$(OBJEXT) \
+	$(OUTPRE)lshcallb.$(OBJEXT) \
+	$(OUTPRE)lshfunc.$(OBJEXT) \
+	$(OUTPRE)timesync.$(OBJEXT) \
+	$(OUTPRE)winerr.$(OBJEXT) \
+	$(OUTPRE)winutil.$(OBJEXT) \
+	$(OUTPRE)registry.$(OBJEXT) \
+	$(OUTPRE)loadfuncs.$(OBJEXT)
+
+#TODO: Fix resource compilation
+#RESFILE = $(OUTPRE)lsh_pwd.res
+XOBJS	= $(RESFILE)
+
+RCFLAGS = /i $(BUILDTOP)\include
+
+###From another project inside K 1.9:
+###VERSIONRC = $(BUILDTOP)\windows\version.rc
+###RCFLAGS=$(CPPFLAGS) -I$(top_srcdir) -D_WIN32 -DRES_ONLY
+
+
+# Set NODEBUG if building release instead of debug
+
+LOCALINCLUDES = -I$(BUILDTOP)\include -I.\include -I.\include\krb4 $(AFS_INCLUDES)
+
+WINLIBS = kernel32.lib advapi32.lib user32.lib gdi32.lib Version.lib \
+	  ws2_32.lib dnsapi.lib $(BUILDTOP)\ccapi\lib\win\srctmp\ccapi.lib $(AFS_LIBS)
+
+WINDLLFLAGS = /nologo /dll /incremental:no /release $(LOPTS)
+
+
+DEFINES = -DUNICODE -D_UNICODE -DWINSOCK -DWIN32 -DWINDOWS -DNO_KRB4
+!ifdef NODEBUG
+DEFINES = $(DEFINES)
+!else
+DEFINES = $(DEFINES) -DDBG
+!endif
+
+all-windows::
+all-windows:: $(OUTPRE)$(DLL_NAME).dll
+
+clean-windows::
+	$(RM) $(OUTPRE)$(DLL_NAME).dll
+
+$(OUTPRE)$(DLL_NAME).dll: $(DEF_FILE) $(OBJS) $(XOBJS)
+	link $(WINDLLFLAGS) -def:$(DEF_FILE) -out:$*.dll \
+	$(OBJS) $(XOBJS) $(WINLIBS) $(SCLIB)
+	$(_VC_MANIFEST_EMBED_DLL)
+
+#TODO: Add dependencies on include files here
+
+#$(RESFILE): resource.rc

Modified: trunk/src/windows/leashdll/include/leashwin.h
===================================================================
--- trunk/src/windows/leashdll/include/leashwin.h	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/include/leashwin.h	2011-09-28 20:54:28 UTC (rev 25245)
@@ -1,7 +1,17 @@
 #ifndef __LEASHWIN__
 #define __LEASHWIN__
 
+////Is this sufficient?
+#ifndef NO_KRB4
 #include <krb.h>
+#else
+#define ANAME_SZ	        40
+#define	REALM_SZ	        40
+#define	SNAME_SZ	        40
+#define	INST_SZ		        40
+/* include space for '.' and '@' */
+#define	MAX_K_NAME_SZ	    (ANAME_SZ + INST_SZ + REALM_SZ + 2)
+#endif
 
 #define DLGTYPE_PASSWD   0
 #define DLGTYPE_CHPASSWD 1

Modified: trunk/src/windows/leashdll/krb5routines.c
===================================================================
--- trunk/src/windows/leashdll/krb5routines.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/krb5routines.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -21,6 +21,8 @@
 #include <time.h>
 #include <assert.h>
 
+#include <winsock2.h>
+
 /* Private Include files */
 #include "leashdll.h"
 #include <leashwin.h>
@@ -1527,4 +1529,4 @@
     }
     return errcode;
 }
-#endif /* NO_KRB5 */
\ No newline at end of file
+#endif /* NO_KRB5 */

Modified: trunk/src/windows/leashdll/leashdll.c
===================================================================
--- trunk/src/windows/leashdll/leashdll.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/leashdll.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -1,6 +1,5 @@
 #include <windows.h>
 #include "leashdll.h"
-#include <krb.h>
 #include <leashwin.h>
 #include "leash-int.h"
 

Modified: trunk/src/windows/leashdll/leashdll.h
===================================================================
--- trunk/src/windows/leashdll/leashdll.h	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/leashdll.h	2011-09-28 20:54:28 UTC (rev 25245)
@@ -112,7 +112,8 @@
 #include <errno.h>
 
 #ifndef NO_AFS
-#include "afscompat.h"
+////Can't find it!
+////#include "afscompat.h"
 #endif
 
 // service definitions

Modified: trunk/src/windows/leashdll/leasherr.c
===================================================================
--- trunk/src/windows/leashdll/leasherr.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/leasherr.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -85,7 +85,6 @@
 #endif
 
 #ifdef WINDOWS
-#include <krberr.h>
 
 void Leash_initialize_krb_error_func(err_func func, HANDLE *__et_list)
 {
@@ -94,8 +93,6 @@
 #endif
 }
 
-#include <kadm_err.h>
-
 void Leash_initialize_kadm_error_table(HANDLE *__et_list)
 {
 #ifndef NO_KRB4

Modified: trunk/src/windows/leashdll/lsh_pwd.c
===================================================================
--- trunk/src/windows/leashdll/lsh_pwd.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/lsh_pwd.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -33,7 +33,9 @@
 #include "leash-int.h"
 #include "leashids.h"
 #include <leasherr.h>
+#ifndef NO_KRB4
 #include <krb.h>
+#endif
 #ifndef NO_KRB5
 #include <krb5.h>
 #endif /* NO_KRB5 */

Modified: trunk/src/windows/leashdll/lshcallb.c
===================================================================
--- trunk/src/windows/leashdll/lshcallb.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/lshcallb.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -1,5 +1,4 @@
 #include <windows.h>
-#include <krb.h>
 
 int (*Lcom_err)(LPSTR,long,LPSTR,...);
 LPSTR (*Lerror_message)(long);

Modified: trunk/src/windows/leashdll/lshfunc.c
===================================================================
--- trunk/src/windows/leashdll/lshfunc.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/lshfunc.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -1,10 +1,16 @@
 #include <windows.h>
 #include <stdio.h>
 #include <sys/types.h>
-#include <winsock.h>
+#include <winsock2.h>
 #include "leashdll.h"
+#ifndef NO_KRB4
 #include <KerberosIV/krb.h>
 #include <prot.h>
+#else
+/* General definitions */
+#define         KSUCCESS        0
+#define         KFAILURE        255
+#endif
 #include <time.h>
 
 #include <leashwin.h>
@@ -14,7 +20,9 @@
 
 #include <mitwhich.h>
 
+#ifndef NO_KRB4
 #include <winkrbid.h>
+#endif
 #include "reminder.h"
 
 static char FAR *err_context;

Modified: trunk/src/windows/leashdll/timesync.c
===================================================================
--- trunk/src/windows/leashdll/timesync.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/timesync.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -8,10 +8,14 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef NO_KRB4
 #include <winkrbid.h>
+#endif
 
 #ifdef WSHELPER
 #include <wshelper.h>
+#else
+#include <winsock2.h>
 #endif
 
 #include <stdio.h>

Modified: trunk/src/windows/leashdll/winerr.c
===================================================================
--- trunk/src/windows/leashdll/winerr.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/leashdll/winerr.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -15,7 +15,6 @@
 
 // Private Include files
 #include "leashdll.h"
-#include <krb.h>
 #include <leashwin.h>
 
 // Global Variables.
@@ -54,135 +53,17 @@
     table_num = code - offset;
     com_err_msg = Lerror_message(code);
 
-    switch(table_num)
-    {
-#ifndef NO_KRB4
-    case krb_err_base:
-    case kadm_err_base:
-	break;
-#endif
-    default:
-	lstrcpy(buf, com_err_msg);
-	return buf;
-    }
+    lstrcpy(buf, com_err_msg);
+    return buf;
 
-    cp = buf;
-#ifndef NO_KRB4
-    if (table_num == krb_err_base)
-        switch(offset)
-        {
-        case KDC_NAME_EXP:           /* 001 Principal expired */
-        case KDC_SERVICE_EXP:        /* 002 Service expired */
-        case KDC_AUTH_EXP:           /* 003 Auth expired */
-        case KDC_PKT_VER:            /* 004 Protocol version unknown */
-        case KDC_P_MKEY_VER:         /* 005 Wrong master key version */
-        case KDC_S_MKEY_VER:         /* 006 Wrong master key version */
-        case KDC_BYTE_ORDER:         /* 007 Byte order unknown */
-        case KDC_PR_N_UNIQUE:        /* 009 Principal not unique */
-        case KDC_NULL_KEY:           /* 010 Principal has null key */
-        case KDC_GEN_ERR:            /* 011 Generic error from KDC */
-        case INTK_W_NOTALL   :       /* 061 Not ALL tickets returned */
-        case INTK_PROT       :       /* 063 Protocol Error */
-        case INTK_ERR        :       /* 070 Other error */
-            com_err_msg = "Something weird happened... try again, and if Leash"
-                " continues to fail, contact Network Services as listed in the "
-                "About box.";
-            break;
-        case KDC_PR_UNKNOWN:         /* 008 Principal unknown */
-            com_err_msg = "You have entered an unknown username/instance/realm"
-                " combination.";
-            break;
-        case GC_TKFIL                :       /* 021 Can't read ticket file */
-        case GC_NOTKT                :       /* 022 Can't find ticket or TGT */
-            com_err_msg = "Something is wrong with the memory where your "
-                "tickets are stored. Try exiting Windows and restarting your "
-                "computer.";
-            break;
-        case MK_AP_TGTEXP    :       /* 026 TGT Expired */
-            /* no extra error msg */
-            break;
-        case RD_AP_TIME              :       /* 037 delta_t too big */
-            com_err_msg = "Your computer's clock is out of sync with the "
-                "Kerberos server.  Please see the help file about correcting "
-                "your clock.";
-            break;
 
-        case RD_AP_UNDEC             :       /* 031 Can't decode authenticator */
-        case RD_AP_EXP               :       /* 032 Ticket expired */
-        case RD_AP_NYV               :       /* 033 Ticket not yet valid */
-        case RD_AP_REPEAT    :       /* 034 Repeated request */
-        case RD_AP_NOT_US    :       /* 035 The ticket isn't for us */
-        case RD_AP_INCON             :       /* 036 Request is inconsistent */
-        case RD_AP_BADD              :       /* 038 Incorrect net address */
-        case RD_AP_VERSION   :       /* 039 protocol version mismatch */
-        case RD_AP_MSG_TYPE  :       /* 040 invalid msg type */
-        case RD_AP_MODIFIED  :       /* 041 message stream modified */
-        case RD_AP_ORDER             :       /* 042 message out of order */
-        case RD_AP_UNAUTHOR  :       /* 043 unauthorized request */
-            /* no extra error msg */
-            break;
-        case GT_PW_NULL:     /* 51    Current PW is null */
-        case GT_PW_BADPW:    /* 52    Incorrect current password */
-        case GT_PW_PROT:     /* 53    Protocol Error */
-        case GT_PW_KDCERR:   /* 54    Error returned by KDC */
-        case GT_PW_NULLTKT:  /* 55    Null tkt returned by KDC */
-            /* no error msg yet */
-            break;
-
-            /* Values returned by send_to_kdc */
-        case SKDC_RETRY   :  /* 56    Retry count exceeded */
-        case SKDC_CANT    :  /* 57    Can't send request */
-            com_err_msg = "Cannot contact the kerberos server for the selected realm.";
-            break;
-            /* no error message on purpose: */
-        case INTK_BADPW      :       /* 062 Incorrect password */
-            break;
-        default:
-            /* no extra error msg */
-            break;
-        }
-    else
-        switch(code)
-        {
-        case KADM_INSECURE_PW:
-            /* if( kadm_info != NULL ){
-             * wsprintf(buf, "%s\n%s", com_err_msg, kadm_info);
-             * } else {
-             * wsprintf(buf, "%s\nPlease see the help file for information "
-             * "about secure passwords.", com_err_msg);
-             * }
-             * com_err_msg = buf;
-             */
-
-            /* The above code would be preferred since it allows site specific
-             * information to be delivered from the Kerberos server. However the
-             * message box is too small for VGA screens.
-             * It does work well if we only have to support 1024x768
-             */
-
-            com_err_msg = "You have entered an insecure or weak password.";
-        default:
-            /* no extra error msg */
-            break;
-        }
-#endif /* NO_KRB4 */
+////Is this needed at all after the return above?
+    cp = buf;
     if(com_err_msg != buf)
         lstrcpy(buf, com_err_msg);
     cp = buf + lstrlen(buf);
     *cp++ = '\n';
-    switch(table_num) {
-#ifndef NO_KRB4
-    case krb_err_base:
-        etype = "Kerberos";
-        break;
-    case kadm_err_base:
-        etype = "Kerberos supplemental";
-        break;
-#endif
-    default:
-        etype = Lerror_table_name(table_num);
-        break;
-    }
+    etype = Lerror_table_name(table_num);
     wsprintf((LPSTR) cp, (LPSTR) "(%s error %d"
 #ifdef DEBUG_COM_ERR
              " (absolute error %ld)"

Modified: trunk/src/windows/lib/registry.c
===================================================================
--- trunk/src/windows/lib/registry.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/lib/registry.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -4,6 +4,7 @@
  * Author:  Michael Graff
  */
 
+#include <stdlib.h>
 #include <windows.h>
 #include <windowsx.h>
 

Modified: trunk/src/windows/version.rc
===================================================================
--- trunk/src/windows/version.rc	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/version.rc	2011-09-28 20:54:28 UTC (rev 25245)
@@ -108,6 +108,18 @@
 #endif
 #endif /* GSSAPI */
 
+
+#ifdef WSHELPER_LIB
+#define K5_DESCRIPTION "Winsock Helper (wshelper) API - MIT GSS / Kerberos v5 distribution\0"
+#define K5_INTERNAL_NAME "wshelper\0"
+#define K5_FILETYPE	VFT_DLL
+#if !defined(_WIN32)
+#define K5_ORIGINAL_NAME "wshelper.dll\0"
+#else
+#define K5_ORIGINAL_NAME "wshelper32.dll\0"
+#endif
+#endif /* WSHELPER_LIB */
+
 #ifdef KRB4_LIB
 #define K5_DESCRIPTION "Kerberos v4 - MIT GSS / Kerberos v4 and v5 distribution\0"
 #define K5_INTERNAL_NAME "krb4\0"

Added: trunk/src/windows/wshelper/Makefile.in
===================================================================
--- trunk/src/windows/wshelper/Makefile.in	                        (rev 0)
+++ trunk/src/windows/wshelper/Makefile.in	2011-09-28 20:54:28 UTC (rev 25245)
@@ -0,0 +1,65 @@
+BUILDTOP=..\..
+
+DLL_NAME=wshelp32
+DEF_FILE=wshelp32.def
+
+# Use 64-bit DLL_NAME and DEF_FILE on 64-bit platforms
+!if ("$(CPU)" == "IA64") || ("$(CPU)" == "AMD64") || ("$(CPU)" == "ALPHA64")
+DLL_NAME=wshelp64
+DEF_FILE=wshelp64.def
+!endif
+
+
+OBJS=	$(OUTPRE)dllmain.$(OBJEXT) \
+	$(OUTPRE)gethna.$(OBJEXT) \
+	$(OUTPRE)hesiod.$(OBJEXT) \
+	$(OUTPRE)hesmailh.$(OBJEXT) \
+	$(OUTPRE)hespwnam.$(OBJEXT) \
+	$(OUTPRE)hesservb.$(OBJEXT) \
+	$(OUTPRE)inetaton.$(OBJEXT) \
+	$(OUTPRE)res_comp.$(OBJEXT) \
+	$(OUTPRE)res_init.$(OBJEXT) \
+	$(OUTPRE)res_quer.$(OBJEXT)
+
+RESFILE = $(OUTPRE)resource.res
+XOBJS	= $(RESFILE)
+
+RCFLAGS = -I$(BUILDTOP)\include -I$(BUILDTOP) -DWSHELPER_LIB
+
+###From another project inside K 1.9:
+###VERSIONRC = $(BUILDTOP)\windows\version.rc
+###RCFLAGS=$(CPPFLAGS) -I$(top_srcdir) -D_WIN32 -DRES_ONLY
+
+
+# Set NODEBUG if building release instead of debug
+
+LOCALINCLUDES = -I$(BUILDTOP)\include
+
+WINLIBS = advapi32.lib user32.lib ws2_32.lib dnsapi.lib
+
+WINDLLFLAGS = /nologo /dll /incremental:no /release $(LOPTS)
+
+DEFINES = -DUNICODE -D_UNICODE
+!ifdef NODEBUG
+DEFINES = $(DEFINES)
+!else
+DEFINES = $(DEFINES) -DDBG
+!endif
+
+all-windows::
+all-windows:: $(OUTPRE)$(DLL_NAME).dll
+
+clean-windows::
+	$(RM) $(OUTPRE)$(DLL_NAME).dll
+
+$(OUTPRE)$(DLL_NAME).dll: $(DEF_FILE) $(OBJS) $(XOBJS)
+	link $(WINDLLFLAGS) -def:$(DEF_FILE) -out:$*.dll \
+	$(OBJS) $(XOBJS) $(WINLIBS) $(SCLIB)
+	$(_VC_MANIFEST_EMBED_DLL)
+
+$(OUTPRE)dllmain.$(OBJEXT): pwd.h
+$(OUTPRE)hespwnam.$(OBJEXT): pwd.h
+$(OUTPRE)dllmain.$(OBJEXT): wsh-int.h
+$(OUTPRE)res_init.$(OBJEXT): wsh-int.h
+
+$(RESFILE): resource.rc

Modified: trunk/src/windows/wshelper/hesiod.c
===================================================================
--- trunk/src/windows/wshelper/hesiod.c	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/wshelper/hesiod.c	2011-09-28 20:54:28 UTC (rev 25245)
@@ -33,6 +33,7 @@
 
 #define index(str, c) strchr(str,c)
 #include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>
 
 #include <windows.h>

Modified: trunk/src/windows/wshelper/resource.rc
===================================================================
--- trunk/src/windows/wshelper/resource.rc	2011-09-28 20:54:23 UTC (rev 25244)
+++ trunk/src/windows/wshelper/resource.rc	2011-09-28 20:54:28 UTC (rev 25245)
@@ -57,7 +57,7 @@
 //
 // Generated from the TEXTINCLUDE 3 resource.
 //
-#include "version.rc"
+#include "..\version.rc"
 #include "string.rc"
 
 /////////////////////////////////////////////////////////////////////////////




More information about the cvs-krb5 mailing list