Leaked source code of windows server 2003
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.

1032 lines
36 KiB

  1. /*
  2. ** d e m a n d . h
  3. **
  4. ** Purpose: create an intelligent method of defer loading functions
  5. **
  6. ** Creators: jimsch, brimo, t-erikne
  7. ** Created: 5/15/97
  8. **
  9. ** Copyright (C) Microsoft Corp. 1997
  10. */
  11. //
  12. // IF YOU #INCLUDE A FILE HERE YOU PROBABLY CONFUSED.
  13. // THIS FILE IS INCLUDED BY LOTS OF PEOPLE. THINK THRICE
  14. // BEFORE #INCLUDING *ANYTHING* HERE. MAKE GOOD USE
  15. // OF FORWARD REFS, THIS IS C++.
  16. //
  17. #define USE_CRITSEC
  18. #ifdef IMPLEMENT_LOADER_FUNCTIONS
  19. #define LOADER_FUNCTION(ret, name, args1, args2, err, dll) \
  20. typedef ret (WINAPI * TYP_##name) args1; \
  21. extern TYP_##name VAR_##name; \
  22. ret WINAPI LOADER_##name args1 \
  23. { \
  24. DemandLoad##dll(); \
  25. if (VAR_##name == LOADER_##name) return err; \
  26. return VAR_##name args2; \
  27. } \
  28. TYP_##name VAR_##name = LOADER_##name;
  29. #define LOADER_FUNCTION_VOID(ret, name, args1, args2, dll) \
  30. typedef ret (WINAPI * TYP_##name) args1; \
  31. extern TYP_##name VAR_##name; \
  32. ret WINAPI LOADER_##name args1 \
  33. { \
  34. DemandLoad##dll(); \
  35. if (VAR_##name == LOADER_##name) return; \
  36. VAR_##name args2; \
  37. return; \
  38. } \
  39. TYP_##name VAR_##name = LOADER_##name;
  40. #else // !IMPLEMENT_LOADER_FUNCTIONS
  41. #define LOADER_FUNCTION(ret, name, args1, args2, err, dll) \
  42. typedef ret (WINAPI * TYP_##name) args1; \
  43. extern TYP_##name VAR_##name; \
  44. #define LOADER_FUNCTION_VOID(ret, name, args1, args2, dll) \
  45. typedef ret (WINAPI * TYP_##name) args1; \
  46. extern TYP_##name VAR_##name;
  47. #endif // IMPLEMENT_LOADER_FUNCTIONS
  48. extern HINSTANCE g_hInst;
  49. void InitDemandLoadedLibs();
  50. void FreeDemandLoadedLibs();
  51. /////////////////////////////////////
  52. // CRYPT32.DLL
  53. #define _CRYPT32_
  54. BOOL DemandLoadCrypt32(void);
  55. typedef void *HCERTSTORE;
  56. typedef const struct _CERT_CONTEXT *PCCERT_CONTEXT;
  57. typedef unsigned long HCRYPTPROV;
  58. typedef struct _CERT_INFO *PCERT_INFO;
  59. typedef struct _CERT_RDN_ATTR *PCERT_RDN_ATTR;
  60. typedef struct _CERT_NAME_INFO *PCERT_NAME_INFO;
  61. typedef void *HCRYPTMSG;
  62. typedef struct _CMSG_STREAM_INFO *PCMSG_STREAM_INFO;
  63. typedef struct _CERT_RDN_ATTR *PCERT_RDN_ATTR;
  64. typedef struct _CERT_NAME_INFO *PCCERT_NAME_INFO;
  65. LOADER_FUNCTION( DWORD, CertRDNValueToStrA,
  66. (DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, LPTSTR pszValueString, DWORD cszValueString),
  67. (dwValueType, pValue, pszValueString, cszValueString),
  68. NULL, Crypt32)
  69. #define CertRDNValueToStrA VAR_CertRDNValueToStrA
  70. LOADER_FUNCTION( BOOL, CertAddCertificateContextToStore,
  71. (HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT *ppStoreContext),
  72. (hCertStore, pCertContext, dwAddDisposition, ppStoreContext),
  73. FALSE, Crypt32)
  74. #define CertAddCertificateContextToStore VAR_CertAddCertificateContextToStore
  75. LOADER_FUNCTION( PCCERT_CONTEXT, CertEnumCertificatesInStore,
  76. (HCERTSTORE hCertStore, PCCERT_CONTEXT pPrevCertContext),
  77. (hCertStore, pPrevCertContext),
  78. NULL, Crypt32)
  79. #define CertEnumCertificatesInStore VAR_CertEnumCertificatesInStore
  80. LOADER_FUNCTION( BOOL, CryptDecodeObject,
  81. (DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo),
  82. (dwCertEncodingType, lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo),
  83. FALSE, Crypt32)
  84. #define CryptDecodeObject VAR_CryptDecodeObject
  85. LOADER_FUNCTION( BOOL, CryptEncodeObject,
  86. (DWORD dwCertEncodingType, LPCSTR lpszStructType, const void * pvStructInfo, BYTE * pbEncoded, DWORD * pcbEncoded),
  87. (dwCertEncodingType, lpszStructType, pvStructInfo, pbEncoded, pcbEncoded),
  88. FALSE, Crypt32)
  89. #define CryptEncodeObject VAR_CryptEncodeObject
  90. LOADER_FUNCTION( BOOL, CryptDecodeObjectEx,
  91. (DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo),
  92. (dwCertEncodingType, lpszStructType, pbEncoded, cbEncoded, dwFlags, pDecodePara, pvStructInfo, pcbStructInfo),
  93. FALSE, Crypt32)
  94. #define CryptDecodeObjectEx VAR_CryptDecodeObjectEx
  95. LOADER_FUNCTION( BOOL, CryptEncodeObjectEx,
  96. (DWORD dwCertEncodingType, LPCSTR lpszStructType, const void * pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, void * pbEncoded, DWORD * pcbEncoded),
  97. (dwCertEncodingType, lpszStructType, pvStructInfo, dwFlags, pEncodePara, pbEncoded, pcbEncoded),
  98. FALSE, Crypt32)
  99. #define CryptEncodeObjectEx VAR_CryptEncodeObjectEx
  100. LOADER_FUNCTION(PCERT_RDN_ATTR, CertFindRDNAttr,
  101. (LPCSTR pszObjId, PCERT_NAME_INFO pName),
  102. (pszObjId, pName),
  103. NULL, Crypt32)
  104. #define CertFindRDNAttr VAR_CertFindRDNAttr
  105. LOADER_FUNCTION( BOOL, CertFreeCertificateContext,
  106. (PCCERT_CONTEXT pCertContext),
  107. (pCertContext),
  108. TRUE, Crypt32) // return success since GLE() is meaningless
  109. #define CertFreeCertificateContext VAR_CertFreeCertificateContext
  110. LOADER_FUNCTION( PCCERT_CONTEXT, CertDuplicateCertificateContext,
  111. (PCCERT_CONTEXT pCertContext),
  112. (pCertContext), NULL, Crypt32)
  113. #define CertDuplicateCertificateContext VAR_CertDuplicateCertificateContext
  114. LOADER_FUNCTION( PCCERT_CONTEXT, CertFindCertificateInStore,
  115. (HCERTSTORE hCertStore, DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType, const void *pvFindPara, PCCERT_CONTEXT pPrevCertContext),
  116. (hCertStore, dwCertEncodingType, dwFindFlags, dwFindType, pvFindPara, pPrevCertContext),
  117. NULL, Crypt32)
  118. #define CertFindCertificateInStore VAR_CertFindCertificateInStore
  119. LOADER_FUNCTION( LONG, CertVerifyTimeValidity,
  120. (LPFILETIME pTimeToVerify, PCERT_INFO pCertInfo),
  121. (pTimeToVerify, pCertInfo),
  122. 1, Crypt32)
  123. #define CertVerifyTimeValidity VAR_CertVerifyTimeValidity
  124. LOADER_FUNCTION( BOOL, CertCompareCertificate,
  125. (DWORD dwCertEncodingType, PCERT_INFO pCertId1, PCERT_INFO pCertId2),
  126. (dwCertEncodingType, pCertId1, pCertId2),
  127. FALSE, Crypt32)
  128. #define CertCompareCertificate VAR_CertCompareCertificate
  129. LOADER_FUNCTION( HCERTSTORE, CertOpenStore,
  130. (LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara),
  131. (lpszStoreProvider, dwEncodingType, hCryptProv, dwFlags, pvPara),
  132. NULL, Crypt32)
  133. #define CertOpenStore VAR_CertOpenStore
  134. LOADER_FUNCTION( HCERTSTORE, CertDuplicateStore,
  135. (HCERTSTORE hCertStore),
  136. (hCertStore),
  137. NULL, Crypt32)
  138. #define CertDuplicateStore VAR_CertDuplicateStore
  139. LOADER_FUNCTION( BOOL, CertCloseStore,
  140. (HCERTSTORE hCertStore, DWORD dwFlags),
  141. (hCertStore, dwFlags),
  142. FALSE, Crypt32)
  143. #define CertCloseStore VAR_CertCloseStore
  144. LOADER_FUNCTION( PCCERT_CONTEXT, CertGetSubjectCertificateFromStore,
  145. (HCERTSTORE hCertStore, DWORD dwCertEncodingType, PCERT_INFO pCertId),
  146. (hCertStore, dwCertEncodingType, pCertId),
  147. NULL, Crypt32)
  148. #define CertGetSubjectCertificateFromStore VAR_CertGetSubjectCertificateFromStore
  149. LOADER_FUNCTION( PCCERT_CONTEXT, CertGetIssuerCertificateFromStore,
  150. (HCERTSTORE hCertStore, PCCERT_CONTEXT pSubjectContext, PCCERT_CONTEXT pPrevIssuerContext, DWORD *pdwFlags),
  151. (hCertStore, pSubjectContext, pPrevIssuerContext, pdwFlags),
  152. NULL, Crypt32)
  153. #define CertGetIssuerCertificateFromStore VAR_CertGetIssuerCertificateFromStore
  154. LOADER_FUNCTION( BOOL, CertGetCertificateContextProperty,
  155. (PCCERT_CONTEXT pCertContext, DWORD dwPropId, void *pvData, DWORD *pcbData),
  156. (pCertContext, dwPropId, pvData, pcbData),
  157. FALSE, Crypt32)
  158. #define CertGetCertificateContextProperty VAR_CertGetCertificateContextProperty
  159. LOADER_FUNCTION( HCRYPTMSG, CryptMsgOpenToEncode,
  160. (DWORD dwMsgEncodingType, DWORD dwFlags, DWORD dwMsgType, void const *pvMsgEncodeInfo, LPSTR pszInnerContentObjID, PCMSG_STREAM_INFO pStreamInfo),
  161. (dwMsgEncodingType, dwFlags, dwMsgType, pvMsgEncodeInfo, pszInnerContentObjID, pStreamInfo),
  162. NULL, Crypt32)
  163. #define CryptMsgOpenToEncode VAR_CryptMsgOpenToEncode
  164. LOADER_FUNCTION( HCRYPTMSG, CryptMsgOpenToDecode,
  165. (DWORD dwMsgEncodingType, DWORD dwFlags, DWORD dwMsgType, HCRYPTPROV hCryptProv, PCERT_INFO pRecipientInfo, PCMSG_STREAM_INFO pStreamInfo),
  166. (dwMsgEncodingType, dwFlags, dwMsgType, hCryptProv, pRecipientInfo, pStreamInfo),
  167. NULL, Crypt32)
  168. #define CryptMsgOpenToDecode VAR_CryptMsgOpenToDecode
  169. LOADER_FUNCTION( BOOL, CryptMsgUpdate,
  170. (HCRYPTMSG hCryptMsg, const BYTE *pbData, DWORD cbData, BOOL fFinal),
  171. (hCryptMsg, pbData, cbData, fFinal),
  172. FALSE, Crypt32)
  173. #define CryptMsgUpdate VAR_CryptMsgUpdate
  174. LOADER_FUNCTION( BOOL, CryptMsgGetParam,
  175. (HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex, void *pvData, DWORD *pcbData),
  176. (hCryptMsg, dwParamType, dwIndex, pvData, pcbData),
  177. FALSE, Crypt32)
  178. #define CryptMsgGetParam VAR_CryptMsgGetParam
  179. LOADER_FUNCTION( BOOL, CryptMsgControl,
  180. (HCRYPTMSG hCryptMsg, DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara),
  181. (hCryptMsg, dwFlags, dwCtrlType, pvCtrlPara),
  182. FALSE, Crypt32)
  183. #define CryptMsgControl VAR_CryptMsgControl
  184. LOADER_FUNCTION( BOOL, CryptMsgClose,
  185. (HCRYPTMSG hCryptMsg),
  186. (hCryptMsg),
  187. TRUE, Crypt32) // return success since GLE() is meaningless
  188. #define CryptMsgClose VAR_CryptMsgClose
  189. LOADER_FUNCTION( BOOL, CertAddEncodedCRLToStore,
  190. (HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded, DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext),
  191. (hCertStore, dwCertEncodingType, pbCrlEncoded, cbCrlEncoded, dwAddDisposition, ppCrlContext),
  192. FALSE, Crypt32)
  193. #define CertAddEncodedCRLToStore VAR_CertAddEncodedCRLToStore
  194. LOADER_FUNCTION( PCCRL_CONTEXT, CertEnumCRLsInStore,
  195. (HCERTSTORE hCertStore, PCCRL_CONTEXT pPrevCrlContext),
  196. (hCertStore, pPrevCrlContext),
  197. NULL, Crypt32)
  198. #define CertEnumCRLsInStore VAR_CertEnumCRLsInStore
  199. LOADER_FUNCTION( PCERT_EXTENSION, CertFindExtension,
  200. (LPCSTR pszObjId, DWORD cExtensions, CERT_EXTENSION * rgExtensions),
  201. (pszObjId, cExtensions, rgExtensions),
  202. NULL, Crypt32)
  203. #define CertFindExtension VAR_CertFindExtension
  204. LOADER_FUNCTION( BOOL, CertStrToNameW,
  205. (DWORD dwCertEncodingType, LPCWSTR pszX500, DWORD dwStrType,
  206. void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded, LPCWSTR *ppszError),
  207. (dwCertEncodingType, pszX500, dwStrType, pvReserved, pbEncoded, pcbEncoded,
  208. ppszError),
  209. NULL, Crypt32)
  210. #define CertStrToNameW VAR_CertStrToNameW
  211. LOADER_FUNCTION( BOOL, CertAddEncodedCertificateToStore,
  212. (HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCertEncoded,
  213. DWORD cbCertEncoded, DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext),
  214. (hCertStore, dwCertEncodingType, pbCertEncoded,
  215. cbCertEncoded, dwAddDisposition, ppCertContext),
  216. FALSE, Crypt32)
  217. #define CertAddEncodedCertificateToStore VAR_CertAddEncodedCertificateToStore
  218. LOADER_FUNCTION( BOOL, CertAddStoreToCollection,
  219. (HCERTSTORE hCollectionStore, HCERTSTORE hSiblingStore, DWORD dwUpdateFlags,
  220. DWORD dwPriority),
  221. (hCollectionStore, hSiblingStore, dwUpdateFlags, dwPriority),
  222. FALSE, Crypt32)
  223. #define CertAddStoreToCollection VAR_CertAddStoreToCollection
  224. /////////////////////////////////////
  225. // CRYPTDLG.DLL
  226. #define _CRYPTDLG_
  227. // Old cert dialogs
  228. typedef struct tagCERT_VIEWPROPERTIES_STRUCT_A *PCERT_VIEWPROPERTIES_STRUCT_A;
  229. typedef struct tagCSSA *PCERT_SELECT_STRUCT_A;
  230. BOOL DemandLoadCryptDlg();
  231. LOADER_FUNCTION( BOOL, CertViewPropertiesA,
  232. (PCERT_VIEWPROPERTIES_STRUCT_A pCertViewInfo),
  233. (pCertViewInfo),
  234. FALSE, CryptDlg)
  235. #define CertViewPropertiesA VAR_CertViewPropertiesA
  236. LOADER_FUNCTION( DWORD, GetFriendlyNameOfCertA,
  237. (PCCERT_CONTEXT pccert, LPSTR pchBuffer, DWORD cchBuffer),
  238. (pccert, pchBuffer, cchBuffer),
  239. 0, CryptDlg)
  240. #define GetFriendlyNameOfCertA VAR_GetFriendlyNameOfCertA
  241. LOADER_FUNCTION( BOOL, CertSelectCertificateA,
  242. (PCERT_SELECT_STRUCT_A pCertSelectInfo),
  243. (pCertSelectInfo),
  244. FALSE, CryptDlg)
  245. #define CertSelectCertificateA VAR_CertSelectCertificateA
  246. /////////////////////////////////////
  247. // WINTRUST.DLL
  248. BOOL DemandLoadWinTrust();
  249. LOADER_FUNCTION( LONG, WinVerifyTrust,
  250. (HWND hwnd, GUID *ActionID, LPVOID ActionData),
  251. (hwnd, ActionID, ActionData),
  252. 0, WinTrust)
  253. #define WinVerifyTrust VAR_WinVerifyTrust
  254. #if 0
  255. /////////////////////////////////////
  256. // WININET.DLL
  257. #include <wininet.h>
  258. #define _WININET_
  259. typedef struct _INTERNET_CACHE_ENTRY_INFOA INTERNET_CACHE_ENTRY_INFOA;
  260. BOOL DemandLoadWinINET();
  261. LOADER_FUNCTION( BOOL, RetrieveUrlCacheEntryFileA,
  262. (LPCSTR lpszUrlName, INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo, LPDWORD lpdwCacheEntryInfoBufferSize, DWORD dwReserved),
  263. (lpszUrlName, lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize, dwReserved),
  264. FALSE, WinINET)
  265. #define RetrieveUrlCacheEntryFileA VAR_RetrieveUrlCacheEntryFileA
  266. LOADER_FUNCTION( BOOL, UnlockUrlCacheEntryFileA,
  267. (LPCSTR lpszUrlName, DWORD dwRes),
  268. (lpszUrlName, dwRes),
  269. FALSE, WinINET)
  270. #define UnlockUrlCacheEntryFileA VAR_UnlockUrlCacheEntryFileA
  271. LOADER_FUNCTION( BOOL, InternetQueryOptionA,
  272. (HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength),
  273. (hInternet, dwOption, lpBuffer, lpdwBufferLength),
  274. NULL, WinINET)
  275. #define InternetQueryOptionA VAR_InternetQueryOptionA
  276. LOADER_FUNCTION( BOOL, InternetSetOptionA,
  277. (HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength),
  278. (hInternet, dwOption, lpBuffer, dwBufferLength),
  279. NULL, WinINET)
  280. #define InternetSetOptionA VAR_InternetSetOptionA
  281. LOADER_FUNCTION( BOOL, InternetDialA,
  282. (HWND hwndParent, LPSTR lpszConnectoid, DWORD dwFlags, DWORD *lpdwConnection, DWORD dwReserved),
  283. (hwndParent, lpszConnectoid, dwFlags, lpdwConnection, dwReserved),
  284. NULL, WinINET)
  285. #define InternetDialA VAR_InternetDialA
  286. LOADER_FUNCTION( BOOL, InternetHangUp,
  287. (DWORD dwConnection, DWORD dwReserved),
  288. (dwConnection, dwReserved),
  289. NULL, WinINET)
  290. #define InternetHangUp VAR_InternetHangUp
  291. LOADER_FUNCTION(BOOL, InternetGetConnectedStateExA,
  292. (LPDWORD dwFlags, LPTSTR szconn, DWORD size, DWORD reserved),
  293. (dwFlags, szconn, size, reserved),
  294. FALSE, WinINET)
  295. #define InternetGetConnectedStateExA VAR_InternetGetConnectedStateExA
  296. LOADER_FUNCTION(BOOL, InternetCombineUrlA,
  297. (LPCSTR lpszBaseUrl, LPCSTR lpszRelativeUrl, LPSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags),
  298. (lpszBaseUrl, lpszRelativeUrl, lpszBuffer, lpdwBufferLength, dwFlags),
  299. FALSE, WinINET)
  300. #define InternetCombineUrlA VAR_InternetCombineUrlA
  301. LOADER_FUNCTION(BOOL, InternetCrackUrlA,
  302. (LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, LPURL_COMPONENTS lpUrlComponents),
  303. (lpszUrl, dwUrlLength, dwFlags, lpUrlComponents),
  304. FALSE, WinINET)
  305. #define InternetCrackUrlA VAR_InternetCrackUrlA
  306. LOADER_FUNCTION(BOOL, InternetCloseHandle,
  307. (HINTERNET hInternet),
  308. (hInternet),
  309. FALSE, WinINET)
  310. #define InternetCloseHandle VAR_InternetCloseHandle
  311. LOADER_FUNCTION(BOOL, InternetReadFile,
  312. (HINTERNET hInternet, LPVOID lpBuffer, DWORD dwNumberOfBytesToRead, LPDWORD lpdwNumberOfBytesRead),
  313. (hInternet, lpBuffer, dwNumberOfBytesToRead, lpdwNumberOfBytesRead),
  314. FALSE, WinINET)
  315. #define InternetReadFile VAR_InternetReadFile
  316. LOADER_FUNCTION(HINTERNET, InternetConnectA,
  317. (HINTERNET hInternet, LPCSTR lpszServerName, INTERNET_PORT nServerPort,
  318. LPCSTR lpszUserName,LPCSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD dwContext),
  319. (hInternet, lpszServerName, nServerPort, lpszUserName, lpszPassword, dwService, dwFlags, dwContext),
  320. NULL, WinINET)
  321. #define InternetConnectA VAR_InternetConnectA
  322. LOADER_FUNCTION(HINTERNET, InternetOpenA,
  323. (LPCSTR lpszAgent, DWORD dwAccessType, LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags),
  324. (lpszAgent, dwAccessType, lpszProxy, lpszProxyBypass, dwFlags),
  325. NULL, WinINET)
  326. #define InternetOpenA VAR_InternetOpenA
  327. LOADER_FUNCTION(BOOL, HttpQueryInfoA,
  328. (HINTERNET hRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex),
  329. (hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex),
  330. FALSE, WinINET)
  331. #define HttpQueryInfoA VAR_HttpQueryInfoA
  332. LOADER_FUNCTION(HINTERNET, HttpOpenRequestA,
  333. (HINTERNET hConnect, LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion,
  334. LPCSTR lpszReferrer, LPCSTR FAR * lplpszAcceptTypes, DWORD dwFlags, DWORD dwContext),
  335. ( hConnect, lpszVerb, lpszObjectName, lpszVersion, lpszReferrer, lplpszAcceptTypes, dwFlags, dwContext),
  336. NULL, WinINET)
  337. #define HttpOpenRequestA VAR_HttpOpenRequestA
  338. LOADER_FUNCTION(BOOL, HttpAddRequestHeadersA,
  339. (HINTERNET hRequest, LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwModifiers),
  340. (hRequest, lpszHeaders, dwHeadersLength, dwModifiers),
  341. FALSE, WinINET)
  342. #define HttpAddRequestHeadersA VAR_HttpAddRequestHeadersA
  343. LOADER_FUNCTION(BOOL, HttpSendRequestA,
  344. (HINTERNET hRequest, LPCSTR lpszHeaders, DWORD dwHeadersLength, LPVOID lpOptional, DWORD dwOptionalLength),
  345. (hRequest, lpszHeaders, dwHeadersLength, lpOptional, dwOptionalLength),
  346. FALSE, WinINET)
  347. #define HttpSendRequestA VAR_HttpSendRequestA
  348. LOADER_FUNCTION(BOOL, InternetWriteFile,
  349. (HINTERNET hFile, LPCVOID lpBuffer, DWORD dwNumberOfBytesToWrite, LPDWORD lpdwNumberOfBytesWritten),
  350. (hFile, lpBuffer, dwNumberOfBytesToWrite, lpdwNumberOfBytesWritten),
  351. FALSE, WinINET)
  352. #define InternetWriteFile VAR_InternetWriteFile
  353. LOADER_FUNCTION(BOOL, HttpEndRequestA,
  354. (HINTERNET hRequest, LPINTERNET_BUFFERSA lpBuffersOut, DWORD dwFlags, DWORD dwContext),
  355. (hRequest, lpBuffersOut, dwFlags, dwContext),
  356. FALSE, WinINET)
  357. #define HttpEndRequestA VAR_HttpEndRequestA
  358. LOADER_FUNCTION(BOOL, HttpSendRequestExA,
  359. (HINTERNET hRequest, LPINTERNET_BUFFERSA lpBuffersIn,
  360. LPINTERNET_BUFFERSA lpBuffersOut, DWORD dwFlags, DWORD dwContext),
  361. (hRequest, lpBuffersIn, lpBuffersOut, dwFlags, dwContext),
  362. FALSE, WinINET)
  363. #define HttpSendRequestExA VAR_HttpSendRequestExA
  364. /////////////////////////////////////
  365. // SHELL32.DLL
  366. #include <shellapi.h>
  367. #include <shlobj.h>
  368. #include <shlobjp.h>
  369. BOOL DemandLoadSHELL32();
  370. LOADER_FUNCTION(BOOL, SHFree, // Actually a void
  371. (LPVOID lpv),
  372. (lpv),
  373. FALSE, SHELL32)
  374. #define SHFree VAR_SHFree
  375. LOADER_FUNCTION(BOOL, SHGetPathFromIDListA,
  376. (LPCITEMIDLIST pidl, LPSTR pszPath),
  377. (pidl, pszPath),
  378. FALSE, SHELL32)
  379. #define SHGetPathFromIDListA VAR_SHGetPathFromIDListA
  380. LOADER_FUNCTION(HRESULT, SHGetSpecialFolderLocation,
  381. (HWND hwndOwner, int nFolder, LPITEMIDLIST * ppidl),
  382. (hwndOwner, nFolder, ppidl),
  383. E_FAIL, SHELL32)
  384. #define SHGetSpecialFolderLocation VAR_SHGetSpecialFolderLocation
  385. LOADER_FUNCTION(LPITEMIDLIST, SHBrowseForFolderA,
  386. (LPBROWSEINFOA lpbi),
  387. (lpbi),
  388. NULL, SHELL32)
  389. #define SHBrowseForFolderA VAR_SHBrowseForFolderA
  390. LOADER_FUNCTION(HINSTANCE, ShellExecuteA,
  391. (HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd),
  392. (hwnd, lpOperation, lpFile, lpParameters, lpDirectory, nShowCmd),
  393. NULL, SHELL32)
  394. #define ShellExecuteA VAR_ShellExecuteA
  395. LOADER_FUNCTION(BOOL, ShellExecuteExA,
  396. (LPSHELLEXECUTEINFOA lpExecInfo),
  397. (lpExecInfo),
  398. FALSE, SHELL32)
  399. #define ShellExecuteExA VAR_ShellExecuteExA
  400. LOADER_FUNCTION(UINT, DragQueryFileA,
  401. (HDROP hDrop, UINT iFile, LPSTR lpszFile, UINT cb),
  402. (hDrop, iFile, lpszFile, cb),
  403. 0, SHELL32)
  404. #define DragQueryFileA VAR_DragQueryFileA
  405. LOADER_FUNCTION(DWORD, SHGetFileInfoA,
  406. (LPCSTR pszPath, DWORD dwFileAttributes, SHFILEINFOA FAR *psfi, UINT cbFileInfo, UINT uFlags),
  407. (pszPath, dwFileAttributes, psfi, cbFileInfo, uFlags),
  408. 0, SHELL32)
  409. #define SHGetFileInfoA VAR_SHGetFileInfoA
  410. LOADER_FUNCTION(BOOL, Shell_NotifyIconA,
  411. (DWORD dwMessage, PNOTIFYICONDATAA lpData),
  412. (dwMessage, lpData),
  413. FALSE, SHELL32)
  414. #define Shell_NotifyIconA VAR_Shell_NotifyIconA
  415. LOADER_FUNCTION(int, SHFileOperationA,
  416. (LPSHFILEOPSTRUCTA lpfo),
  417. (lpfo),
  418. -1, SHELL32)
  419. #define SHFileOperationA VAR_SHFileOperationA
  420. LOADER_FUNCTION(HICON, ExtractIconA,
  421. (HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex),
  422. (hInst, lpszExeFileName, nIconIndex),
  423. NULL, SHELL32)
  424. #define ExtractIconA VAR_ExtractIconA
  425. #if 0
  426. /////////////////////////////////////
  427. // OLEAUT32.DLL
  428. BOOL DemandLoadOLEAUT32();
  429. #include <olectl.h>
  430. LOADER_FUNCTION(SAFEARRAY *, SafeArrayCreate,
  431. (VARTYPE vt, UINT cDims, SAFEARRAYBOUND* rgsabound),
  432. (vt, cDims, rgsabound),
  433. NULL, OLEAUT32)
  434. #define SafeArrayCreate VAR_SafeArrayCreate
  435. LOADER_FUNCTION(HRESULT, SafeArrayPutElement,
  436. (SAFEARRAY * psa, LONG * rgIndices, void * pv),
  437. (psa, rgIndices, pv),
  438. E_FAIL, OLEAUT32)
  439. #define SafeArrayPutElement VAR_SafeArrayPutElement
  440. LOADER_FUNCTION(HRESULT, DispInvoke,
  441. (void * _this, ITypeInfo * ptinfo, DISPID dispidMember, WORD wFlags, DISPPARAMS * pparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo, UINT * puArgErr),
  442. (_this, ptinfo, dispidMember, wFlags, pparams, pvarResult, pexcepinfo, puArgErr),
  443. E_FAIL, OLEAUT32)
  444. #define DispInvoke VAR_DispInvoke
  445. LOADER_FUNCTION(HRESULT, DispGetIDsOfNames,
  446. (ITypeInfo * ptinfo, OLECHAR ** rgszNames, UINT cNames, DISPID * rgdispid),
  447. (ptinfo, rgszNames, cNames, rgdispid),
  448. E_FAIL, OLEAUT32)
  449. #define DispGetIDsOfNames VAR_DispGetIDsOfNames
  450. LOADER_FUNCTION(BSTR, SysAllocStringByteLen,
  451. (LPCSTR psz, UINT len),
  452. (psz, len),
  453. NULL, OLEAUT32)
  454. #define SysAllocStringByteLen VAR_SysAllocStringByteLen
  455. LOADER_FUNCTION(int, SysReAllocString,
  456. (BSTR * pbstr, const OLECHAR * sz),
  457. (pbstr, sz),
  458. 0, OLEAUT32)
  459. #define SysReAllocString VAR_SysReAllocString
  460. LOADER_FUNCTION(BSTR, SysAllocStringLen,
  461. (const OLECHAR *pch, unsigned int i),
  462. (pch, i),
  463. NULL, OLEAUT32)
  464. #define SysAllocStringLen VAR_SysAllocStringLen
  465. LOADER_FUNCTION(BSTR, SysAllocString,
  466. (const OLECHAR *pch),
  467. (pch),
  468. NULL, OLEAUT32)
  469. #define SysAllocString VAR_SysAllocString
  470. LOADER_FUNCTION(BOOL, SysFreeString, // Actually a void
  471. (BSTR bs),
  472. (bs),
  473. FALSE, OLEAUT32)
  474. #define SysFreeString VAR_SysFreeString
  475. LOADER_FUNCTION(UINT, SysStringLen,
  476. (BSTR bs),
  477. (bs),
  478. 0, OLEAUT32)
  479. #define SysStringLen VAR_SysStringLen
  480. LOADER_FUNCTION(BOOL, VariantInit,
  481. (VARIANTARG * pvarg),
  482. (pvarg),
  483. FALSE, OLEAUT32)
  484. #define VariantInit VAR_VariantInit
  485. LOADER_FUNCTION(HRESULT, LoadTypeLib,
  486. (const OLECHAR *szFile, ITypeLib ** pptlib),
  487. (szFile, pptlib),
  488. E_FAIL, OLEAUT32)
  489. #define LoadTypeLib VAR_LoadTypeLib
  490. LOADER_FUNCTION(HRESULT, RegisterTypeLib,
  491. (ITypeLib * ptlib, OLECHAR *szFullPath, OLECHAR *szHelpDir),
  492. (ptlib, szFullPath, szHelpDir),
  493. E_FAIL, OLEAUT32)
  494. #define RegisterTypeLib VAR_RegisterTypeLib
  495. LOADER_FUNCTION(HRESULT, SafeArrayAccessData,
  496. (SAFEARRAY * psa, void HUGEP** ppvData),
  497. (psa, ppvData),
  498. E_FAIL, OLEAUT32)
  499. #define SafeArrayAccessData VAR_SafeArrayAccessData
  500. LOADER_FUNCTION(HRESULT, SafeArrayUnaccessData,
  501. (SAFEARRAY * psa),
  502. (psa),
  503. E_FAIL, OLEAUT32)
  504. #define SafeArrayUnaccessData VAR_SafeArrayUnaccessData
  505. LOADER_FUNCTION(UINT, SysStringByteLen,
  506. (BSTR bstr),
  507. (bstr),
  508. 0, OLEAUT32)
  509. #define SysStringByteLen VAR_SysStringByteLen
  510. LOADER_FUNCTION(HRESULT, SafeArrayDestroy,
  511. (SAFEARRAY *psa),
  512. (psa),
  513. E_FAIL, OLEAUT32)
  514. #define SafeArrayDestroy VAR_SafeArrayDestroy
  515. LOADER_FUNCTION(HRESULT, SafeArrayGetElement,
  516. (SAFEARRAY * psa, LONG * rgIndices, void * pv),
  517. (psa, rgIndices, pv),
  518. E_FAIL, OLEAUT32)
  519. #define SafeArrayGetElement VAR_SafeArrayGetElement
  520. LOADER_FUNCTION(HRESULT, SafeArrayGetUBound,
  521. (SAFEARRAY * psa, UINT nDim, LONG * plUbound),
  522. (psa, nDim, plUbound),
  523. E_FAIL, OLEAUT32)
  524. #define SafeArrayGetUBound VAR_SafeArrayGetUBound
  525. LOADER_FUNCTION(HRESULT, SafeArrayGetLBound,
  526. (SAFEARRAY * psa, UINT nDim, LONG * plLbound),
  527. (psa, nDim, plLbound),
  528. E_FAIL, OLEAUT32)
  529. #define SafeArrayGetLBound VAR_SafeArrayGetLBound
  530. LOADER_FUNCTION(HRESULT, VariantClear,
  531. (VARIANTARG * pvarg),
  532. (pvarg),
  533. E_FAIL, OLEAUT32)
  534. #define VariantClear VAR_VariantClear
  535. LOADER_FUNCTION(HRESULT, VariantCopy,
  536. (VARIANTARG * pvargDest, VARIANTARG * pvargSrc),
  537. (pvargDest, pvargSrc),
  538. E_FAIL, OLEAUT32)
  539. #define VariantCopy VAR_VariantCopy
  540. LOADER_FUNCTION(HRESULT, SetErrorInfo,
  541. (ULONG dwReserved, IErrorInfo * perrinfo),
  542. (dwReserved, perrinfo),
  543. E_FAIL, OLEAUT32)
  544. #define SetErrorInfo VAR_SetErrorInfo
  545. LOADER_FUNCTION(HRESULT, CreateErrorInfo,
  546. (ICreateErrorInfo ** pperrinfo),
  547. (pperrinfo),
  548. E_FAIL, OLEAUT32)
  549. #define CreateErrorInfo VAR_CreateErrorInfo
  550. #endif
  551. /////////////////////////////////////
  552. // COMDLG32.DLL
  553. #include <commdlg.h>
  554. BOOL DemandLoadCOMDLG32();
  555. LOADER_FUNCTION(BOOL, GetSaveFileNameA,
  556. (LPOPENFILENAME pof),
  557. (pof),
  558. FALSE, COMDLG32)
  559. #define GetSaveFileNameA VAR_GetSaveFileNameA
  560. LOADER_FUNCTION(BOOL, GetOpenFileNameA,
  561. (LPOPENFILENAME pof),
  562. (pof),
  563. FALSE, COMDLG32)
  564. #define GetOpenFileNameA VAR_GetOpenFileNameA
  565. LOADER_FUNCTION(BOOL, ChooseFontA,
  566. (LPCHOOSEFONT pcf),
  567. (pcf),
  568. FALSE, COMDLG32)
  569. #define ChooseFontA VAR_ChooseFontA
  570. /////////////////////////////////////
  571. // VERSION.DLL
  572. BOOL DemandLoadVERSION();
  573. LOADER_FUNCTION(BOOL, VerQueryValueA,
  574. (const LPVOID pBlock, LPSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen),
  575. (pBlock, lpSubBlock, lplpBuffer, puLen),
  576. FALSE, VERSION)
  577. #define VerQueryValueA VAR_VerQueryValueA
  578. LOADER_FUNCTION(BOOL, GetFileVersionInfoA,
  579. (PSTR lptstrFilename, DWORD dwHandle, DWORD dwLen, LPVOID lpData),
  580. (lptstrFilename, dwHandle, dwLen, lpData),
  581. FALSE, VERSION)
  582. #define GetFileVersionInfoA VAR_GetFileVersionInfoA
  583. LOADER_FUNCTION(DWORD, GetFileVersionInfoSizeA,
  584. (LPSTR lptstrFilename, LPDWORD lpdwHandle),
  585. (lptstrFilename, lpdwHandle),
  586. 0, VERSION)
  587. #define GetFileVersionInfoSizeA VAR_GetFileVersionInfoSizeA
  588. /////////////////////////////////////
  589. // URLMON.DLL
  590. BOOL DemandLoadURLMON();
  591. LOADER_FUNCTION(HRESULT, CreateURLMoniker,
  592. (LPMONIKER pMkCtx, LPCWSTR szURL, LPMONIKER FAR *ppmk),
  593. (pMkCtx, szURL, ppmk),
  594. E_FAIL, URLMON)
  595. #define CreateURLMoniker VAR_CreateURLMoniker
  596. LOADER_FUNCTION(HRESULT, URLOpenBlockingStreamA,
  597. (LPUNKNOWN pUnk,LPCSTR pURL,LPSTREAM* ppstm,DWORD i,LPBINDSTATUSCALLBACK p),
  598. (pUnk, pURL, ppstm, i, p),
  599. E_FAIL, URLMON)
  600. #define URLOpenBlockingStreamA VAR_URLOpenBlockingStreamA
  601. LOADER_FUNCTION(HRESULT, FindMimeFromData,
  602. (LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer, DWORD cbSize, LPCWSTR pwzMimeProposed, DWORD dwMimeFlags, LPWSTR *ppwzMimeOut, DWORD dwReserved),
  603. (pBC, pwzUrl, pBuffer, cbSize, pwzMimeProposed, dwMimeFlags, ppwzMimeOut, dwReserved),
  604. E_FAIL, URLMON)
  605. #define FindMimeFromData VAR_FindMimeFromData
  606. LOADER_FUNCTION( HRESULT, CoInternetCombineUrl,
  607. (LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pszResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved),
  608. (pwzBaseUrl, pwzRelativeUrl, dwCombineFlags, pszResult, cchResult, pcchResult, dwReserved),
  609. E_FAIL, URLMON)
  610. #define CoInternetCombineUrl VAR_CoInternetCombineUrl
  611. LOADER_FUNCTION( HRESULT, RegisterBindStatusCallback,
  612. (LPBC pBC, IBindStatusCallback *pBSCb, IBindStatusCallback** ppBSCBPrev, DWORD dwReserved),
  613. (pBC, pBSCb, ppBSCBPrev, dwReserved),
  614. E_FAIL, URLMON)
  615. #define RegisterBindStatusCallback VAR_RegisterBindStatusCallback
  616. LOADER_FUNCTION( HRESULT, RevokeBindStatusCallback,
  617. (LPBC pBC, IBindStatusCallback *pBSCb),
  618. (pBC, pBSCb),
  619. E_FAIL, URLMON)
  620. #define RevokeBindStatusCallback VAR_RevokeBindStatusCallback
  621. LOADER_FUNCTION( HRESULT, FaultInIEFeature,
  622. (HWND hwnd, uCLSSPEC *classpec, QUERYCONTEXT *pQuery, DWORD dwFlags),
  623. (hwnd, classpec, pQuery, dwFlags),
  624. E_FAIL, URLMON)
  625. #define FaultInIEFeature VAR_FaultInIEFeature
  626. LOADER_FUNCTION( HRESULT, CoInternetGetSecurityUrl,
  627. (LPCWSTR pwzUrl, LPWSTR *ppwzSecUrl, PSUACTION psuAction, DWORD dwReserved),
  628. (pwzUrl, ppwzSecUrl, psuAction, dwReserved),
  629. E_FAIL, URLMON)
  630. #define CoInternetGetSecurityUrl VAR_CoInternetGetSecurityUrl
  631. /////////////////////////////////////
  632. // MLANG.DLL
  633. #include <mlang.h>
  634. BOOL DemandLoadMLANG(void);
  635. LOADER_FUNCTION( HRESULT, IsConvertINetStringAvailable,
  636. (DWORD dwSrcEncoding, DWORD dwDstEncoding),
  637. (dwSrcEncoding, dwDstEncoding),
  638. S_FALSE, MLANG)
  639. #define IsConvertINetStringAvailable VAR_IsConvertINetStringAvailable
  640. LOADER_FUNCTION( HRESULT, ConvertINetString,
  641. (LPDWORD lpdwMode, DWORD dwSrcEncoding, DWORD dwDstEncoding, LPCSTR lpSrcStr, LPINT lpnSrcSize, LPSTR lpDstStr, LPINT lpnDstSize),
  642. (lpdwMode, dwSrcEncoding, dwDstEncoding, lpSrcStr, lpnSrcSize, lpDstStr, lpnDstSize),
  643. E_FAIL, MLANG)
  644. #define ConvertINetString VAR_ConvertINetString
  645. /////////////////////////////////////
  646. // SHDOCVW.DLL
  647. #include <shlobjp.h>
  648. BOOL DemandLoadSHDOCVW();
  649. LOADER_FUNCTION(HRESULT, AddUrlToFavorites,
  650. (HWND hwnd, LPWSTR pszUrlW, LPWSTR pszTitleW, BOOL fDisplayUI),
  651. (hwnd, pszUrlW, pszTitleW, fDisplayUI),
  652. E_FAIL, SHDOCVW)
  653. #define AddUrlToFavorites VAR_AddUrlToFavorites
  654. LOADER_FUNCTION(long, SetQueryNetSessionCount,
  655. (enum SessionOp Op),
  656. (Op),
  657. 0, SHDOCVW)
  658. #define SetQueryNetSessionCount VAR_SetQueryNetSessionCount
  659. /////////////////////////////////////
  660. // INETCPL.CPL
  661. BOOL DemandLoadINETCPL();
  662. LOADER_FUNCTION(int, OpenFontsDialog,
  663. (HWND hwnd, LPCSTR lpszKey),
  664. (hwnd, lpszKey),
  665. 0, INETCPL)
  666. #define OpenFontsDialog VAR_OpenFontsDialog
  667. LOADER_FUNCTION(BOOL, LaunchConnectionDialog,
  668. (HWND hwnd),
  669. (hwnd),
  670. FALSE, INETCPL)
  671. #define LaunchConnectionDialog VAR_LaunchConnectionDialog
  672. /////////////////////////////////////
  673. // MSO9.DLL
  674. #include "msoci.h"
  675. BOOL DemandLoadMSO9();
  676. LOADER_FUNCTION(BOOL, MsoFGetComponentManager,
  677. (IMsoComponentManager **ppicm),
  678. (ppicm),
  679. FALSE, MSO9)
  680. #define MsoFGetComponentManager VAR_MsoFGetComponentManager
  681. /////////////////////////////////////
  682. // WINMM.DLL
  683. BOOL DemandLoadWinMM();
  684. LOADER_FUNCTION(BOOL, sndPlaySoundA,
  685. (LPCSTR pszSound, UINT fuSound),
  686. (pszSound, fuSound),
  687. FALSE, WinMM)
  688. #define sndPlaySoundA VAR_sndPlaySoundA
  689. /////////////////////////////////////
  690. // WSOCK32.DLL
  691. #include <winsock.h>
  692. typedef struct WSAData FAR * LPWSADATA;
  693. typedef unsigned int u_int;
  694. typedef unsigned short u_short;
  695. typedef u_int SOCKET;
  696. BOOL DemandLoadWSOCK32();
  697. LOADER_FUNCTION( int, WSAStartup,
  698. (WORD wVersionRequired, LPWSADATA lpWSAData),
  699. (wVersionRequired, lpWSAData),
  700. WSAVERNOTSUPPORTED, WSOCK32)
  701. #define WSAStartup VAR_WSAStartup
  702. LOADER_FUNCTION( int, WSACleanup,
  703. (void),
  704. (),
  705. SOCKET_ERROR, WSOCK32)
  706. #define WSACleanup VAR_WSACleanup
  707. LOADER_FUNCTION( int, WSAGetLastError,
  708. (void),
  709. (),
  710. 0, WSOCK32)
  711. #define WSAGetLastError VAR_WSAGetLastError
  712. LOADER_FUNCTION( int, gethostname,
  713. (char FAR * name, int namelen),
  714. (name, namelen),
  715. SOCKET_ERROR, WSOCK32)
  716. #define gethostname VAR_gethostname
  717. LOADER_FUNCTION( struct hostent FAR *, gethostbyname,
  718. (const char FAR * name),
  719. (name),
  720. NULL, WSOCK32)
  721. #define gethostbyname VAR_gethostbyname
  722. LOADER_FUNCTION( HANDLE, WSAAsyncGetHostByName,
  723. (HWND hWnd, u_int wMsg, const char FAR * name, char FAR * buf, int buflen),
  724. (hWnd, wMsg, name, buf, buflen),
  725. 0, WSOCK32)
  726. #define WSAAsyncGetHostByName VAR_WSAAsyncGetHostByName
  727. LOADER_FUNCTION( unsigned long, inet_addr,
  728. (const char FAR * cp),
  729. (cp),
  730. INADDR_NONE, WSOCK32)
  731. #define inet_addr VAR_inet_addr
  732. LOADER_FUNCTION( u_short, htons,
  733. (u_short hostshort),
  734. (hostshort),
  735. 0, WSOCK32)
  736. #define htons VAR_htons
  737. LOADER_FUNCTION( int, WSACancelAsyncRequest,
  738. (HANDLE hAsyncTaskHandle),
  739. (hAsyncTaskHandle),
  740. SOCKET_ERROR, WSOCK32)
  741. #define WSACancelAsyncRequest VAR_WSACancelAsyncRequest
  742. LOADER_FUNCTION( int, send,
  743. (SOCKET s, const char FAR * buf, int len, int flags),
  744. (s, buf, len, flags),
  745. SOCKET_ERROR, WSOCK32)
  746. #define send VAR_send
  747. LOADER_FUNCTION( int, connect,
  748. (SOCKET s, const struct sockaddr FAR *name, int namelen),
  749. (s, name, namelen),
  750. SOCKET_ERROR, WSOCK32)
  751. #define connect VAR_connect
  752. LOADER_FUNCTION( int, WSAAsyncSelect,
  753. (SOCKET s, HWND hWnd, u_int wMsg, long lEvent),
  754. (s, hWnd, wMsg, lEvent),
  755. SOCKET_ERROR, WSOCK32)
  756. #define WSAAsyncSelect VAR_WSAAsyncSelect
  757. LOADER_FUNCTION( SOCKET, socket,
  758. (int af, int type, int protocol),
  759. (af, type, protocol),
  760. INVALID_SOCKET, WSOCK32)
  761. #define socket VAR_socket
  762. LOADER_FUNCTION( char FAR *, inet_ntoa,
  763. (struct in_addr in),
  764. (in),
  765. NULL, WSOCK32)
  766. #define inet_ntoa VAR_inet_ntoa
  767. LOADER_FUNCTION( int, closesocket,
  768. (SOCKET s),
  769. (s),
  770. SOCKET_ERROR, WSOCK32)
  771. #define closesocket VAR_closesocket
  772. LOADER_FUNCTION( int, recv,
  773. (SOCKET s, char FAR * buf, int len, int flags),
  774. (s, buf, len, flags),
  775. SOCKET_ERROR, WSOCK32)
  776. #define recv VAR_recv
  777. /////////////////////////////////////
  778. // PSTOREC.DLL
  779. #ifndef __IEnumPStoreProviders_FWD_DEFINED__
  780. #define __IEnumPStoreProviders_FWD_DEFINED__
  781. typedef interface IEnumPStoreProviders IEnumPStoreProviders;
  782. #endif /* __IEnumPStoreProviders_FWD_DEFINED__ */
  783. #ifndef __IPStore_FWD_DEFINED__
  784. #define __IPStore_FWD_DEFINED__
  785. typedef interface IPStore IPStore;
  786. #endif /* __IPStore_FWD_DEFINED__ */
  787. typedef GUID PST_PROVIDERID;
  788. BOOL DemandLoadPStoreC();
  789. LOADER_FUNCTION( HRESULT, PStoreCreateInstance,
  790. (IPStore __RPC_FAR *__RPC_FAR *ppProvider, PST_PROVIDERID __RPC_FAR *pProviderID, void __RPC_FAR *pReserved, DWORD dwFlags),
  791. (ppProvider, pProviderID, pReserved, dwFlags),
  792. E_FAIL, PStoreC)
  793. #define PStoreCreateInstance VAR_PStoreCreateInstance
  794. /////////////////////////////////////
  795. // RICHED32.DLL
  796. // note: special case as we don't use any riched functions but need to LoadLibrary it.
  797. BOOL DemandLoadRichEdit();
  798. /////////////////////////////////////
  799. // RAS.DLL
  800. #include <ras.h>
  801. #include <raserror.h>
  802. extern BOOL DemandLoadRAS(void);
  803. LOADER_FUNCTION( DWORD, RasEnumEntriesA,
  804. (LPSTR reserved, LPSTR lpszPhoneBook, LPRASENTRYNAMEA lpEntry, LPDWORD lpcb, LPDWORD lpcEntries),
  805. (reserved, lpszPhoneBook, lpEntry, lpcb, lpcEntries),
  806. ERROR_FILE_NOT_FOUND, RAS)
  807. #define RasEnumEntriesA VAR_RasEnumEntriesA
  808. LOADER_FUNCTION( DWORD, RasEditPhonebookEntryA,
  809. (HWND hwnd, LPSTR lpszPhoneBook, LPSTR lpszEntryName),
  810. (hwnd, lpszPhoneBook, lpszEntryName),
  811. ERROR_FILE_NOT_FOUND, RAS)
  812. #define RasEditPhonebookEntryA VAR_RasEditPhonebookEntryA
  813. LOADER_FUNCTION( DWORD, RasCreatePhonebookEntryA,
  814. (HWND hwnd, LPSTR lpszPhoneBook),
  815. (hwnd, lpszPhoneBook),
  816. ERROR_FILE_NOT_FOUND, RAS)
  817. #define RasCreatePhonebookEntryA VAR_RasCreatePhonebookEntryA
  818. /////////////////////////////////////
  819. // ADVAPI32.DLL
  820. #ifndef ALGIDDEF
  821. #define ALGIDDEF
  822. typedef unsigned int ALG_ID;
  823. #endif
  824. typedef unsigned long HCRYPTKEY;
  825. BOOL DemandLoadAdvApi32(void);
  826. LOADER_FUNCTION( BOOL, CryptAcquireContextW,
  827. (HCRYPTPROV *phProv, LPCWSTR pszContainer, LPCWSTR pszProvider, DWORD dwProvType, DWORD dwFlags),
  828. (phProv, pszContainer, pszProvider, dwProvType, dwFlags),
  829. FALSE, AdvApi32)
  830. #define CryptAcquireContextW VAR_CryptAcquireContextW
  831. #endif // 0