1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
6 #include "stdafx.h" // Precompiled header key.
10 #include "pedecoder.h"
17 GetFileVersionInfoSizeW_NoThrow(
18 LPCWSTR lptstrFilename, /* Filename of version stamped file */
27 dwRet=GetFileVersionInfoSize( (LPWSTR)lptstrFilename, lpdwHandle );
37 GetFileVersionInfoW_NoThrow(
38 LPCWSTR lptstrFilename, /* Filename of version stamped file */
39 DWORD dwHandle, /* Information from GetFileVersionSize */
40 DWORD dwLen, /* Length of buffer for info */
49 bRet=GetFileVersionInfo( (LPWSTR)lptstrFilename, dwHandle,dwLen,lpData );
59 VerQueryValueW_NoThrow(
71 bRet=VerQueryValueW( pBlock, (LPWSTR)lpSubBlock,lplpBuffer,puLen );
80 #if !defined(FEATURE_CORECLR) && !defined(CROSSGEN_COMPILE)
81 // The following functions are not used in CoreCLR. Normally LINKER can remove these functions
82 // from generated files. But LINKER does it in two steps:
83 // 1. If no function in a source file is used, the file is ignored by LINKER
84 // 2. If one function is used, LINKER will first make sure all imported functions in the file
85 // is available, and then it will remove unused functions.
86 // Instead of specifying all libs for imported functions needed by the following codes, we just
87 // remove them from compiling phase.
90 CreateUrlCacheEntryW_NoThrow(
91 IN LPCWSTR lpszUrlName,
92 IN DWORD dwExpectedFileSize,
93 IN LPCWSTR lpszFileExtension,
94 __out_ecount(MAX_LONGPATH+1) LPWSTR lpszFileName,
103 bRet=CreateUrlCacheEntryW(lpszUrlName,dwExpectedFileSize,lpszFileExtension,
104 lpszFileName,dwReserved);
106 EX_CATCH_HRESULT(hr);
114 CommitUrlCacheEntryW_NoThrow(
115 IN LPCWSTR lpszUrlName,
116 IN LPCWSTR lpszLocalFileName,
117 IN FILETIME ExpireTime,
118 IN FILETIME LastModifiedTime,
119 IN DWORD CacheEntryType,
120 IN LPCWSTR lpHeaderInfo,
121 IN DWORD dwHeaderSize,
122 IN LPCWSTR lpszFileExtension,
123 IN LPCWSTR lpszOriginalUrl
131 bRet=CommitUrlCacheEntryW(lpszUrlName,lpszLocalFileName,ExpireTime,
132 LastModifiedTime,CacheEntryType,(LPWSTR)lpHeaderInfo,
133 dwHeaderSize,lpszFileExtension,lpszOriginalUrl);
135 EX_CATCH_HRESULT(hr);
143 InternetTimeToSystemTimeA_NoThrow(
144 IN LPCSTR lpszTime, // NULL terminated string
145 OUT SYSTEMTIME *pst, // output in GMT time
154 bRet=InternetTimeToSystemTimeA(lpszTime,pst,dwReserved);
156 EX_CATCH_HRESULT(hr);
164 CoInternetCreateSecurityManager_NoThrow(
165 IServiceProvider *pSP,
166 IInternetSecurityManager **ppSM,
174 hr=CoInternetCreateSecurityManager(pSP,ppSM, dwReserved);
176 EX_CATCH_HRESULT(hr);
181 URLDownloadToCacheFileW_NoThrow(
182 LPUNKNOWN lpUnkcaller,
184 __out_ecount(dwBufLength) LPWSTR szFileName,
187 IBindStatusCallback *pBSC
194 hr=URLDownloadToCacheFileW(lpUnkcaller,szURL,szFileName,dwBufLength,dwReserved,pBSC);
196 EX_CATCH_HRESULT(hr);
201 CoInternetGetSession_NoThrow(
203 IInternetSession **ppIInternetSession,
211 hr=CoInternetGetSession(dwSessionMode,ppIInternetSession,dwReserved);
213 EX_CATCH_HRESULT(hr);
218 CopyBindInfo_NoThrow(
219 const BINDINFO * pcbiSrc, BINDINFO * pbiDest
226 hr=CopyBindInfo(pcbiSrc,pbiDest );
228 EX_CATCH_HRESULT(hr);
231 #endif // FEATURE_CORECLR && !CROSSGEN_COMPILE