2 // Copyright (c) Microsoft. All rights reserved.
3 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7 #include "stdafx.h" // Precompiled header key.
11 #include "pedecoder.h"
18 GetFileVersionInfoSizeW_NoThrow(
19 LPCWSTR lptstrFilename, /* Filename of version stamped file */
28 dwRet=GetFileVersionInfoSize( (LPWSTR)lptstrFilename, lpdwHandle );
38 GetFileVersionInfoW_NoThrow(
39 LPCWSTR lptstrFilename, /* Filename of version stamped file */
40 DWORD dwHandle, /* Information from GetFileVersionSize */
41 DWORD dwLen, /* Length of buffer for info */
50 bRet=GetFileVersionInfo( (LPWSTR)lptstrFilename, dwHandle,dwLen,lpData );
60 VerQueryValueW_NoThrow(
72 bRet=VerQueryValueW( pBlock, (LPWSTR)lpSubBlock,lplpBuffer,puLen );
81 #if !defined(FEATURE_CORECLR) && !defined(CROSSGEN_COMPILE)
82 // The following functions are not used in CoreCLR. Normally LINKER can remove these functions
83 // from generated files. But LINKER does it in two steps:
84 // 1. If no function in a source file is used, the file is ignored by LINKER
85 // 2. If one function is used, LINKER will first make sure all imported functions in the file
86 // is available, and then it will remove unused functions.
87 // Instead of specifying all libs for imported functions needed by the following codes, we just
88 // remove them from compiling phase.
91 CreateUrlCacheEntryW_NoThrow(
92 IN LPCWSTR lpszUrlName,
93 IN DWORD dwExpectedFileSize,
94 IN LPCWSTR lpszFileExtension,
95 __out_ecount(MAX_LONGPATH+1) LPWSTR lpszFileName,
104 bRet=CreateUrlCacheEntryW(lpszUrlName,dwExpectedFileSize,lpszFileExtension,
105 lpszFileName,dwReserved);
107 EX_CATCH_HRESULT(hr);
115 CommitUrlCacheEntryW_NoThrow(
116 IN LPCWSTR lpszUrlName,
117 IN LPCWSTR lpszLocalFileName,
118 IN FILETIME ExpireTime,
119 IN FILETIME LastModifiedTime,
120 IN DWORD CacheEntryType,
121 IN LPCWSTR lpHeaderInfo,
122 IN DWORD dwHeaderSize,
123 IN LPCWSTR lpszFileExtension,
124 IN LPCWSTR lpszOriginalUrl
132 bRet=CommitUrlCacheEntryW(lpszUrlName,lpszLocalFileName,ExpireTime,
133 LastModifiedTime,CacheEntryType,(LPWSTR)lpHeaderInfo,
134 dwHeaderSize,lpszFileExtension,lpszOriginalUrl);
136 EX_CATCH_HRESULT(hr);
144 InternetTimeToSystemTimeA_NoThrow(
145 IN LPCSTR lpszTime, // NULL terminated string
146 OUT SYSTEMTIME *pst, // output in GMT time
155 bRet=InternetTimeToSystemTimeA(lpszTime,pst,dwReserved);
157 EX_CATCH_HRESULT(hr);
165 CoInternetCreateSecurityManager_NoThrow(
166 IServiceProvider *pSP,
167 IInternetSecurityManager **ppSM,
175 hr=CoInternetCreateSecurityManager(pSP,ppSM, dwReserved);
177 EX_CATCH_HRESULT(hr);
182 URLDownloadToCacheFileW_NoThrow(
183 LPUNKNOWN lpUnkcaller,
185 __out_ecount(dwBufLength) LPWSTR szFileName,
188 IBindStatusCallback *pBSC
195 hr=URLDownloadToCacheFileW(lpUnkcaller,szURL,szFileName,dwBufLength,dwReserved,pBSC);
197 EX_CATCH_HRESULT(hr);
202 CoInternetGetSession_NoThrow(
204 IInternetSession **ppIInternetSession,
212 hr=CoInternetGetSession(dwSessionMode,ppIInternetSession,dwReserved);
214 EX_CATCH_HRESULT(hr);
219 CopyBindInfo_NoThrow(
220 const BINDINFO * pcbiSrc, BINDINFO * pbiDest
227 hr=CopyBindInfo(pcbiSrc,pbiDest );
229 EX_CATCH_HRESULT(hr);
232 #endif // FEATURE_CORECLR && !CROSSGEN_COMPILE