From 560ac14a1eeedf6b246186ab5e6abb819cf2afb3 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Wed, 28 Sep 2011 20:54:28 +0000 Subject: [PATCH] Initial update to KFW related source to build with K5 1.9 on Windows From: Alexey Melnikov git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25245 dc483132-0cff-0310-8789-dd5450dbe970 --- src/Makefile.in | 12 ++- src/windows/Makefile.in | 2 +- src/windows/leashdll/AFSroutines.c | 24 ++++- src/windows/leashdll/Makefile.in | 76 ++++++++++++++ src/windows/leashdll/include/leashwin.h | 10 ++ src/windows/leashdll/krb5routines.c | 4 +- src/windows/leashdll/leashdll.c | 1 - src/windows/leashdll/leashdll.h | 3 +- src/windows/leashdll/leasherr.c | 3 - src/windows/leashdll/lsh_pwd.c | 2 + src/windows/leashdll/lshcallb.c | 1 - src/windows/leashdll/lshfunc.c | 10 +- src/windows/leashdll/timesync.c | 4 + src/windows/leashdll/winerr.c | 129 +----------------------- src/windows/lib/registry.c | 1 + src/windows/version.rc | 12 +++ src/windows/wshelper/Makefile.in | 65 ++++++++++++ src/windows/wshelper/hesiod.c | 1 + src/windows/wshelper/resource.rc | 2 +- 19 files changed, 221 insertions(+), 141 deletions(-) create mode 100644 src/windows/leashdll/Makefile.in create mode 100644 src/windows/wshelper/Makefile.in diff --git a/src/Makefile.in b/src/Makefile.in index 9e048ad7a..660aebee5 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -190,10 +190,10 @@ WINMAKEFILES=Makefile \ 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 @@ WINMAKEFILES=Makefile \ ##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 @@ WINMAKEFILES=Makefile \ ##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 @@ WINFILES= \ 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 diff --git a/src/windows/Makefile.in b/src/windows/Makefile.in index 9cadd576d..7e75a6c80 100644 --- a/src/windows/Makefile.in +++ b/src/windows/Makefile.in @@ -3,4 +3,4 @@ NO_OUTPRE=1 !if "$(KRB5_KFW_COMPILE)"=="1" KFWLOGON= kfwlogon !endif -SUBDIRS= lib cns gss gina ms2mit $(KFWLOGON) +SUBDIRS= wshelper lib leashdll cns gss gina ms2mit $(KFWLOGON) diff --git a/src/windows/leashdll/AFSroutines.c b/src/windows/leashdll/AFSroutines.c index a67b164e3..cdf751d50 100644 --- a/src/windows/leashdll/AFSroutines.c +++ b/src/windows/leashdll/AFSroutines.c @@ -1,18 +1,21 @@ //* Module name: AFSroutines.c #include +#include #include #include /* Private Include files */ #include #include -#include #include "leashdll.h" #include #ifndef NO_AFS -#include "afscompat.h" +#include +#include +#include +#include #endif #include "leash-int.h" @@ -267,10 +270,12 @@ Leash_afs_klog( 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 @@ Leash_afs_klog( 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 @@ Leash_afs_klog( #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 @@ Leash_afs_klog( } 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 @@ Leash_afs_klog( } else { +#endif return(rc); +#ifndef NO_KRB4 } +#endif } memset(&aserver, '\0', sizeof(aserver)); @@ -645,11 +661,13 @@ static char *afs_realm_of_cell(afsconf_cell *cellconfig) } #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] ) { diff --git a/src/windows/leashdll/Makefile.in b/src/windows/leashdll/Makefile.in new file mode 100644 index 000000000..fd9b0f431 --- /dev/null +++ b/src/windows/leashdll/Makefile.in @@ -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 diff --git a/src/windows/leashdll/include/leashwin.h b/src/windows/leashdll/include/leashwin.h index 477c6c30c..6a26c43f9 100644 --- a/src/windows/leashdll/include/leashwin.h +++ b/src/windows/leashdll/include/leashwin.h @@ -1,7 +1,17 @@ #ifndef __LEASHWIN__ #define __LEASHWIN__ +////Is this sufficient? +#ifndef NO_KRB4 #include +#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 diff --git a/src/windows/leashdll/krb5routines.c b/src/windows/leashdll/krb5routines.c index 7f2d28306..0bb30ca15 100644 --- a/src/windows/leashdll/krb5routines.c +++ b/src/windows/leashdll/krb5routines.c @@ -21,6 +21,8 @@ #include #include +#include + /* Private Include files */ #include "leashdll.h" #include @@ -1527,4 +1529,4 @@ leash_krb5_prompter( krb5_context context, } return errcode; } -#endif /* NO_KRB5 */ \ No newline at end of file +#endif /* NO_KRB5 */ diff --git a/src/windows/leashdll/leashdll.c b/src/windows/leashdll/leashdll.c index f5e265342..08ebbe078 100644 --- a/src/windows/leashdll/leashdll.c +++ b/src/windows/leashdll/leashdll.c @@ -1,6 +1,5 @@ #include #include "leashdll.h" -#include #include #include "leash-int.h" diff --git a/src/windows/leashdll/leashdll.h b/src/windows/leashdll/leashdll.h index 162fb4f21..74cceab82 100644 --- a/src/windows/leashdll/leashdll.h +++ b/src/windows/leashdll/leashdll.h @@ -112,7 +112,8 @@ typedef struct TicketList #include #ifndef NO_AFS -#include "afscompat.h" +////Can't find it! +////#include "afscompat.h" #endif // service definitions diff --git a/src/windows/leashdll/leasherr.c b/src/windows/leashdll/leasherr.c index ec2616b21..686f48bac 100644 --- a/src/windows/leashdll/leasherr.c +++ b/src/windows/leashdll/leasherr.c @@ -85,7 +85,6 @@ void initialize_lsh_error_table(struct et_list **__et_list) { #endif #ifdef WINDOWS -#include void Leash_initialize_krb_error_func(err_func func, HANDLE *__et_list) { @@ -94,8 +93,6 @@ void Leash_initialize_krb_error_func(err_func func, HANDLE *__et_list) #endif } -#include - void Leash_initialize_kadm_error_table(HANDLE *__et_list) { #ifndef NO_KRB4 diff --git a/src/windows/leashdll/lsh_pwd.c b/src/windows/leashdll/lsh_pwd.c index 6be1ea3c0..23f761e4c 100644 --- a/src/windows/leashdll/lsh_pwd.c +++ b/src/windows/leashdll/lsh_pwd.c @@ -33,7 +33,9 @@ #include "leash-int.h" #include "leashids.h" #include +#ifndef NO_KRB4 #include +#endif #ifndef NO_KRB5 #include #endif /* NO_KRB5 */ diff --git a/src/windows/leashdll/lshcallb.c b/src/windows/leashdll/lshcallb.c index 3f2afb345..0344b796f 100644 --- a/src/windows/leashdll/lshcallb.c +++ b/src/windows/leashdll/lshcallb.c @@ -1,5 +1,4 @@ #include -#include int (*Lcom_err)(LPSTR,long,LPSTR,...); LPSTR (*Lerror_message)(long); diff --git a/src/windows/leashdll/lshfunc.c b/src/windows/leashdll/lshfunc.c index 73b10c357..c2b6d9216 100644 --- a/src/windows/leashdll/lshfunc.c +++ b/src/windows/leashdll/lshfunc.c @@ -1,10 +1,16 @@ #include #include #include -#include +#include #include "leashdll.h" +#ifndef NO_KRB4 #include #include +#else +/* General definitions */ +#define KSUCCESS 0 +#define KFAILURE 255 +#endif #include #include @@ -14,7 +20,9 @@ #include +#ifndef NO_KRB4 #include +#endif #include "reminder.h" static char FAR *err_context; diff --git a/src/windows/leashdll/timesync.c b/src/windows/leashdll/timesync.c index c9feadb3e..1c0bbbed2 100644 --- a/src/windows/leashdll/timesync.c +++ b/src/windows/leashdll/timesync.c @@ -8,10 +8,14 @@ #include #include +#ifndef NO_KRB4 #include +#endif #ifdef WSHELPER #include +#else +#include #endif #include diff --git a/src/windows/leashdll/winerr.c b/src/windows/leashdll/winerr.c index 10806d8b8..2d487b449 100644 --- a/src/windows/leashdll/winerr.c +++ b/src/windows/leashdll/winerr.c @@ -15,7 +15,6 @@ // Private Include files #include "leashdll.h" -#include #include // Global Variables. @@ -54,135 +53,17 @@ LPSTR err_describe(LPSTR buf, long code) 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; + +////Is this needed at all after the return above? 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 */ 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)" diff --git a/src/windows/lib/registry.c b/src/windows/lib/registry.c index 5b7ff1e82..5b0e7a1ab 100644 --- a/src/windows/lib/registry.c +++ b/src/windows/lib/registry.c @@ -4,6 +4,7 @@ * Author: Michael Graff */ +#include #include #include diff --git a/src/windows/version.rc b/src/windows/version.rc index e0b923541..166d961a5 100644 --- a/src/windows/version.rc +++ b/src/windows/version.rc @@ -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" diff --git a/src/windows/wshelper/Makefile.in b/src/windows/wshelper/Makefile.in new file mode 100644 index 000000000..c4647e5de --- /dev/null +++ b/src/windows/wshelper/Makefile.in @@ -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 diff --git a/src/windows/wshelper/hesiod.c b/src/windows/wshelper/hesiod.c index c912f7d44..b448849cf 100644 --- a/src/windows/wshelper/hesiod.c +++ b/src/windows/wshelper/hesiod.c @@ -33,6 +33,7 @@ #define index(str, c) strchr(str,c) #include +#include #include #include diff --git a/src/windows/wshelper/resource.rc b/src/windows/wshelper/resource.rc index d94e2deb7..f6244a7cf 100644 --- a/src/windows/wshelper/resource.rc +++ b/src/windows/wshelper/resource.rc @@ -57,7 +57,7 @@ END // // Generated from the TEXTINCLUDE 3 resource. // -#include "version.rc" +#include "..\version.rc" #include "string.rc" ///////////////////////////////////////////////////////////////////////////// -- 2.26.2