VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/SharedFolders/driver/Makefile.kmk@ 90885

Last change on this file since 90885 was 84972, checked in by vboxsync, 5 years ago

Additions/WINNT/SharedFolders: Provide a dedicated 32bit VBoxSF driver for Windows <= 7 linked against the W2K3 DDK rdbss.lib and link the default one against the WHL version for Windows >= 8

The reason for shipping two binaries now is that the mmap FsPerf tests failed under certain circumstances, FlushViewOfFile() would return ERROR_INVALID_PARAMETER.
This only happens when the file is opened readonly first, and then opened read/write again while the first open is still active. The test would go on creating
a mapping of the file using the read/write handle, close both handles and then modify the mapping. Upon flushing the mapping ERROR_INVALID_PARAMETER is returned
because RDBSS passes the readonly file handle to our shared folder driver which the host shared folder service complains about rightfully because it is readonly.
The request returns VERR_INVALID_HANDLE for the write which gets translated to ERROR_INVALID_PARAMETER.
This only happens on 32bit Windows 8 and newer when linked against the W2K3 rdbss.lib, the reason is unknown.
Using the WHL version solves this and to not run into weird compatibility issues on older versions we ship two variants now and the installer decides during
install time which one is used.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1# $Id: Makefile.kmk 84972 2020-06-26 14:58:51Z vboxsync $
2## @file
3# Sub-Makefile for the VirtualBox Windows Guest Shared Folders FSD.
4#
5
6#
7# Copyright (C) 2006-2020 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# VBoxSF
23#
24SYSMODS += VBoxSF
25VBoxSF_TEMPLATE = VBOXGUESTR0
26VBoxSF_DEFS = LOG_TO_BACKDOOR VBOX_WITH_HGCM IN_RING0
27#VBoxSF_DEFS += LOG_ENABLED
28
29VBoxSF_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_GST_WLH)
30
31VBoxSF_LDFLAGS.x86 = -Entry:DriverEntry@8
32VBoxSF_LDFLAGS.amd64 = -Entry:DriverEntry
33VBoxSF_SOURCES = \
34 vbsf.cpp \
35 net.cpp \
36 file.cpp \
37 info.cpp \
38 path.cpp \
39 vbsfhlp.cpp \
40 VBoxSF.rc
41VBoxSF_SOURCES.x86 = \
42 Win2kWorkarounds.c \
43 Win2kWorkaroundsA.asm
44
45VBoxSF_LIBS = \
46 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/rxce.lib \
47 $(VBoxSF_0_OUTDIR)/rdbsslib.lib \
48 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/copysup.lib \
49 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/ntoskrnl.lib \
50 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/hal.lib \
51 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/ksecdd.lib \
52 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/BufferOverflowK.lib \
53 \
54 $(VBOX_LIB_VBGL_R0) \
55 $(VBOX_LIB_IPRT_GUEST_R0)
56
57VBoxSF_CLEAN = \
58 $(VBoxSF_0_OUTDIR)/rdbsslib.lib
59
60
61ifeq ($(KBUILD_TARGET_ARCH),x86)
62 SYSMODS += VBoxSFW2K
63
64 VBoxSFW2K_EXTENDS := VBoxSF
65 VBoxSFW2K_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_GST_W2K3)
66 VBoxSFW2K_LIBS = \
67 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/rxce.lib \
68 $(VBoxSFW2K_0_OUTDIR)/rdbsslib.lib \
69 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/copysup.lib \
70 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/ntoskrnl.lib \
71 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/hal.lib \
72 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/ksecdd.lib \
73 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/BufferOverflowK.lib \
74 \
75 $(VBOX_LIB_VBGL_R0) \
76 $(VBOX_LIB_IPRT_GUEST_R0)
77 VBoxSFW2K_CLEAN = \
78 $(VBoxSFW2K_0_OUTDIR)/rdbsslib.lib
79endif
80
81include $(FILE_KBUILD_SUB_FOOTER)
82
83$(call KB_FN_AUTO_CMD_DEPS,$(VBoxSF_0_OUTDIR)/rdbsslib.lib)
84
85ifeq ($(KBUILD_TARGET_ARCH),x86)
86$(VBoxSF_0_OUTDIR)/rdbsslib.lib: $$(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib | $$(dir $$@) $(VBOX_EDIT_COFF_LIB)
87 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
88 $(VBOX_EDIT_COFF_LIB) --input "$(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib" --output "$@" \
89 --select "write.obj" \
90 --redefine-sym "__imp__CcFlushCache@16=_g_pfnWrFlushCache" \
91 --redefine-sym "__imp__CcPurgeCacheSection@16=_g_pfnWrPurgeCacheSection" \
92 --select "read.obj" \
93 --redefine-sym "__imp__CcFlushCache@16=_g_pfnRdFlushCache"
94
95$(call KB_FN_AUTO_CMD_DEPS,$(VBoxSFW2K_0_OUTDIR)/rdbsslib.lib)
96$(VBoxSFW2K_0_OUTDIR)/rdbsslib.lib: $$(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib | $$(dir $$@) $(VBOX_EDIT_COFF_LIB)
97 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
98 $(VBOX_EDIT_COFF_LIB) --input "$(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib" --output "$@" \
99 --select "write.obj" \
100 --redefine-sym "__imp__CcFlushCache@16=_g_pfnWrFlushCache" \
101 --redefine-sym "__imp__CcPurgeCacheSection@16=_g_pfnWrPurgeCacheSection" \
102 --select "read.obj" \
103 --redefine-sym "__imp__CcFlushCache@16=_g_pfnRdFlushCache"
104else
105$(VBoxSF_0_OUTDIR)/rdbsslib.lib: $$(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib | $$(dir $$@) $(VBOX_EDIT_COFF_LIB)
106 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
107 $(VBOX_EDIT_COFF_LIB) --input "$(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib" --output "$@" \
108 --select "write.obj" \
109 --redefine-sym "__imp_CcFlushCache=g_pfnWrFlushCache" \
110 --redefine-sym "__imp_CcPurgeCacheSection=g_pfnWrPurgeCacheSection" \
111 --select "read.obj" \
112 --redefine-sym "__imp_CcFlushCache=g_pfnRdFlushCache"
113endif
114
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette