Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

561 lines
22 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1994-1996 **
  4. //*********************************************************************
  5. //
  6. // DLYLDDLL.C - uses macros for delay loading of DLLs
  7. //
  8. #include "inetcplp.h"
  9. #include <cryptui.h>
  10. // coded copied from SHDOCVW's dllload.c file
  11. #pragma warning(disable:4229) // No warnings when modifiers used on data
  12. // Exporting by ordinal is not available on UNIX.
  13. // But we have all these symbols exported because it's UNIX default.
  14. #ifdef UNIX
  15. #define GET_PRIVATE_PROC_ADDRESS(_hinst, _fname, _ord) GetProcAddress(_hinst, #_fname)
  16. #else
  17. #define GET_PRIVATE_PROC_ADDRESS(_hinst, _fname, _ord) GetProcAddress(_hinst, (LPSTR) _ord)
  18. #endif
  19. #define ENSURE_LOADED(_hinst, _dll) ( _hinst ? TRUE : NULL != (_hinst=LoadLibraryA(#_dll)) )
  20. #define DELAY_LOAD_ERR(_hinst, _dll, _ret, _fn, _args, _nargs, _err) \
  21. _ret __stdcall _fn _args \
  22. { \
  23. static _ret (* __stdcall _pfn##_fn) _args = NULL; \
  24. if (!ENSURE_LOADED(_hinst, _dll)) \
  25. { \
  26. ASSERT(_hinst); \
  27. return (_ret)_err; \
  28. } \
  29. if (_pfn##_fn == NULL) \
  30. { \
  31. *(FARPROC*)&(_pfn##_fn) = GetProcAddress(_hinst, #_fn); \
  32. ASSERT(_pfn##_fn); \
  33. if (_pfn##_fn == NULL) \
  34. return (_ret)_err; \
  35. } \
  36. return _pfn##_fn _nargs; \
  37. }
  38. #define DELAY_LOAD(_hinst, _dll, _ret, _fn, _args, _nargs) DELAY_LOAD_ERR(_hinst, _dll, _ret, _fn, _args, _nargs, 0)
  39. #define DELAY_LOAD_HRESULT(_hinst, _dll, _fn, _args, _nargs) DELAY_LOAD_ERR(_hinst, _dll, HRESULT, _fn, _args, _nargs, E_FAIL)
  40. #define DELAY_LOAD_SAFEARRAY(_hinst, _dll, _fn, _args, _nargs) DELAY_LOAD_ERR(_hinst, _dll, SAFEARRAY *, _fn, _args, _nargs, NULL)
  41. #define DELAY_LOAD_UINT(_hinst, _dll, _fn, _args, _nargs) DELAY_LOAD_ERR(_hinst, _dll, UINT, _fn, _args, _nargs, 0)
  42. #define DELAY_LOAD_VOID(_hinst, _dll, _fn, _args, _nargs) \
  43. void __stdcall _fn _args \
  44. { \
  45. static void (* __stdcall _pfn##_fn) _args = NULL; \
  46. if (!ENSURE_LOADED(_hinst, _dll)) \
  47. { \
  48. ASSERT((BOOL)_hinst); \
  49. return; \
  50. } \
  51. if (_pfn##_fn == NULL) \
  52. { \
  53. *(FARPROC*)&(_pfn##_fn) = GetProcAddress(_hinst, #_fn); \
  54. ASSERT((BOOL)_pfn##_fn); \
  55. if (_pfn##_fn == NULL) \
  56. return; \
  57. } \
  58. _pfn##_fn _nargs; \
  59. }
  60. // For private entrypoints exported by ordinal.
  61. #define DELAY_LOAD_ORD_ERR(_hinst, _dll, _ret, _fn, _ord, _args, _nargs, _err) \
  62. _ret __stdcall _fn _args \
  63. { \
  64. static _ret (* __stdcall _pfn##_fn) _args = NULL; \
  65. if (!ENSURE_LOADED(_hinst, _dll)) \
  66. { \
  67. ASSERT(_hinst); \
  68. return (_ret)_err; \
  69. } \
  70. if (_pfn##_fn == NULL) \
  71. { \
  72. *(FARPROC*)&(_pfn##_fn) = GET_PRIVATE_PROC_ADDRESS(_hinst, _fn, _ord); \
  73. ASSERT(_pfn##_fn); \
  74. if (_pfn##_fn == NULL) \
  75. return (_ret)_err; \
  76. } \
  77. return _pfn##_fn _nargs; \
  78. }
  79. #define DELAY_LOAD_ORD_HRESULT(_hinst, _dll, _fn, _ord, _args, _nargs) DELAY_LOAD_ORD_ERR(_hinst, _dll, HRESULT, _fn, _ord, _args, _nargs, E_FAIL)
  80. #define DELAY_LOAD_ORD(_hinst, _dll, _ret, _fn, _ord, _args, _nargs) DELAY_LOAD_ORD_ERR(_hinst, _dll, _ret, _fn, _ord, _args, _nargs, 0)
  81. #define DELAY_LOAD_VOID_ORD(_hinst, _dll, _fn, _ord, _args, _nargs) \
  82. void __stdcall _fn _args \
  83. { \
  84. static void (* __stdcall _pfn##_fn) _args = NULL; \
  85. if (!ENSURE_LOADED(_hinst, _dll)) \
  86. { \
  87. ASSERT((BOOL)_hinst); \
  88. return; \
  89. } \
  90. if (_pfn##_fn == NULL) \
  91. { \
  92. *(FARPROC*)&(_pfn##_fn) = GET_PRIVATE_PROC_ADDRESS(_hinst, _fn, _ord); \
  93. ASSERT((BOOL)_pfn##_fn); \
  94. if (_pfn##_fn == NULL) \
  95. return; \
  96. } \
  97. _pfn##_fn _nargs; \
  98. }
  99. //--------- wininet.dll -----------------
  100. HINSTANCE g_hinstWinInet = NULL;
  101. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, InternetSetOption,
  102. (IN HINTERNET hInternet OPTIONAL,IN DWORD dwOption,IN LPVOID lpBuffer,
  103. IN DWORD dwBufferLength),
  104. (hInternet,dwOption,lpBuffer,dwBufferLength));
  105. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, InternetQueryOption,
  106. (IN HINTERNET hInternet OPTIONAL,IN DWORD dwOption,IN LPVOID lpBuffer,
  107. IN OUT LPDWORD lpdwBufferLength),
  108. (hInternet,dwOption,lpBuffer,lpdwBufferLength));
  109. DELAY_LOAD(g_hinstWinInet, WININET.DLL, DWORD, ShowX509EncodedCertificate,
  110. (IN HWND hWndParent,IN LPBYTE lpCert,IN DWORD cbCert),
  111. (hWndParent,lpCert,cbCert));
  112. DELAY_LOAD(g_hinstWinInet, WININET.DLL, DWORD, ParseX509EncodedCertificateForListBoxEntry,
  113. (IN LPBYTE lpCert,IN DWORD cbCert,OUT LPSTR lpszListBoxEntry,IN LPDWORD lpdwListBoxEntry),
  114. (lpCert,cbCert,lpszListBoxEntry,lpdwListBoxEntry));
  115. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, GetUrlCacheConfigInfoA,
  116. (
  117. OUT LPINTERNET_CACHE_CONFIG_INFOA lpCacheConfigInfo,
  118. IN OUT LPDWORD lpdwCacheConfigInfoBufferSize,
  119. IN DWORD dwFieldControl
  120. ),
  121. (lpCacheConfigInfo,lpdwCacheConfigInfoBufferSize,dwFieldControl));
  122. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, SetUrlCacheConfigInfoA,
  123. (
  124. IN LPINTERNET_CACHE_CONFIG_INFOA lpCacheConfigInfo,
  125. IN DWORD dwFieldControl
  126. ),
  127. (lpCacheConfigInfo,dwFieldControl));
  128. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, FreeUrlCacheSpaceA,
  129. (
  130. IN LPCSTR lpszCachePath,
  131. IN DWORD dwSize,
  132. IN DWORD dwReserved
  133. ),
  134. (lpszCachePath,dwSize,dwReserved));
  135. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, UpdateUrlCacheContentPath,
  136. (
  137. IN LPSTR lpszCachePath
  138. ),
  139. (lpszCachePath));
  140. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, FindCloseUrlCache,
  141. (
  142. IN HANDLE hEnumHandle
  143. ),
  144. (hEnumHandle));
  145. DELAY_LOAD(g_hinstWinInet, WININET.DLL, HANDLE, FindFirstUrlCacheEntryA,
  146. (
  147. IN LPCSTR lpszUrlSearchPattern,
  148. OUT LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  149. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize
  150. ),
  151. (lpszUrlSearchPattern, lpFirstCacheEntryInfo,
  152. lpdwFirstCacheEntryInfoBufferSize));
  153. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, FindNextUrlCacheEntryA,
  154. (
  155. IN HANDLE hEnumHandle,
  156. OUT LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  157. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize
  158. ),
  159. (hEnumHandle, lpFirstCacheEntryInfo,
  160. lpdwFirstCacheEntryInfoBufferSize));
  161. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, DeleteUrlCacheEntryA,
  162. (
  163. IN LPCSTR lpszUrlName
  164. ),
  165. (lpszUrlName));
  166. DELAY_LOAD(g_hinstWinInet, WININET.DLL, HANDLE, FindFirstUrlCacheEntryExA,
  167. (
  168. IN LPCSTR lpszUrlSearchPattern,
  169. IN DWORD dwFlags,
  170. IN DWORD dwFilter,
  171. IN GROUPID GroupId,
  172. OUT LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  173. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize,
  174. OUT LPVOID lpReserved, // must pass NULL
  175. IN OUT LPDWORD pcbReserved2, // must pass NULL
  176. IN LPVOID lpReserved3 // must pass NULL
  177. ),
  178. (lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo,
  179. lpdwFirstCacheEntryInfoBufferSize, lpReserved, pcbReserved2, lpReserved3));
  180. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, FindNextUrlCacheEntryExA,
  181. (
  182. IN HANDLE hEnumHandle,
  183. OUT LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  184. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize,
  185. OUT LPVOID lpReserved, // must pass NULL
  186. IN OUT LPDWORD pcbReserved2, // must pass NULL
  187. IN LPVOID lpReserved3 // must pass NULL
  188. ),
  189. (hEnumHandle, lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize, lpReserved, pcbReserved2, lpReserved3));
  190. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, InternetGetConnectedStateExA,
  191. (
  192. OUT LPDWORD lpdwFlags,
  193. IN LPSTR lpszConnectionName,
  194. IN DWORD dwNameSize,
  195. IN DWORD dwReserved
  196. ),
  197. (lpdwFlags, lpszConnectionName, dwNameSize, dwReserved));
  198. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, IncrementUrlCacheHeaderData,
  199. (
  200. IN DWORD nIdx,
  201. OUT LPDWORD lpdwData
  202. ),
  203. (nIdx, lpdwData));
  204. DELAY_LOAD_ORD(g_hinstWinInet, WININET.DLL, BOOL, GetDiskInfoA, 102,
  205. (
  206. IN PSTR pszPath,
  207. IN OUT PDWORD pdwClusterSize,
  208. IN OUT PDWORDLONG pdlAvail,
  209. IN OUT PDWORDLONG pdlTotal
  210. ),
  211. (pszPath, pdwClusterSize, pdlAvail, pdlTotal));
  212. DELAY_LOAD(g_hinstWinInet, WININET.DLL, DWORD, PrivacyGetZonePreferenceW,
  213. (
  214. DWORD dwZone,
  215. DWORD dwType,
  216. LPDWORD pdwTemplate,
  217. LPWSTR pszBuffer,
  218. LPDWORD pdwBufferLength
  219. ),
  220. (dwZone, dwType, pdwTemplate, pszBuffer, pdwBufferLength));
  221. DELAY_LOAD(g_hinstWinInet, WININET.DLL, DWORD, PrivacySetZonePreferenceW,
  222. (
  223. DWORD dwZone,
  224. DWORD dwType,
  225. DWORD dwTemplate,
  226. LPCWSTR pszPreference
  227. ),
  228. (dwZone, dwType, dwTemplate, pszPreference));
  229. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, InternetEnumPerSiteCookieDecisionW,
  230. (
  231. OUT LPWSTR pwszSiteName,
  232. IN OUT unsigned long *pcbName,
  233. OUT unsigned long *pdwDecision,
  234. IN unsigned long dwIndex
  235. ),
  236. (pwszSiteName, pcbName, pdwDecision, dwIndex));
  237. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, InternetClearAllPerSiteCookieDecisions,
  238. (),
  239. ());
  240. //BOOLAPI IsDomainLegalCookieDomainW( IN LPCWSTR pwchDomain, IN LPCWSTR pwchFullDomain)
  241. DELAY_LOAD_ORD(g_hinstWinInet, WININET.DLL, BOOL, IsDomainLegalCookieDomainW, 117,
  242. (
  243. IN LPCWSTR pwchDomain,
  244. IN LPCWSTR pwchFullDomain
  245. ),
  246. (pwchDomain, pwchFullDomain));
  247. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, InternetSetPerSiteCookieDecisionW,
  248. (
  249. IN LPCWSTR pwchHostName,
  250. DWORD dwDecision
  251. ),
  252. (pwchHostName, dwDecision));
  253. //--------- urlmon.dll ------------------
  254. HINSTANCE g_hinstUrlMon = NULL;
  255. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, UrlMkSetSessionOption,
  256. (DWORD dwOption, LPVOID pBuffer, DWORD dwBufferLength, DWORD dwReserved),
  257. (dwOption, pBuffer, dwBufferLength, dwReserved));
  258. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, CoInternetCreateZoneManager,
  259. (IServiceProvider *pSP, IInternetZoneManager **ppZM, DWORD dwReserved),
  260. (pSP, ppZM, dwReserved));
  261. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, CoInternetCreateSecurityManager,
  262. (IServiceProvider *pSP, IInternetSecurityManager **ppSM, DWORD dwReserved),
  263. (pSP, ppSM, dwReserved));
  264. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, CreateURLMoniker,
  265. (LPMONIKER pMkCtx, LPCWSTR szURL, LPMONIKER FAR * ppmk),
  266. (pMkCtx,szURL,ppmk));
  267. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, FaultInIEFeature,
  268. (HWND hWnd, uCLSSPEC *pClassSpec, QUERYCONTEXT *pQuery, DWORD dwFlags),
  269. (hWnd, pClassSpec, pQuery, dwFlags));
  270. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, CoInternetParseUrl,
  271. (LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwFlags, LPWSTR pszResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved),
  272. (pwzUrl, ParseAction, dwFlags, pszResult, cchResult, pcchResult, dwReserved));
  273. // -------- crypt32.dll ----------------------------
  274. HINSTANCE g_hinstCrypt32 = NULL;
  275. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, HCERTSTORE, CertOpenSystemStoreA,
  276. (HCRYPTPROV hProv, LPCSTR szSubSystemProtocol),
  277. (hProv, szSubSystemProtocol));
  278. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL , CertCloseStore,
  279. (IN HCERTSTORE hCertStore, DWORD dwFlags),
  280. (hCertStore, dwFlags));
  281. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertGetEnhancedKeyUsage,
  282. (IN PCCERT_CONTEXT pCertContext, IN DWORD dwFlags, OUT PCERT_ENHKEY_USAGE pUsage, IN OUT DWORD *pcbUsage),
  283. (pCertContext, dwFlags, pUsage, pcbUsage));
  284. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertSetEnhancedKeyUsage,
  285. (IN PCCERT_CONTEXT pCertContext, IN PCERT_ENHKEY_USAGE pUsage),
  286. (pCertContext, pUsage));
  287. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertDeleteCertificateFromStore,
  288. (IN PCCERT_CONTEXT pCertContext),
  289. (pCertContext));
  290. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertAddEnhancedKeyUsageIdentifier,
  291. (IN PCCERT_CONTEXT pCertContext, IN LPCSTR pszUsageIdentifier),
  292. (pCertContext, pszUsageIdentifier));
  293. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertRemoveEnhancedKeyUsageIdentifier,
  294. (IN PCCERT_CONTEXT pCertContext,IN LPCSTR pszUsageIdentifier),
  295. (pCertContext, pszUsageIdentifier));
  296. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, PCCERT_CONTEXT, CertFindCertificateInStore,
  297. (IN HCERTSTORE hCertStore, IN DWORD dwCertEncodingType, IN DWORD dwFindFlags,IN DWORD dwFindType,
  298. IN const void *pvFindPara, IN PCCERT_CONTEXT pPrevCertContext),
  299. (hCertStore, dwCertEncodingType, dwFindFlags, dwFindType, pvFindPara, pPrevCertContext));
  300. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertAddEncodedCertificateToStore,
  301. (IN HCERTSTORE hCertStore,IN DWORD dwCertEncodingType,IN const BYTE *pbCertEncoded,
  302. IN DWORD cbCertEncoded,IN DWORD dwAddDisposition, OUT OPTIONAL PCCERT_CONTEXT *ppCertContext),
  303. (hCertStore, dwCertEncodingType, pbCertEncoded, cbCertEncoded, dwAddDisposition, ppCertContext));
  304. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertFreeCertificateContext,
  305. (IN PCCERT_CONTEXT pCertContext),
  306. (pCertContext));
  307. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertCompareCertificateName,
  308. (IN DWORD dwCertEncodingType,IN PCERT_NAME_BLOB pCertName1,IN PCERT_NAME_BLOB pCertName2),
  309. (dwCertEncodingType,pCertName1,pCertName2));
  310. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, PCCERT_CONTEXT, CertCreateCertificateContext,
  311. (IN DWORD dwCertEncodingType, IN const BYTE *pbCertEncoded, IN DWORD cbCertEncoded),
  312. (dwCertEncodingType,pbCertEncoded,cbCertEncoded));
  313. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertAddCertificateContextToStore,
  314. (IN HCERTSTORE hCertStore,
  315. IN PCCERT_CONTEXT pCertContext,
  316. IN DWORD dwAddDisposition,
  317. OUT OPTIONAL PCCERT_CONTEXT *ppStoreContext),
  318. (hCertStore,pCertContext,dwAddDisposition,ppStoreContext));
  319. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, PCCERT_CONTEXT, CertEnumCertificatesInStore,
  320. (IN HCERTSTORE hCertStore,
  321. IN PCCERT_CONTEXT pPrevCertContext),
  322. (hCertStore,pPrevCertContext));
  323. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, PFXExportCertStore,
  324. (HCERTSTORE hStore,
  325. CRYPT_DATA_BLOB* pPFX,
  326. LPCWSTR szPassword,
  327. DWORD dwFlags),
  328. (hStore,pPFX, szPassword, dwFlags));
  329. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, HCERTSTORE, PFXImportCertStore,
  330. (CRYPT_DATA_BLOB* pPFX,
  331. LPCWSTR szPassword,
  332. DWORD dwFlags),
  333. (pPFX,szPassword,dwFlags));
  334. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, HCERTSTORE, CertOpenStore,
  335. (IN LPCSTR lpszStoreProvider,
  336. IN DWORD dwEncodingType,
  337. IN HCRYPTPROV hCryptProv,
  338. IN DWORD dwFlags,
  339. IN const void *pvPara),
  340. (lpszStoreProvider,
  341. dwEncodingType,
  342. hCryptProv,
  343. dwFlags,
  344. pvPara));
  345. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CryptHashCertificate,
  346. (IN HCRYPTPROV hCryptProv,
  347. IN ALG_ID Algid,
  348. IN DWORD dwFlags,
  349. IN const BYTE *pbEncoded,
  350. IN DWORD cbEncoded,
  351. OUT BYTE *pbComputedHash,
  352. IN OUT DWORD *pcbComputedHash
  353. ),
  354. (hCryptProv,Algid,dwFlags,pbEncoded,cbEncoded,pbComputedHash,pcbComputedHash));
  355. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, PCCERT_CONTEXT, CertDuplicateCertificateContext,
  356. (IN PCCERT_CONTEXT pCertContext),
  357. (pCertContext));
  358. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertGetCertificateContextProperty,
  359. (IN PCCERT_CONTEXT pCertContext,
  360. IN DWORD dwPropId,
  361. OUT void *pvData,
  362. IN OUT DWORD *pcbData
  363. ),
  364. (pCertContext, dwPropId, pvData, pcbData));
  365. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CryptDecodeObject,
  366. (IN DWORD dwCertEncodingType,
  367. IN LPCSTR lpszStructType,
  368. IN const BYTE *pbEncoded,
  369. IN DWORD cbEncoded,
  370. IN DWORD dwFlags,
  371. OUT void *pvStructInfo,
  372. IN OUT DWORD *pcbStructInfo
  373. ),
  374. (dwCertEncodingType, lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo));
  375. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, PCERT_EXTENSION, CertFindExtension,
  376. (IN LPCSTR pszObjId,
  377. IN DWORD cExtensions,
  378. IN CERT_EXTENSION rgExtensions[]
  379. ),
  380. (pszObjId, cExtensions, rgExtensions));
  381. // -------- cryptui.dll ----------------------------
  382. HINSTANCE g_hinstCryptui = NULL;
  383. DELAY_LOAD(g_hinstCryptui, CRYPTUI.DLL, BOOL, CryptUIDlgCertMgr,
  384. (PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr),
  385. (pCryptUICertMgr));
  386. //--------- shdocvw.dll ------------------
  387. HINSTANCE g_hinstShdocvw = NULL;
  388. const TCHAR c_tszShdocvw[] = TEXT("SHDOCVW.DLL");
  389. // HRESULT URLSubRegQueryA(LPCSTR pszKey, LPCSTR pszValue, BOOL fUseHKCU, LPSTR pszUrlOut, DWORD cchSize, DWORD dwSubstitutions);
  390. DELAY_LOAD_ORD_HRESULT(g_hinstShdocvw, SHDOCVW.DLL, URLSubRegQueryA, 151,
  391. (LPCSTR pszKey, LPCSTR pszValue, BOOL fUseHKCU, LPSTR pszUrlOut, DWORD cchSize, DWORD dwSubstitutions),
  392. (pszKey, pszValue, fUseHKCU, pszUrlOut, cchSize, dwSubstitutions));
  393. // HRESULT ResetProfileSharing(HWND hwin);
  394. DELAY_LOAD_ORD_HRESULT(g_hinstShdocvw, SHDOCVW.DLL, ResetProfileSharing, 164,
  395. (HWND hwnd),
  396. (hwnd));
  397. // HRESULT ClearAutoSuggestForForms(DWORD dwClear);
  398. DELAY_LOAD_ORD_HRESULT(g_hinstShdocvw, SHDOCVW.DLL, ClearAutoSuggestForForms, 211,
  399. (DWORD dwClear),
  400. (dwClear));
  401. // HRESULT ResetWebSettings(HWND hwnd)
  402. DELAY_LOAD_ORD_HRESULT(g_hinstShdocvw, SHDOCVW.DLL, ResetWebSettings, 223,
  403. (HWND hwnd, BOOL *pfChangedHomePage),
  404. (hwnd,pfChangedHomePage));
  405. DELAY_LOAD( g_hinstShdocvw, SHDOCVW.DLL, BOOL,
  406. ImportPrivacySettings,
  407. (LPCWSTR szFilename),
  408. (szFilename));
  409. #ifdef UNIX_FEATURE_ALIAS
  410. DELAY_LOAD_ORD_HRESULT(g_hinstShdocvw, SHDOCVW.DLL, RefreshGlobalAliasList, 164,
  411. (),
  412. ());
  413. #endif /* UNIX_FEATURE_ALIAS */
  414. //--------- msrating.dll ----------------
  415. HINSTANCE g_hinstRatings = NULL;
  416. const TCHAR c_tszRatingsDLL[] = TEXT("MSRATING.DLL");
  417. DELAY_LOAD(g_hinstRatings, MSRATING.DLL, HRESULT, RatingEnable,
  418. (HWND hwndParent, LPCSTR pszUsername, BOOL fEnable),
  419. (hwndParent,pszUsername,fEnable));
  420. DELAY_LOAD(g_hinstRatings, MSRATING.DLL, HRESULT, RatingSetupUI,
  421. (HWND hDlg, LPCSTR pszUsername),
  422. (hDlg, pszUsername));
  423. DELAY_LOAD(g_hinstRatings, MSRATING.DLL, HRESULT, RatingEnabledQuery,
  424. (), ());
  425. // --------- mshtml.dll --------------------
  426. HINSTANCE g_hinstMSHTML = NULL;
  427. const TCHAR c_tszMSHTMLDLL[] = TEXT("MSHTML.DLL");
  428. DELAY_LOAD(g_hinstMSHTML, MSHTML.DLL, HRESULT, ShowModalDialog,
  429. (HWND hwndParent, IMoniker *pmk, VARIANT *pvarArgIn, TCHAR* pchOptions, VARIANT *pvarArgOut),
  430. (hwndParent,pmk,pvarArgIn,pchOptions,pvarArgOut));
  431. //
  432. // We don't need to delay load anything from MSHTML,
  433. // but we are using this still to determine if
  434. // MSHTML.DLL is around.
  435. //
  436. HINSTANCE g_hinstOCCache = NULL;
  437. DELAY_LOAD_HRESULT(g_hinstOCCache, OCCache.DLL, RemoveExpiredControls,
  438. (DWORD dwFlags, DWORD dwReserved),
  439. ( dwFlags, dwReserved));
  440. // --------- mpr.dll --------------------
  441. HINSTANCE g_hinstMPR = NULL;
  442. const TCHAR c_tszMPRDLL[] = TEXT("MPR.DLL");
  443. #ifndef UNICODE
  444. DELAY_LOAD(g_hinstMPR, MPR.DLL, DWORD, WNetGetConnectionA,
  445. (LPCSTR pszLocalDevice, LPSTR pszUNC, LPDWORD pcbUNC),
  446. (pszLocalDevice, pszUNC, pcbUNC));
  447. #else
  448. DELAY_LOAD(g_hinstMPR, MPR.DLL, DWORD, WNetGetConnectionW,
  449. (LPCTSTR pszLocalDevice, LPTSTR pszUNC, LPDWORD pcbUNC),
  450. (pszLocalDevice, pszUNC, pcbUNC));
  451. #endif
  452. // ---------- end of DLL definitions --------
  453. #pragma warning(default:4229)