Changeset 78608 in vbox for trunk/src/VBox/Additions/WINNT/SharedFolders
- Timestamp:
- May 20, 2019 11:04:08 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 130674
- Location:
- trunk/src/VBox/Additions/WINNT/SharedFolders/driver
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/Makefile.kmk
r78304 r78608 46 46 VBoxSF_LIBS.x86 = \ 47 47 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/rxce.lib \ 48 $( PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/rdbsslib.lib \48 $(VBoxSF_0_OUTDIR)/rdbsslib.lib \ 49 49 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/copysup.lib \ 50 50 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/ntoskrnl.lib \ … … 55 55 VBoxSF_LIBS.amd64 = \ 56 56 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/rxce.lib \ 57 $( PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/rdbsslib.lib \57 $(VBoxSF_0_OUTDIR)/rdbsslib.lib \ 58 58 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/copysup.lib \ 59 59 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/ntoskrnl.lib \ … … 66 66 $(VBOX_LIB_IPRT_GUEST_R0) 67 67 68 VBoxSF_CLEAN = \ 69 $(VBoxSF_0_OUTDIR)/rdbsslib.lib 70 71 68 72 include $(FILE_KBUILD_SUB_FOOTER) 69 73 74 ifeq ($(KBUILD_TARGET_ARCH),x86) 75 $(VBoxSF_0_OUTDIR)/rdbsslib.lib: $$(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib | $$(dir $$@) $(VBOX_EDIT_COFF_LIB) 76 $(VBOX_EDIT_COFF_LIB) --input "$<" --output "$@" \ 77 --select "write.obj" \ 78 --redefine-sym "__imp__CcFlushCache@16=_g_pfnWrFlushCache" \ 79 --redefine-sym "__imp__CcPurgeCacheSection@16=_g_pfnWrPurgeCacheSection" \ 80 --select "read.obj" \ 81 --redefine-sym "__imp__CcFlushCache@16=_g_pfnRdFlushCache" 82 else 83 $(VBoxSF_0_OUTDIR)/rdbsslib.lib: $$(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib | $$(dir $$@) $(VBOX_EDIT_COFF_LIB) 84 $(VBOX_EDIT_COFF_LIB) --input "$<" --output "$@" -v -v -v -v -v -v \ 85 --select "write.obj" \ 86 --redefine-sym "__imp_CcFlushCache=g_pfnWrFlushCache" \ 87 --redefine-sym "__imp_CcPurgeCacheSection=g_pfnWrPurgeCacheSection" \ 88 --select "read.obj" \ 89 --redefine-sym "__imp_CcFlushCache=g_pfnRdFlushCache" 90 endif 91 -
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.cpp
r78585 r78608 30 30 /** How many pages we should try transfer in one I/O request (read/write). */ 31 31 #define VBSF_MAX_IO_PAGES RT_MIN(_16K / sizeof(RTGCPHYS64) /* => 8MB buffer */, VMMDEV_MAX_HGCM_DATA_SIZE >> PAGE_SHIFT) 32 33 34 35 36 /** @name Hacks for using the better CcCoherencyFlushAndPurgeCache when 37 * available (>= Windows 7) and avoid flushing+puring twice. 38 * 39 * We change the cache flushing and purging related imports from the write.obj 40 * and read.obj files in the rdbsslib.lib to import so these gets redirected 41 * here instead of going directly to ntoskrnl. We will use 42 * CcCoherencyFlushAndPurgeCache when present, and on older systems there will 43 * be no change. This does however save us from doing double flushing and 44 * purging on newer systems. 45 * 46 * See VBoxEditCoffLib and the Makefile.kmk for the rest of the puzzle. 47 * 48 * @{ 49 */ 50 51 static VOID NTAPI vbsfNtReadCcFlushCache(PSECTION_OBJECT_POINTERS pSectObjPtrs, PLARGE_INTEGER poffFlush, ULONG cbFlush, 52 PIO_STATUS_BLOCK pIos) 53 { 54 if (g_pfnCcCoherencyFlushAndPurgeCache) 55 g_pfnCcCoherencyFlushAndPurgeCache(pSectObjPtrs, poffFlush, cbFlush, pIos, CC_FLUSH_AND_PURGE_NO_PURGE); 56 else 57 CcFlushCache(pSectObjPtrs, poffFlush, cbFlush, pIos); 58 } 59 60 static VOID NTAPI vbsfNtWriteCcFlushCache(PSECTION_OBJECT_POINTERS pSectObjPtrs, PLARGE_INTEGER poffFlush, ULONG cbFlush, 61 PIO_STATUS_BLOCK pIos) 62 { 63 if (g_pfnCcCoherencyFlushAndPurgeCache) 64 g_pfnCcCoherencyFlushAndPurgeCache(pSectObjPtrs, poffFlush, cbFlush, pIos, 0 /*fFlags*/); 65 else 66 CcFlushCache(pSectObjPtrs, poffFlush, cbFlush, pIos); 67 } 68 69 70 static BOOLEAN NTAPI vbsfNtWriteCcPurgeCacheSection(PSECTION_OBJECT_POINTERS pSectObjPtrs, PLARGE_INTEGER poffPurge,ULONG cbPurge, 71 #if (NTDDI_VERSION >= NTDDI_VISTA) 72 ULONG fUninitializeCacheMaps) 73 #else 74 BOOLEAN fUninitializeCacheMaps) 75 #endif 76 { 77 #if (NTDDI_VERSION >= NTDDI_VISTA) 78 fUninitializeCacheMaps &= 0xff; /* Used to be BOOLEAN before Vista. */ 79 #endif 80 Assert(fUninitializeCacheMaps == 0); 81 BOOLEAN fRet; 82 if (g_pfnCcCoherencyFlushAndPurgeCache) 83 fRet = TRUE; 84 else 85 fRet = CcPurgeCacheSection(pSectObjPtrs, poffPurge, cbPurge, fUninitializeCacheMaps); 86 return fRet; 87 } 88 89 extern "C" { 90 decltype(CcFlushCache) *g_pfnRdFlushCache = vbsfNtReadCcFlushCache; 91 decltype(CcFlushCache) *g_pfnWrFlushCache = vbsfNtWriteCcFlushCache; 92 decltype(CcPurgeCacheSection) *g_pfnWrPurgeCacheSection = vbsfNtWriteCcPurgeCacheSection; 93 } 94 95 /** @} */ 96 32 97 33 98 … … 115 180 pReq->PgLst.offFirstPage = offPage; 116 181 182 #if 0 /* Instead we hook into read.obj's import function pointers to do this more efficiently. */ 117 183 /* 118 184 * Flush dirty cache content before we try read it from the host. RDBSS calls … … 135 201 { RxReleasePagingIoResource(NULL, capFcb); /* requires {} */ } 136 202 } 203 #endif 137 204 138 205 /* … … 377 444 pReq->PgLst.offFirstPage = offPage; 378 445 446 #if 0 /* Instead we hook into write.obj's import function pointers to do this more efficiently. */ 379 447 /* 380 448 * Flush and purge the cache range we're touching upon now, provided we can and … … 395 463 { RxReleasePagingIoResource(NULL, capFcb); /* requires {} */ } 396 464 } 465 #endif 397 466 398 467 /*
Note:
See TracChangeset
for help on using the changeset viewer.