Index: /trunk/Config.kmk
===================================================================
--- /trunk/Config.kmk	(revision 93023)
+++ /trunk/Config.kmk	(revision 93024)
@@ -2213,11 +2213,7 @@
 # Define the macro for win path conversion.
 ifndef VBOX_ONLY_SDK
- if1of (quote,$(KMK_FEATURES))
-  VBOX_FN_MAKE_WIN_PATH = "$(quote-sh-dq $(subst /,\,$(requote unq, $(1))))"
- else
-  VBOX_FN_MAKE_WIN_PATH = $(subst /,\\,$(1))
- endif
+ VBOX_FN_MAKE_WIN_PATH = "$(quote-sh-dq $(subst /,\,$(requote unq, $(1))))"
 else
-  # on Wine Z: is always FS root
+  # Z: is always FS root for Wine.
   VBOX_FN_MAKE_WIN_PATH = $(subst /,\\,$(patsubst /%,Z:/%,$(1)))
 endif #!VBOX_ONLY_SDK
@@ -2378,5 +2374,5 @@
 
 # The Microsoft IDL compiler (the SDK build needs this on non-Windows).
-VBOX_WIN_MIDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard $(addsuffix /[Mm][Ii][Dd][Ll].[Ee][Xx][Ee], \
+VBOX_WIN_MIDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(qfirstfile ,$(qwildcard ,$(qaddsuffix ,/[Mm][Ii][Dd][Ll].[Ee][Xx][Ee], \
 	$(PATH_SDK_$(VBOX_WINPSDK)_BIN) \
 	$(KBUILD_DEVTOOLS)/win.x86/sdk/v7.1/Bin$(if-expr "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "win.amd64",/x64,) \
@@ -2400,4 +2396,31 @@
 VBOX_MIDL_CPP_CMD      = $(lastword $(notdir ,$(subst $(EXEC_X86_WIN32),,$(TOOL_$(VBOX_VCC_TOOL)_CC))))
 VBOX_MIDL_CPP_CMD_X86  = $(lastword $(notdir ,$(subst $(EXEC_X86_WIN32),,$(TOOL_$(VBOX_VCC_TOOL_STEM)X86_CC))))
+
+##
+# Edits $1 and adding #pragma directives for disabling warnings windows.h causes.
+# @param 1     The name of the file to edit.
+define def_VBoxMidlOutputDisableMscWarnings
+	$(QUIET)$(MV) -f "$1" "$1.tmp"
+	$(QUIET)$(APPEND) -nt "$1" \
+		'#if _MSC_VER >= 1920 /* RT_MSC_VER_VS2019 */' \
+		'# pragma warning(disable:5031 5032) /* buggy winioctl.h in some w10 sdks */ ' \
+               '#endif' \
+		'#pragma warning(push) /* -Wall and windows.h */' \
+		'#pragma warning(disable:4668 4255)' \
+		'#if _MSC_VER >= 1800 /* RT_MSC_VER_VC120 */' \
+		'# pragma warning(disable:4005)' \
+		'#endif' \
+		'#if _MSC_VER >= 1900 /* RT_MSC_VER_VC140 */' \
+		'# pragma warning(disable:5039)' \
+		'#endif' \
+               ''
+	$(QUIET)$(CAT_EXT) "$1.tmp" >> "$1"
+	$(QUIET)$(APPEND) -n "$1" \
+		'' \
+		'#pragma warning(pop)' \
+               ''
+	$(QUIET)$(RM) -f "$1.tmp"
+
+endef
 
 # XPCOM setup for all but win32.
Index: /trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk	(revision 93023)
+++ /trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk	(revision 93024)
@@ -354,5 +354,4 @@
 		$(PATH_SUB_CURRENT)/win/nobj/VBoxNetFltNobjT.idl \
 		| $$(dir $$@)
-ifdef KMK_WITH_QUOTING
 	$(VBOX_MIDL_REDIRECT) $(VBOX_WIN_MIDL) /nologo \
 		/out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxNetFltNobj_0_OUTDIR)) \
@@ -360,11 +359,8 @@
 		$(qforeachfile unq, incdir, $(SDK_$(VBOX_WINDDK)_INCS) $(SDK_$(VBOX_WINPSDK)_INCS),/I $(quote-sh $(incdir))) \
 		$(call VBOX_FN_MAKE_WIN_PATH,$<)
-else
-	$(VBOX_MIDL_REDIRECT) $(VBOX_WIN_MIDL) /nologo \
-		/out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxNetFltNobj_0_OUTDIR)) \
-		/cpp_cmd $(VBOX_MIDL_CPP_CMD) \
-		$(foreach incdir, $(SDK_$(VBOX_WINDDK)_INCS) $(SDK_$(VBOX_WINPSDK)_INCS),/I $(call VBOX_FN_MAKE_WIN_PATH,$(incdir)) ) \
-		$(call VBOX_FN_MAKE_WIN_PATH,$<)
-endif
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c)
+
 
  #
Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 93023)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 93024)
@@ -1576,31 +1576,4 @@
 if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
 
- ##
- # Edits $1 and adding #pragma directives for disabling warnings windows.h causes.
- # @param 1     The name of the file to edit.
- define def_VBoxMainDisableMscWarnings
-	$(QUIET)$(MV) -f "$1" "$1.tmp"
-	$(QUIET)$(APPEND) -nt "$1" \
-		'#if _MSC_VER >= 1920 /* RT_MSC_VER_VS2019 */' \
-		'# pragma warning(disable:5031 5032) /* buggy winioctl.h in some w10 sdks */ ' \
-               '#endif' \
-		'#pragma warning(push) /* -Wall and windows.h */' \
-		'#pragma warning(disable:4668 4255)' \
-		'#if _MSC_VER >= 1800 /* RT_MSC_VER_VC120 */' \
-		'# pragma warning(disable:4005)' \
-		'#endif' \
-		'#if _MSC_VER >= 1900 /* RT_MSC_VER_VC140 */' \
-		'# pragma warning(disable:5039)' \
-		'#endif' \
-               ''
-	$(QUIET)$(CAT_EXT) "$1.tmp" >> "$1"
-	$(QUIET)$(APPEND) -n "$1" \
-		'' \
-		'#pragma warning(pop)' \
-               ''
-	$(QUIET)$(RM) -f "$1.tmp"
-
- endef
-
  # Note! Because we've got a different proxy stub DLL for pre windows 7 64-bit hosts, we target windows 7 for AMD64.
  #       The output is different and hopefully more efficient, at least memory wise (using more helpers in OLE32).
@@ -1621,7 +1594,7 @@
 		/I idl \
 		$(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
-	$(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox.h)
-	$(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
-	$(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_p.c)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox.h)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_p.c)
 
  if defined(VBOX_WITH_MIDL_PROXY_STUB)
@@ -1646,7 +1619,7 @@
 		/I idl \
 		$(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
-	$(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h)
-	$(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
-	$(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c)
  endif
 
@@ -1668,7 +1641,7 @@
 		/I idl \
 		$(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
-	$(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h)
-	$(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
-	$(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
+	$(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c)
   endif
 
