[mingw] use delay loading for DLLs that are subject to side loading
* This reverts much of commits f6ac559f4d0a9a2e5043a972442d272c2da71de3 and 19472668370aacec0dba9dda306601cfc4a4ed7e
so that we call the Windows APIs directly again, while ensuring that, by the time we load the DLLs,
sideloading mitigation has already been applied by the application.
* This is a continuation of #1877, and should help prevent re-introducing side-loading issues when we
link against new libraries, as well as allow us to drop some of the manual DLL hooking we've been
doing to prevent it, to clean up the code.
* Note that this is a bit more complex than what the stackoverflow post suggests, because we need to
create delayloaded libs for both 32-bit and 64-bit, which use a different calling convention and
therefore need to use different .def files. So there's a lot of gymkhana involved, with Makefiles
and whatnot, to get us there.
* Also simplify the use of CM_Get_DevNode_Registry_PropertyA() in dev.c since recent versions of
MinGW now have support for it.
* Also fix 2 small issues in net.c (potential overflow) and format.c (memory leak).
2022-04-12 10:09:29 +00:00
|
|
|
# Makefile.in generated by automake 1.14.1 from Makefile.am.
|
|
|
|
# @configure_input@
|
|
|
|
|
|
|
|
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
# This Makefile.in is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
|
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
# PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
@SET_MAKE@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
|
|
|
am__make_running_with_option = \
|
|
|
|
case $${target_option-} in \
|
|
|
|
?) ;; \
|
|
|
|
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
|
|
"target option '$${target_option-}' specified" >&2; \
|
|
|
|
exit 1;; \
|
|
|
|
esac; \
|
|
|
|
has_opt=no; \
|
|
|
|
sane_makeflags=$$MAKEFLAGS; \
|
|
|
|
if $(am__is_gnu_make); then \
|
|
|
|
sane_makeflags=$$MFLAGS; \
|
|
|
|
else \
|
|
|
|
case $$MAKEFLAGS in \
|
|
|
|
*\\[\ \ ]*) \
|
|
|
|
bs=\\; \
|
|
|
|
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
|
|
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
|
|
esac; \
|
|
|
|
fi; \
|
|
|
|
skip_next=no; \
|
|
|
|
strip_trailopt () \
|
|
|
|
{ \
|
|
|
|
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
|
|
}; \
|
|
|
|
for flg in $$sane_makeflags; do \
|
|
|
|
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
|
|
case $$flg in \
|
|
|
|
*=*|--*) continue;; \
|
|
|
|
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
|
|
-*I?*) strip_trailopt 'I';; \
|
|
|
|
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
|
|
-*O?*) strip_trailopt 'O';; \
|
|
|
|
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
|
|
-*l?*) strip_trailopt 'l';; \
|
|
|
|
-[dEDm]) skip_next=yes;; \
|
|
|
|
-[JT]) skip_next=yes;; \
|
|
|
|
esac; \
|
|
|
|
case $$flg in \
|
|
|
|
*$$target_option*) has_opt=yes; break;; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
test $$has_opt = yes
|
|
|
|
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
|
|
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
|
|
pkgdatadir = $(datadir)/@PACKAGE@
|
|
|
|
pkgincludedir = $(includedir)/@PACKAGE@
|
|
|
|
pkglibdir = $(libdir)/@PACKAGE@
|
|
|
|
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
|
|
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
|
|
install_sh_DATA = $(install_sh) -c -m 644
|
|
|
|
install_sh_PROGRAM = $(install_sh) -c
|
|
|
|
install_sh_SCRIPT = $(install_sh) -c
|
|
|
|
INSTALL_HEADER = $(INSTALL_DATA)
|
|
|
|
transform = $(program_transform_name)
|
|
|
|
NORMAL_INSTALL = :
|
|
|
|
PRE_INSTALL = :
|
|
|
|
POST_INSTALL = :
|
|
|
|
NORMAL_UNINSTALL = :
|
|
|
|
PRE_UNINSTALL = :
|
|
|
|
POST_UNINSTALL = :
|
|
|
|
subdir = .mingw
|
|
|
|
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
|
|
|
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
|
|
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
|
|
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
|
|
$(ACLOCAL_M4)
|
|
|
|
mkinstalldirs = $(install_sh) -d
|
|
|
|
CONFIG_CLEAN_FILES =
|
|
|
|
CONFIG_CLEAN_VPATH_FILES =
|
|
|
|
AM_V_P = $(am__v_P_@AM_V@)
|
|
|
|
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
|
|
am__v_P_0 = false
|
|
|
|
am__v_P_1 = :
|
|
|
|
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
|
|
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
|
|
am__v_GEN_0 = @echo " GEN " $@;
|
|
|
|
am__v_GEN_1 =
|
|
|
|
AM_V_at = $(am__v_at_@AM_V@)
|
|
|
|
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
|
|
am__v_at_0 = @
|
|
|
|
am__v_at_1 =
|
|
|
|
depcomp =
|
|
|
|
am__depfiles_maybe =
|
|
|
|
SOURCES =
|
|
|
|
am__can_run_installinfo = \
|
|
|
|
case $$AM_UPDATE_INFO_DIR in \
|
|
|
|
n|no|NO) false;; \
|
|
|
|
*) (install-info --version) >/dev/null 2>&1;; \
|
|
|
|
esac
|
|
|
|
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
|
|
ACLOCAL = @ACLOCAL@
|
|
|
|
AMTAR = @AMTAR@
|
|
|
|
AM_CFLAGS = @AM_CFLAGS@
|
|
|
|
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
|
|
AM_LDFLAGS = @AM_LDFLAGS@
|
|
|
|
AR = @AR@
|
|
|
|
AUTOCONF = @AUTOCONF@
|
|
|
|
AUTOHEADER = @AUTOHEADER@
|
|
|
|
AUTOMAKE = @AUTOMAKE@
|
|
|
|
AWK = @AWK@
|
|
|
|
CC = @CC@
|
|
|
|
CFLAGS = @CFLAGS@
|
|
|
|
CPPFLAGS = @CPPFLAGS@
|
|
|
|
CYGPATH_W = @CYGPATH_W@
|
|
|
|
DEFS = @DEFS@
|
|
|
|
DLLTOOL = @DLLTOOL@
|
|
|
|
ECHO_C = @ECHO_C@
|
|
|
|
ECHO_N = @ECHO_N@
|
|
|
|
ECHO_T = @ECHO_T@
|
|
|
|
EXEEXT = @EXEEXT@
|
|
|
|
INSTALL = @INSTALL@
|
|
|
|
INSTALL_DATA = @INSTALL_DATA@
|
|
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
|
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
|
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
|
|
LDFLAGS = @LDFLAGS@
|
|
|
|
LIBOBJS = @LIBOBJS@
|
|
|
|
LIBS = @LIBS@
|
|
|
|
LTLIBOBJS = @LTLIBOBJS@
|
|
|
|
MAKEINFO = @MAKEINFO@
|
|
|
|
MKDIR_P = @MKDIR_P@
|
|
|
|
OBJEXT = @OBJEXT@
|
|
|
|
PACKAGE = @PACKAGE@
|
|
|
|
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
|
|
PACKAGE_NAME = @PACKAGE_NAME@
|
|
|
|
PACKAGE_STRING = @PACKAGE_STRING@
|
|
|
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
|
|
PACKAGE_URL = @PACKAGE_URL@
|
|
|
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
|
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
|
|
RANLIB = @RANLIB@
|
|
|
|
RM = @RM@
|
|
|
|
SED = @SED@
|
|
|
|
SET_MAKE = @SET_MAKE@
|
|
|
|
SHELL = @SHELL@
|
|
|
|
STRIP = @STRIP@
|
|
|
|
SUFFIX = @SUFFIX@
|
|
|
|
VERSION = @VERSION@
|
|
|
|
VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@
|
|
|
|
WINDRES = @WINDRES@
|
|
|
|
abs_builddir = @abs_builddir@
|
|
|
|
abs_srcdir = @abs_srcdir@
|
|
|
|
abs_top_builddir = @abs_top_builddir@
|
|
|
|
abs_top_srcdir = @abs_top_srcdir@
|
|
|
|
ac_ct_CC = @ac_ct_CC@
|
|
|
|
am__leading_dot = @am__leading_dot@
|
|
|
|
am__tar = @am__tar@
|
|
|
|
am__untar = @am__untar@
|
|
|
|
bindir = @bindir@
|
|
|
|
build_alias = @build_alias@
|
|
|
|
builddir = @builddir@
|
|
|
|
datadir = @datadir@
|
|
|
|
datarootdir = @datarootdir@
|
|
|
|
docdir = @docdir@
|
|
|
|
dvidir = @dvidir@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
host_alias = @host_alias@
|
|
|
|
htmldir = @htmldir@
|
|
|
|
includedir = @includedir@
|
|
|
|
infodir = @infodir@
|
|
|
|
install_sh = @install_sh@
|
|
|
|
libdir = @libdir@
|
|
|
|
libexecdir = @libexecdir@
|
|
|
|
localedir = @localedir@
|
|
|
|
localstatedir = @localstatedir@
|
|
|
|
mandir = @mandir@
|
|
|
|
mkdir_p = @mkdir_p@
|
|
|
|
oldincludedir = @oldincludedir@
|
|
|
|
pdfdir = @pdfdir@
|
|
|
|
prefix = @prefix@
|
|
|
|
program_transform_name = @program_transform_name@
|
|
|
|
psdir = @psdir@
|
|
|
|
runstatedir = @runstatedir@
|
|
|
|
sbindir = @sbindir@
|
|
|
|
sharedstatedir = @sharedstatedir@
|
|
|
|
srcdir = @srcdir@
|
|
|
|
sysconfdir = @sysconfdir@
|
|
|
|
target_alias = @target_alias@
|
|
|
|
top_build_prefix = @top_build_prefix@
|
|
|
|
top_builddir = @top_builddir@
|
|
|
|
top_srcdir = @top_srcdir@
|
|
|
|
|
|
|
|
# Create delay-loaded libraries from a DLL, that aren't vulnerable to side-loading
|
|
|
|
AM_V_DLLTOOL_0 = @echo " LIB $@";$(DLLTOOL)
|
|
|
|
AM_V_DLLTOOL_1 = $(DLLTOOL)
|
|
|
|
AM_V_DLLTOOL_ = $(AM_V_DLLTOOL_$(AM_DEFAULT_VERBOSITY))
|
|
|
|
AM_V_DLLTOOL = $(AM_V_DLLTOOL_$(V))
|
|
|
|
AM_V_SED_0 = @echo " SED $<";$(SED)
|
|
|
|
AM_V_SED_1 = $(SED)
|
|
|
|
AM_V_SED_ = $(AM_V_SED_$(AM_DEFAULT_VERBOSITY))
|
|
|
|
AM_V_SED = $(AM_V_SED_$(V))
|
|
|
|
|
|
|
|
# Ah the joys of Windows DLL calling conventions, that require an @## suffix in the .def
|
|
|
|
# for x86_32 and but no @## for x86_64, thereby forcing us to strip stuff according to the
|
|
|
|
# target arch. Oh, and we can't use 'target_cpu' or AC definitions on account that we are
|
|
|
|
# switching archs when building on our local machine, and don't want to have to go though
|
|
|
|
# a costly reconf each time when we can simply issue a 'make clean'.
|
|
|
|
TUPLE := $(shell $(CC) -dumpmachine)
|
|
|
|
TARGET := $(word 1,$(subst -, ,$(TUPLE)))
|
|
|
|
DEF_SUFFIX := $(if $(TARGET:x86_64=),.def,.def64)
|
|
|
|
all: all-am
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
|
|
|
@for dep in $?; do \
|
|
|
|
case '$(am__configure_deps)' in \
|
|
|
|
*$$dep*) \
|
|
|
|
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
|
|
|
&& { if test -f $@; then exit 0; else break; fi; }; \
|
|
|
|
exit 1;; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps .mingw/Makefile'; \
|
|
|
|
$(am__cd) $(top_srcdir) && \
|
|
|
|
$(AUTOMAKE) --foreign --ignore-deps .mingw/Makefile
|
|
|
|
.PRECIOUS: Makefile
|
|
|
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
|
|
@case '$?' in \
|
|
|
|
*config.status*) \
|
|
|
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|
|
|
*) \
|
|
|
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
|
|
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
|
|
|
esac;
|
|
|
|
|
|
|
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
|
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
|
|
|
|
|
|
$(top_srcdir)/configure: $(am__configure_deps)
|
|
|
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
|
|
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
|
|
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
|
|
$(am__aclocal_m4_deps):
|
|
|
|
tags TAGS:
|
|
|
|
|
|
|
|
ctags CTAGS:
|
|
|
|
|
|
|
|
cscope cscopelist:
|
|
|
|
|
|
|
|
check-am: all-am
|
|
|
|
check: check-am
|
|
|
|
all-am: Makefile
|
|
|
|
installdirs:
|
|
|
|
install: install-am
|
|
|
|
install-exec: install-exec-am
|
|
|
|
install-data: install-data-am
|
|
|
|
uninstall: uninstall-am
|
|
|
|
|
|
|
|
install-am: all-am
|
|
|
|
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
|
|
|
|
|
|
installcheck: installcheck-am
|
|
|
|
install-strip:
|
|
|
|
if test -z '$(STRIP)'; then \
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
|
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
|
|
install; \
|
|
|
|
else \
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
|
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
|
|
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
|
|
fi
|
|
|
|
mostlyclean-generic:
|
|
|
|
|
|
|
|
clean-generic:
|
|
|
|
|
|
|
|
distclean-generic:
|
|
|
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
|
|
|
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
|
|
|
|
|
|
|
maintainer-clean-generic:
|
|
|
|
@echo "This command is intended for maintainers to use"
|
|
|
|
@echo "it deletes files that may require special tools to rebuild."
|
|
|
|
clean-am: clean-generic mostlyclean-am
|
|
|
|
|
|
|
|
distclean: distclean-am
|
|
|
|
-rm -f Makefile
|
|
|
|
distclean-am: clean-am distclean-generic
|
|
|
|
|
|
|
|
dvi: dvi-am
|
|
|
|
|
|
|
|
dvi-am:
|
|
|
|
|
|
|
|
html: html-am
|
|
|
|
|
|
|
|
html-am:
|
|
|
|
|
|
|
|
info: info-am
|
|
|
|
|
|
|
|
info-am:
|
|
|
|
|
|
|
|
install-data-am:
|
|
|
|
|
|
|
|
install-dvi: install-dvi-am
|
|
|
|
|
|
|
|
install-dvi-am:
|
|
|
|
|
|
|
|
install-exec-am:
|
|
|
|
|
|
|
|
install-html: install-html-am
|
|
|
|
|
|
|
|
install-html-am:
|
|
|
|
|
|
|
|
install-info: install-info-am
|
|
|
|
|
|
|
|
install-info-am:
|
|
|
|
|
|
|
|
install-man:
|
|
|
|
|
|
|
|
install-pdf: install-pdf-am
|
|
|
|
|
|
|
|
install-pdf-am:
|
|
|
|
|
|
|
|
install-ps: install-ps-am
|
|
|
|
|
|
|
|
install-ps-am:
|
|
|
|
|
|
|
|
installcheck-am:
|
|
|
|
|
|
|
|
maintainer-clean: maintainer-clean-am
|
|
|
|
-rm -f Makefile
|
|
|
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
|
|
|
|
|
|
mostlyclean: mostlyclean-am
|
|
|
|
|
|
|
|
mostlyclean-am: mostlyclean-generic
|
|
|
|
|
|
|
|
pdf: pdf-am
|
|
|
|
|
|
|
|
pdf-am:
|
|
|
|
|
|
|
|
ps: ps-am
|
|
|
|
|
|
|
|
ps-am:
|
|
|
|
|
|
|
|
uninstall-am:
|
|
|
|
|
|
|
|
.MAKE: install-am install-strip
|
|
|
|
|
|
|
|
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
|
|
|
|
ctags-am distclean distclean-generic dvi dvi-am html html-am \
|
|
|
|
info info-am install install-am install-data install-data-am \
|
|
|
|
install-dvi install-dvi-am install-exec install-exec-am \
|
|
|
|
install-html install-html-am install-info install-info-am \
|
|
|
|
install-man install-pdf install-pdf-am install-ps \
|
|
|
|
install-ps-am install-strip installcheck installcheck-am \
|
|
|
|
installdirs maintainer-clean maintainer-clean-generic \
|
|
|
|
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags-am \
|
|
|
|
uninstall uninstall-am
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
2023-04-28 16:46:05 +00:00
|
|
|
all: dwmapi-delaylib.lib virtdisk-delaylib.lib wintrust-delaylib.lib
|
[mingw] use delay loading for DLLs that are subject to side loading
* This reverts much of commits f6ac559f4d0a9a2e5043a972442d272c2da71de3 and 19472668370aacec0dba9dda306601cfc4a4ed7e
so that we call the Windows APIs directly again, while ensuring that, by the time we load the DLLs,
sideloading mitigation has already been applied by the application.
* This is a continuation of #1877, and should help prevent re-introducing side-loading issues when we
link against new libraries, as well as allow us to drop some of the manual DLL hooking we've been
doing to prevent it, to clean up the code.
* Note that this is a bit more complex than what the stackoverflow post suggests, because we need to
create delayloaded libs for both 32-bit and 64-bit, which use a different calling convention and
therefore need to use different .def files. So there's a lot of gymkhana involved, with Makefiles
and whatnot, to get us there.
* Also simplify the use of CM_Get_DevNode_Registry_PropertyA() in dev.c since recent versions of
MinGW now have support for it.
* Also fix 2 small issues in net.c (potential overflow) and format.c (memory leak).
2022-04-12 10:09:29 +00:00
|
|
|
|
|
|
|
%.def64: %.def
|
|
|
|
$(AM_V_SED) "s/@.*//" $< >$@
|
|
|
|
|
|
|
|
%-delaylib.lib: %$(DEF_SUFFIX)
|
|
|
|
$(AM_V_DLLTOOL) --input-def $< --output-delaylib $@ --dllname $(basename $<).dll
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) -rf *.lib
|
|
|
|
|
|
|
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
|
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
|
|
.NOEXPORT:
|