]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Remove use of -entry flag for DLLs on Windows 1403/head
authorKen Hornstein <kenh@cmf.nrl.navy.mil>
Thu, 12 Dec 2024 17:56:52 +0000 (12:56 -0500)
committerGreg Hudson <ghudson@mit.edu>
Fri, 13 Dec 2024 01:39:15 +0000 (20:39 -0500)
Remove the use of the -entry flag to specify a DLL entry point on
Windows, as it is no longer recommended.  The default Windows entry
point will call a DllMain() function if one is provided; use that name
in kfwlogon instead of DllEntryPoint().

[ghudson@mit.edu: edited commit message]

src/ccapi/lib/win/Makefile.in
src/config/win-pre.in
src/windows/kfwlogon/Makefile.in
src/windows/kfwlogon/kfwcommon.c
src/windows/kfwlogon/kfwlogon.c
src/windows/kfwlogon/kfwlogon.def
src/windows/kfwlogon/kfwlogon.h

index ef6c1cc29d4b904eaa2cb96644072ca43f39e2cf..0ad9590db8251072829f9e393fe055eec56a8294 100644 (file)
@@ -95,7 +95,7 @@ $(CCLIBRES): $(VERSIONRC)
        $(RC) $(RCFLAGS) -DCCAPI_LIB -fo $@ -r $**
 
 $(OUTPRE)$(CCLIB).dll: $(OBJS) $(CCLIB).def $(CCLIBRES)
-       $(LINK) $(LFLAGS) -entry:$(ENTRYPOINT) -dll /map:$*.map /out:$@ /DEF:$(CCLIB).def $(OBJS) \
+       $(LINK) $(LFLAGS) -dll /map:$*.map /out:$@ /DEF:$(CCLIB).def $(OBJS) \
            /implib:$(CCLIB).lib $(dllflags) $(LIBS) $(KFWLIB) $(CCLIBRES) rpcrt4.lib $(conlibsdll) $(conflags)
 
 $(CCLIB).def:
index ba3c9ac7c6938c65d203948665dddbb5303b68e8..753fde7ccb2be6772621753b65a83308348cd390 100644 (file)
@@ -125,11 +125,6 @@ CPPFLAGS=-I$(top_srcdir)\include -I$(top_srcdir)\include\krb5 $(DNSFLAGS) -DWIN3
 CCOPTS=-nologo /EHsc /W3 /we4020 /we4024 /we4047 $(PDB_OPTS) $(DLL_FILE_DEF)
 LOPTS=-nologo -incremental:no -manifest
 
-!if  ("$(BITS)" == "64" )
-ENTRYPOINT=_DllMainCRTStartup
-!else
-ENTRYPOINT=_DllMainCRTStartup@12
-!endif
 CCLINKOPTION=
 DEBUGOPT=/guard:cf /Zi
 
@@ -169,8 +164,7 @@ LOPTS=$(LOPTS) -debug
 INSTALLDBGSYMS=copy
 !endif
 
-# XXX - NOTE: We should probably use DllMainCRTStartup
-DLL_LINKOPTS=$(LOPTS) -dll -entry:DllMain
+DLL_LINKOPTS=$(LOPTS) -dll
 EXE_LINKOPTS=$(LOPTS)
 
 RM=$(BUILDTOP)\config\rm.bat
index d5ebe2bf4382f913ae5ea7688460617159784e37..51d6262947d0df69acb04cd4ad5150230aa0f6c4 100644 (file)
@@ -34,7 +34,7 @@ $(EXERES): $(VERSIONRC)
 all-windows: $(OUTPRE)kfwlogon.dll $(OUTPRE)kfwcpcc.exe
 
 $(KFWLOGON): $(OUTPRE)kfwlogon.obj $(OUTPRE)kfwcommon.obj $(LIBRES)
-    link $(DLL_LINKOPTS) -out:$@ $(OUTPRE)kfwlogon.obj $(OUTPRE)kfwcommon.obj -entry:DllEntryPoint -def:kfwlogon.def $(SYSLIBS) $(KLIB) $(CLIB) ../lib/$(OUTPRE)libwin.lib $(LIBRES)
+    link $(DLL_LINKOPTS) -out:$@ $(OUTPRE)kfwlogon.obj $(OUTPRE)kfwcommon.obj -def:kfwlogon.def $(SYSLIBS) $(KLIB) $(CLIB) ../lib/$(OUTPRE)libwin.lib $(LIBRES)
     $(_VC_MANIFEST_EMBED_DLL)
 
 $(KFWCPCC): $(OUTPRE)kfwcpcc.obj $(OUTPRE)kfwcommon.obj $(EXERES)
index da8f18fe42ab4c6ad17602c9ef81ebae26e46628..b7ffbbddeee0b4b40d30aba1c5ff63ad8eb84eee 100644 (file)
@@ -351,7 +351,7 @@ void DebugEvent(char *b,...)
 static HANDLE hInitMutex = NULL;
 static BOOL bInit = FALSE;
 
-/* KFW_initialize cannot be called from DllEntryPoint */
+/* KFW_initialize cannot be called from DllMain */
 void
 KFW_initialize(void)
 {
index 833e26088868ea5abf0dc5fa0badae05bc546232..55dd026d1a38e6107a11ba4acacb897659c229af 100644 (file)
@@ -41,7 +41,7 @@ static HANDLE hInitMutex = NULL;
 static BOOL bInit = FALSE;
 
 
-BOOLEAN APIENTRY DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved)
+BOOLEAN APIENTRY DllMain(HANDLE dll, DWORD reason, PVOID reserved)
 {
     hDLL = dll;
     switch (reason) {
index 85ba1028c237f8f3196c46eb338ad22a87a0a2bc..a2500e7395ce846ee8d9f464721b6033106e0a3b 100644 (file)
@@ -2,7 +2,6 @@ LIBRARY KFWLOGON
 
 EXPORTS
 
-    DllEntryPoint
     NPGetCaps
     NPLogonNotify
     NPPasswordChangeNotify
index 622d5665c6743cf799e8cd6484b018d594af0789..44749cdf7b31a29405f747fd67652f8de5ac12d7 100644 (file)
@@ -165,7 +165,7 @@ cc_free_NC_info,
 
 #define KFW_LOGON_EVENT_NAME TEXT("MIT Kerberos")
 
-BOOLEAN APIENTRY DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved);
+BOOLEAN WINAPI DllMain(HANDLE dll, DWORD reason, PVOID reserved);
 
 DWORD APIENTRY NPGetCaps(DWORD index);