summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MANIFEST1
-rw-r--r--win32/Makefile17
-rw-r--r--win32/makefile.mk21
-rwxr-xr-xwin32/perlexe.manifest18
-rw-r--r--win32/perlexe.rc7
-rw-r--r--win32/win32.c11
6 files changed, 65 insertions, 10 deletions
diff --git a/MANIFEST b/MANIFEST
index 1a7d10ee32..77abbd3e1f 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -4699,6 +4699,7 @@ win32/Makefile.ce WinCE port
win32/makefile.mk Win32 makefile for DMAKE (BC++, VC++ builds)
win32/mdelete.bat multifile delete
win32/perlexe.ico perlexe.ico image file
+win32/perlexe.manifest Assembly manifest file
win32/perlexe.rc associated perl binary with icon
win32/perlglob.c Win32 port
win32/perlhost.h Perl "host" implementation
diff --git a/win32/Makefile b/win32/Makefile
index 7d7b012d2b..b184482422 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -489,7 +489,7 @@ LIBBASEFILES = $(CRYPT_LIB) \
oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib \
- version.lib odbc32.lib odbccp32.lib
+ version.lib odbc32.lib odbccp32.lib comctl32.lib
# The 64 bit Platform SDK compilers contain a runtime library that doesn't
# include the buffer overrun verification code used by the /GS switch.
@@ -515,6 +515,14 @@ EXEOUT_FLAG = -Fe
CFLAGS_O = $(CFLAGS) $(BUILDOPT)
+!IF "$(CCTYPE)" == "MSVC80" || "$(CCTYPE)" == "MSVC80FREE" || \
+ "$(CCTYPE)" == "MSVC90" || "$(CCTYPE)" == "MSVC90FREE"
+LINK_FLAGS = $(LINK_FLAGS) "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
+!ELSE
+RSC_FLAGS = -DINCLUDE_MANIFEST
+!ENDIF
+
+
#################### do not edit below this line #######################
############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
@@ -538,7 +546,7 @@ $(o).dll:
$(EMBED_DLL_MANI)
.rc.res:
- $(RSC) -i.. $<
+ $(RSC) -i.. $(RSC_FLAGS) $<
#
# various targets
@@ -576,6 +584,7 @@ UNIDATAFILES = ..\lib\unicore\Canonical.pl ..\lib\unicore\Exact.pl \
UNIDATADIR1 = ..\lib\unicore\To
UNIDATADIR2 = ..\lib\unicore\lib
+PERLEXE_MANIFEST= .\perlexe.manifest
PERLEXE_ICO = .\perlexe.ico
PERLEXE_RES = .\perlexe.res
PERLDLL_RES =
@@ -955,7 +964,7 @@ $(PERLSTATICLIB): Extensions_static
<<
$(XCOPY) $(PERLSTATICLIB) $(COREDIR)
-$(PERLEXE_RES): perlexe.rc $(PERLEXE_ICO)
+$(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO)
$(MINIMOD) : $(MINIPERL) ..\minimod.pl
cd ..
@@ -1195,7 +1204,7 @@ distclean: realclean
-del /f ..\lib\Config_git.pl
-del /f bin\*.bat
-del /f perllibst.h
- -del /f perl.base
+ -del /f $(PERLEXE_RES) perl.base
-cd .. && del /s *.lib *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib ppport.h
-cd $(EXTDIR) && del /s *.def Makefile Makefile.old
-cd $(DISTDIR) && del /s *.def Makefile Makefile.old
diff --git a/win32/makefile.mk b/win32/makefile.mk
index f50a18c5d8..960589ff0b 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -467,7 +467,7 @@ LIBFILES = $(CRYPT_LIB) \
kernel32.lib user32.lib gdi32.lib winspool.lib \
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib \
- version.lib odbc32.lib odbccp32.lib \
+ version.lib odbc32.lib odbccp32.lib comctl32.lib \
import32.lib $(LIBC)
.IF "$(CFG)" == "Debug"
@@ -535,7 +535,7 @@ LIBFILES = $(CRYPT_LIB) $(LIBC) \
-lmoldname -lkernel32 -luser32 -lgdi32 \
-lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
-loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr \
- -lwinmm -lversion -lodbc32 -lodbccp32
+ -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
.IF "$(CFG)" == "Debug"
OPTIMIZE = -g -O2 -DDEBUGGING
@@ -661,6 +661,14 @@ LIBOUT_FLAG = /out:
CFLAGS_O = $(CFLAGS) $(BUILDOPT)
+.IF "$(CCTYPE)" == "MSVC80" || "$(CCTYPE)" == "MSVC80FREE" || \
+ "$(CCTYPE)" == "MSVC90" || "$(CCTYPE)" == "MSVC90FREE"
+LINK_FLAGS = $(LINK_FLAGS) "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
+.ELSE
+RSC_FLAGS = -DINCLUDE_MANIFEST
+.ENDIF
+
+
# used to allow local linking flags that are not propogated into Config.pm,
# currently unused
# -- BKS, 12-12-1999
@@ -717,9 +725,9 @@ $(o).dll:
.rc.res:
.IF "$(CCTYPE)" == "GCC"
- $(RSC) --use-temp-file --include-dir=. --include-dir=.. -O COFF -i $< -o $@
+ $(RSC) --use-temp-file --include-dir=. --include-dir=.. -O COFF -D INCLUDE_MANIFEST -i $< -o $@
.ELSE
- $(RSC) -i.. $<
+ $(RSC) -i.. -DINCLUDE_MANIFEST $<
.ENDIF
#
@@ -750,6 +758,7 @@ UNIDATAFILES = ..\lib\unicore\Canonical.pl ..\lib\unicore\Exact.pl \
UNIDATADIR1 = ..\lib\unicore\To
UNIDATADIR2 = ..\lib\unicore\lib
+PERLEXE_MANIFEST= .\perlexe.manifest
PERLEXE_ICO = .\perlexe.ico
PERLEXE_RES = .\perlexe.res
PERLDLL_RES =
@@ -1298,7 +1307,7 @@ $(PERLSTATICLIB): Extensions_static
.ENDIF
$(XCOPY) $(PERLSTATICLIB) $(COREDIR)
-$(PERLEXE_RES): perlexe.rc $(PERLEXE_ICO)
+$(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO)
$(MINIMOD) : $(MINIPERL) ..\minimod.pl
cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
@@ -1568,7 +1577,7 @@ distclean: realclean
-del /f ..\lib\Config_git.pl
-del /f bin\*.bat
-del /f perllibst.h
- -del /f perl.base
+ -del /f $(PERLEXE_RES) perl.base
-cd .. && del /s *$(a) *.map *.pdb *.ilk *.tds *.bs *$(o) .exists pm_to_blib ppport.h
-cd $(EXTDIR) && del /s *.def Makefile Makefile.old
-cd $(DISTDIR) && del /s *.def Makefile Makefile.old
diff --git a/win32/perlexe.manifest b/win32/perlexe.manifest
new file mode 100755
index 0000000000..24ee19dca4
--- /dev/null
+++ b/win32/perlexe.manifest
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity version="0.0.0.0" name="Perl" type="Win32" />
+ <description>Perl</description>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0"
+ processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/win32/perlexe.rc b/win32/perlexe.rc
index 627b8576b2..c22797826c 100644
--- a/win32/perlexe.rc
+++ b/win32/perlexe.rc
@@ -1 +1,8 @@
PERLEXE ICON perlexe.ico
+
+#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
+#define RT_MANIFEST 24
+
+#ifdef INCLUDE_MANIFEST
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "perlexe.manifest"
+#endif
diff --git a/win32/win32.c b/win32/win32.c
index 050c50cfec..d583087d42 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -22,6 +22,7 @@
# define WC_NO_BEST_FIT_CHARS 0x00000400 /* requires Windows 2000 or later */
#endif
#include <winnt.h>
+#include <commctrl.h>
#include <tlhelp32.h>
#include <io.h>
#include <signal.h>
@@ -4800,6 +4801,16 @@ Perl_win32_init(int *argcp, char ***argvp)
{
HMODULE module;
+ /* When the manifest resource requests Common-Controls v6 then
+ * user32.dll no longer registers all the Windows classes used for
+ * standard controls but leaves some of them to be registered by
+ * comctl32.dll. InitCommonControls() doesn't do anything but calling
+ * it makes sure comctl32.dll gets loaded into the process and registers
+ * the standard control classes. Without this even normal Windows APIs
+ * like MessageBox() can fail under some versions of Windows XP.
+ */
+ InitCommonControls();
+
#ifdef SET_INVALID_PARAMETER_HANDLER
_invalid_parameter_handler oldHandler, newHandler;
newHandler = my_invalid_parameter_handler;