From b9f410b7b85d3948aece3aa009885df244f11e41 Mon Sep 17 00:00:00 2001 From: danmosemsft Date: Sun, 12 Feb 2017 16:51:48 -0800 Subject: Remove never defined FEATURE_FUSION --- src/zap/zapimage.cpp | 94 ---------------------------------------------------- 1 file changed, 94 deletions(-) (limited to 'src/zap/zapimage.cpp') diff --git a/src/zap/zapimage.cpp b/src/zap/zapimage.cpp index 2fbeb03afb..24f081a6f9 100644 --- a/src/zap/zapimage.cpp +++ b/src/zap/zapimage.cpp @@ -1076,75 +1076,6 @@ HANDLE ZapImage::GenerateFile(LPCWSTR wszOutputFileName, CORCOMPILE_NGEN_SIGNATU return hFile; } -#ifdef FEATURE_FUSION -#define WOF_PROVIDER_FILE (0x00000002) - -typedef BOOL (WINAPI *WofShouldCompressBinaries_t) ( - __in LPCWSTR Volume, - __out PULONG Algorithm - ); - -typedef HRESULT (WINAPI *WofSetFileDataLocation_t) ( - __in HANDLE hFile, - __in ULONG Provider, - __in PVOID FileInfo, - __in ULONG Length - ); - -typedef struct _WOF_FILE_COMPRESSION_INFO { - ULONG Algorithm; -} WOF_FILE_COMPRESSION_INFO, *PWOF_FILE_COMPRESSION_INFO; - -// Check if files on the volume identified by volumeLetter should be compressed. -// If yes, compress the file associated with hFile. -static void CompressFile(WCHAR volumeLetter, HANDLE hFile) -{ - if (IsNgenOffline()) - { - return; - } - - // Wofutil.dll is available on Windows 8.1 and above. Return on platforms without wofutil.dll. - HModuleHolder wofLibrary(WszLoadLibraryEx(L"wofutil.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32)); - if (wofLibrary == nullptr) - { - return; - } - - // WofShouldCompressBinaries is available on Windows 10 and above. - // Windows 8.1 version of wofutil.dll does not have this function. - WofShouldCompressBinaries_t WofShouldCompressBinaries - = (WofShouldCompressBinaries_t)GetProcAddress(wofLibrary, "WofShouldCompressBinaries"); - if (WofShouldCompressBinaries == nullptr) - { - return; - } - - WCHAR volume[4] = L"X:\\"; - volume[0] = volumeLetter; - ULONG algorithm = 0; - - bool compressionSuitable = (WofShouldCompressBinaries(volume, &algorithm) == TRUE); - if (compressionSuitable) - { - // WofSetFileDataLocation is available on Windows 8.1 and above, however, Windows 8.1 version - // of WofSetFileDataLocation works for WIM only, and Windows 10 is required for compression of - // normal files. This isn't a problem for us, since the check for WofShouldCompressBinaries - // above should have already returned on Windows 8.1. - WofSetFileDataLocation_t WofSetFileDataLocation = - (WofSetFileDataLocation_t)GetProcAddress(wofLibrary, "WofSetFileDataLocation"); - if (WofSetFileDataLocation == nullptr) - { - return; - } - - WOF_FILE_COMPRESSION_INFO fileInfo; - fileInfo.Algorithm = algorithm; - - WofSetFileDataLocation(hFile, WOF_PROVIDER_FILE, &fileInfo, sizeof(WOF_FILE_COMPRESSION_INFO)); - } -} -#endif HANDLE ZapImage::SaveImage(LPCWSTR wszOutputFileName, CORCOMPILE_NGEN_SIGNATURE * pNativeImageSig) { @@ -1173,9 +1104,6 @@ HANDLE ZapImage::SaveImage(LPCWSTR wszOutputFileName, CORCOMPILE_NGEN_SIGNATURE HANDLE hFile = GenerateFile(wszOutputFileName, pNativeImageSig); -#ifdef FEATURE_FUSION - CompressFile(wszOutputFileName[0], hFile); -#endif return hFile; } @@ -1392,28 +1320,6 @@ void ZapImage::Open(CORINFO_MODULE_HANDLE hModule, m_ModuleDecoder = *m_zapper->m_pEECompileInfo->GetModuleDecoder(hModule); -#ifdef FEATURE_FUSION - // If TranslatePEToArchitectureType fails then we have an invalid format - DWORD dwPEKind, dwMachine; - m_ModuleDecoder.GetPEKindAndMachine(&dwPEKind, &dwMachine); - - PEKIND PeKind; - IfFailThrow(TranslatePEToArchitectureType((CorPEKind)dwPEKind, dwMachine, &PeKind)); - - // Valid images for this platform are peMSIL and the native image for the platform - if (!(PeKind == peMSIL -#if defined(_TARGET_AMD64_) - || PeKind == peAMD64 -#elif defined(_TARGET_X86_) - || PeKind == peI386 -#elif defined(_TARGET_ARM_) - || PeKind == peARM -#endif - )) - { - ThrowHR(NGEN_E_EXE_MACHINE_TYPE_MISMATCH); - } -#endif // FEATURE_FUSION // // Get file name, and base address from module -- cgit v1.2.3