dlylddll.cpp
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 19k
Category:

Windows Kernel

Development Platform:

Visual C++

  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, FindFirstUrlCacheEntryExA,
  146.            (
  147.             IN     LPCSTR    lpszUrlSearchPattern,
  148.             IN     DWORD     dwFlags,
  149.             IN     DWORD     dwFilter,
  150.             IN     GROUPID   GroupId,
  151.             OUT    LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  152.             IN OUT LPDWORD   lpdwFirstCacheEntryInfoBufferSize,
  153.             OUT    LPVOID    lpReserved,     // must pass NULL
  154.             IN OUT LPDWORD   pcbReserved2,   // must pass NULL
  155.             IN     LPVOID    lpReserved3     // must pass NULL
  156.            ),
  157.            (lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, 
  158.             lpdwFirstCacheEntryInfoBufferSize, lpReserved, pcbReserved2, lpReserved3));
  159. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, FindNextUrlCacheEntryExA,
  160.            (
  161.             IN     HANDLE    hEnumHandle,
  162.             OUT    LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  163.             IN OUT LPDWORD   lpdwFirstCacheEntryInfoBufferSize,
  164.             OUT    LPVOID    lpReserved,     // must pass NULL
  165.             IN OUT LPDWORD   pcbReserved2,   // must pass NULL
  166.             IN     LPVOID    lpReserved3     // must pass NULL
  167.            ),
  168.            (hEnumHandle, lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize, lpReserved, pcbReserved2, lpReserved3));
  169. DELAY_LOAD(g_hinstWinInet, WININET.DLL, BOOL, InternetGetConnectedStateExA,
  170.             (
  171.              OUT LPDWORD lpdwFlags,
  172.              IN LPSTR lpszConnectionName,
  173.              IN DWORD dwNameSize,
  174.              IN DWORD dwReserved
  175.             ),
  176.             (lpdwFlags, lpszConnectionName, dwNameSize, dwReserved));
  177. DELAY_LOAD_ORD(g_hinstWinInet, WININET.DLL, BOOL, GetDiskInfoA, 102,
  178.             (
  179.              IN PSTR pszPath, 
  180.              IN OUT PDWORD pdwClusterSize, 
  181.              IN OUT PDWORDLONG pdlAvail, 
  182.              IN OUT PDWORDLONG pdlTotal
  183.             ),
  184.             (pszPath, pdwClusterSize, pdlAvail, pdlTotal));
  185. //--------- urlmon.dll ------------------
  186. HINSTANCE g_hinstUrlMon = NULL;
  187. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, UrlMkSetSessionOption,
  188.            (DWORD dwOption, LPVOID pBuffer, DWORD dwBufferLength, DWORD dwReserved),
  189.            (dwOption, pBuffer, dwBufferLength, dwReserved));
  190. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, CoInternetCreateZoneManager,
  191.            (IServiceProvider *pSP, IInternetZoneManager **ppZM, DWORD dwReserved),
  192.            (pSP, ppZM, dwReserved));
  193. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, CoInternetCreateSecurityManager,
  194.            (IServiceProvider *pSP, IInternetSecurityManager **ppSM, DWORD dwReserved),
  195.            (pSP, ppSM, dwReserved));
  196. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, CreateURLMoniker,
  197.            (LPMONIKER pMkCtx, LPCWSTR szURL, LPMONIKER FAR * ppmk),
  198.            (pMkCtx,szURL,ppmk));
  199. DELAY_LOAD(g_hinstUrlMon, URLMON.DLL, HRESULT, FaultInIEFeature,
  200.             (HWND hWnd, uCLSSPEC *pClassSpec, QUERYCONTEXT *pQuery, DWORD dwFlags),
  201.             (hWnd, pClassSpec, pQuery, dwFlags));
  202. // -------- crypt32.dll ----------------------------
  203. HINSTANCE g_hinstCrypt32 = NULL;
  204. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, HCERTSTORE, CertOpenSystemStoreA,
  205.            (HCRYPTPROV hProv, LPCSTR szSubSystemProtocol),
  206.            (hProv, szSubSystemProtocol));
  207. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL , CertCloseStore,
  208.            (IN HCERTSTORE hCertStore, DWORD dwFlags),
  209.            (hCertStore, dwFlags));
  210. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertGetEnhancedKeyUsage,
  211.            (IN PCCERT_CONTEXT pCertContext, IN DWORD dwFlags, OUT PCERT_ENHKEY_USAGE pUsage, IN OUT DWORD *pcbUsage),
  212.            (pCertContext, dwFlags, pUsage, pcbUsage));
  213. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertSetEnhancedKeyUsage,
  214.            (IN PCCERT_CONTEXT pCertContext, IN PCERT_ENHKEY_USAGE pUsage),
  215.            (pCertContext, pUsage));
  216. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertDeleteCertificateFromStore,
  217.            (IN PCCERT_CONTEXT pCertContext),
  218.            (pCertContext));
  219. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertAddEnhancedKeyUsageIdentifier,
  220.            (IN PCCERT_CONTEXT pCertContext, IN LPCSTR pszUsageIdentifier),
  221.            (pCertContext, pszUsageIdentifier));
  222. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertRemoveEnhancedKeyUsageIdentifier,
  223.            (IN PCCERT_CONTEXT pCertContext,IN LPCSTR pszUsageIdentifier),
  224.            (pCertContext, pszUsageIdentifier));
  225. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL,  PCCERT_CONTEXT, CertFindCertificateInStore,
  226.            (IN HCERTSTORE hCertStore, IN DWORD dwCertEncodingType, IN DWORD dwFindFlags,IN DWORD dwFindType,
  227.             IN const void *pvFindPara, IN PCCERT_CONTEXT pPrevCertContext),
  228.            (hCertStore, dwCertEncodingType, dwFindFlags, dwFindType, pvFindPara, pPrevCertContext));
  229. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertAddEncodedCertificateToStore,
  230.            (IN HCERTSTORE hCertStore,IN DWORD dwCertEncodingType,IN const BYTE *pbCertEncoded,
  231.             IN DWORD cbCertEncoded,IN DWORD dwAddDisposition, OUT OPTIONAL PCCERT_CONTEXT *ppCertContext),
  232.            (hCertStore, dwCertEncodingType, pbCertEncoded, cbCertEncoded, dwAddDisposition, ppCertContext));
  233. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL,  BOOL, CertFreeCertificateContext,
  234.            (IN PCCERT_CONTEXT pCertContext),
  235.            (pCertContext));
  236. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertCompareCertificateName,
  237.            (IN DWORD dwCertEncodingType,IN PCERT_NAME_BLOB pCertName1,IN PCERT_NAME_BLOB pCertName2),
  238.            (dwCertEncodingType,pCertName1,pCertName2));
  239. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, PCCERT_CONTEXT, CertCreateCertificateContext,
  240.            (IN DWORD dwCertEncodingType, IN const BYTE *pbCertEncoded, IN DWORD cbCertEncoded),
  241.            (dwCertEncodingType,pbCertEncoded,cbCertEncoded));
  242. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertAddCertificateContextToStore,
  243.            (IN HCERTSTORE hCertStore,
  244.             IN PCCERT_CONTEXT pCertContext,
  245.             IN DWORD dwAddDisposition,
  246.             OUT OPTIONAL PCCERT_CONTEXT *ppStoreContext),
  247.            (hCertStore,pCertContext,dwAddDisposition,ppStoreContext));
  248. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, PCCERT_CONTEXT, CertEnumCertificatesInStore,
  249.            (IN HCERTSTORE hCertStore,
  250.             IN PCCERT_CONTEXT pPrevCertContext),
  251.            (hCertStore,pPrevCertContext));
  252. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, PFXExportCertStore,
  253.            (HCERTSTORE hStore,
  254.             CRYPT_DATA_BLOB* pPFX,
  255.             LPCWSTR szPassword,
  256.             DWORD   dwFlags),
  257.            (hStore,pPFX, szPassword, dwFlags));
  258. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, HCERTSTORE, PFXImportCertStore,
  259.            (CRYPT_DATA_BLOB* pPFX,
  260.             LPCWSTR szPassword,
  261.             DWORD   dwFlags),
  262.            (pPFX,szPassword,dwFlags));
  263. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, HCERTSTORE, CertOpenStore,
  264.            (IN LPCSTR lpszStoreProvider,
  265.             IN DWORD dwEncodingType,
  266.             IN HCRYPTPROV hCryptProv,
  267.             IN DWORD dwFlags,
  268.             IN const void *pvPara),
  269.            (lpszStoreProvider,
  270.             dwEncodingType,
  271.             hCryptProv,
  272.             dwFlags,
  273.             pvPara));
  274. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CryptHashCertificate,
  275.            (IN HCRYPTPROV hCryptProv,
  276.             IN ALG_ID Algid,
  277.             IN DWORD dwFlags,
  278.             IN const BYTE *pbEncoded,
  279.             IN DWORD cbEncoded,
  280.             OUT BYTE *pbComputedHash,
  281.             IN OUT DWORD *pcbComputedHash
  282.            ),
  283.            (hCryptProv,Algid,dwFlags,pbEncoded,cbEncoded,pbComputedHash,pcbComputedHash));
  284. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, PCCERT_CONTEXT, CertDuplicateCertificateContext,
  285.            (IN PCCERT_CONTEXT pCertContext),
  286.            (pCertContext));
  287. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CertGetCertificateContextProperty,
  288.             (IN PCCERT_CONTEXT pCertContext,
  289.              IN DWORD dwPropId,
  290.              OUT void *pvData,
  291.              IN OUT DWORD *pcbData
  292.             ),
  293.             (pCertContext, dwPropId, pvData, pcbData));
  294. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, BOOL, CryptDecodeObject,
  295.             (IN DWORD       dwCertEncodingType,
  296.              IN LPCSTR      lpszStructType,
  297.              IN const BYTE  *pbEncoded,
  298.              IN DWORD       cbEncoded,
  299.              IN DWORD       dwFlags,
  300.              OUT void       *pvStructInfo,
  301.              IN OUT DWORD   *pcbStructInfo
  302.              ),
  303.              (dwCertEncodingType, lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo));
  304. DELAY_LOAD(g_hinstCrypt32, CRYPT32.DLL, PCERT_EXTENSION, CertFindExtension,
  305.            (IN LPCSTR           pszObjId,
  306.             IN DWORD            cExtensions,
  307.             IN CERT_EXTENSION   rgExtensions[]
  308.             ),
  309.             (pszObjId, cExtensions, rgExtensions));
  310. // -------- cryptui.dll ----------------------------
  311. HINSTANCE g_hinstCryptui = NULL;
  312. DELAY_LOAD(g_hinstCryptui, CRYPTUI.DLL, BOOL, CryptUIDlgCertMgr,
  313.            (PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr),
  314.            (pCryptUICertMgr));
  315. //--------- shdocvw.dll ------------------
  316. HINSTANCE g_hinstShdocvw = NULL;
  317. const TCHAR c_tszShdocvw[] = TEXT("SHDOCVW.DLL");
  318. // HRESULT URLSubRegQueryA(LPCSTR pszKey, LPCSTR pszValue, BOOL fUseHKCU, LPSTR pszUrlOut, DWORD cchSize, DWORD dwSubstitutions);
  319. DELAY_LOAD_ORD_HRESULT(g_hinstShdocvw, SHDOCVW.DLL, URLSubRegQueryA, 151,
  320.                        (LPCSTR pszKey, LPCSTR pszValue, BOOL fUseHKCU, LPSTR pszUrlOut, DWORD cchSize, DWORD dwSubstitutions),
  321.                        (pszKey, pszValue, fUseHKCU, pszUrlOut, cchSize, dwSubstitutions));
  322. // HRESULT ResetProfileSharing(HWND hwin);
  323. DELAY_LOAD_ORD_HRESULT(g_hinstShdocvw, SHDOCVW.DLL, ResetProfileSharing, 164,
  324.                         (HWND hwnd),
  325.                         (hwnd));
  326. // HRESULT ClearAutoSuggestForForms(DWORD dwClear);
  327. DELAY_LOAD_ORD_HRESULT(g_hinstShdocvw, SHDOCVW.DLL, ClearAutoSuggestForForms, 211,
  328.                         (DWORD dwClear),
  329.                         (dwClear));
  330. // HRESULT ResetWebSettings(HWND hwnd)
  331. DELAY_LOAD_ORD_HRESULT(g_hinstShdocvw, SHDOCVW.DLL, ResetWebSettings, 223,
  332.                         (HWND hwnd, BOOL *pfChangedHomePage),
  333.                         (hwnd,pfChangedHomePage));
  334. #ifdef UNIX_FEATURE_ALIAS
  335. DELAY_LOAD_ORD_HRESULT(g_hinstShdocvw, SHDOCVW.DLL, RefreshGlobalAliasList, 164,
  336.                         (),
  337.                         ());
  338. #endif /* UNIX_FEATURE_ALIAS */
  339. //--------- msrating.dll ----------------
  340. HINSTANCE g_hinstRatings = NULL;
  341. const TCHAR c_tszRatingsDLL[] = TEXT("MSRATING.DLL");
  342. DELAY_LOAD(g_hinstRatings, MSRATING.DLL, HRESULT, RatingEnable,
  343.            (HWND hwndParent, LPCSTR pszUsername, BOOL fEnable),
  344.            (hwndParent,pszUsername,fEnable));
  345. DELAY_LOAD(g_hinstRatings, MSRATING.DLL, HRESULT, RatingSetupUI,
  346.            (HWND hDlg, LPCSTR pszUsername),
  347.            (hDlg, pszUsername));
  348. DELAY_LOAD(g_hinstRatings, MSRATING.DLL, HRESULT, RatingEnabledQuery,
  349.            (), ());
  350. // --------- mshtml.dll --------------------
  351. HINSTANCE g_hinstMSHTML = NULL;
  352. const TCHAR c_tszMSHTMLDLL[] = TEXT("MSHTML.DLL");
  353. DELAY_LOAD(g_hinstMSHTML, MSHTML.DLL, HRESULT, ShowModalDialog,
  354.            (HWND hwndParent, IMoniker *pmk, VARIANT *pvarArgIn, TCHAR* pchOptions, VARIANT *pvarArgOut),
  355.            (hwndParent,pmk,pvarArgIn,pchOptions,pvarArgOut));
  356. //
  357. // BUGBUG: We don't need to delay load anything from MSHTML, 
  358. //         but we are using this still to determine if 
  359. //         MSHTML.DLL is around.
  360. //
  361. HINSTANCE g_hinstOCCache = NULL;
  362. DELAY_LOAD_HRESULT(g_hinstOCCache, OCCache.DLL, RemoveExpiredControls,
  363.                    (DWORD dwFlags, DWORD dwReserved),
  364.                    ( dwFlags, dwReserved));
  365. // --------- mpr.dll --------------------
  366. HINSTANCE g_hinstMPR = NULL;
  367. const TCHAR c_tszMPRDLL[] = TEXT("MPR.DLL");
  368. #ifndef UNICODE
  369. DELAY_LOAD(g_hinstMPR, MPR.DLL, DWORD, WNetGetConnectionA,
  370.            (LPCSTR pszLocalDevice, LPSTR pszUNC, LPDWORD pcbUNC),
  371.            (pszLocalDevice, pszUNC, pcbUNC));
  372. #else
  373. DELAY_LOAD(g_hinstMPR, MPR.DLL, DWORD, WNetGetConnectionW,
  374.            (LPCTSTR pszLocalDevice, LPTSTR pszUNC, LPDWORD pcbUNC),
  375.            (pszLocalDevice, pszUNC, pcbUNC));
  376. #endif
  377. // ---------- end of DLL definitions --------
  378. #pragma warning(default:4229)