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.

53 lines
1.7 KiB

  1. /*
  2. ** d e m a n d . h
  3. **
  4. ** Purpose: create an intelligent method of defer loading functions
  5. **
  6. ** Copyright (C) Microsoft Corp. 1997
  7. */
  8. #define USE_CRITSEC
  9. #ifdef IMPLEMENT_LOADER_FUNCTIONS
  10. #define LOADER_FUNCTION(ret, name, args1, args2, err, dll) \
  11. typedef ret (WINAPI * TYP_##name) args1; \
  12. extern TYP_##name VAR_##name; \
  13. ret WINAPI LOADER_##name args1 \
  14. { \
  15. DemandLoad##dll(); \
  16. if (VAR_##name == LOADER_##name) return err; \
  17. return VAR_##name args2; \
  18. } \
  19. TYP_##name VAR_##name = LOADER_##name;
  20. #else // !IMPLEMENT_LOADER_FUNCTIONS
  21. #define LOADER_FUNCTION(ret, name, args1, args2, err, dll) \
  22. typedef ret (WINAPI * TYP_##name) args1; \
  23. extern TYP_##name VAR_##name;
  24. #endif // IMPLEMENT_LOADER_FUNCTIONS
  25. extern HMODULE s_hINetComm;
  26. void InitDemandLoadedLibs();
  27. void FreeDemandLoadedLibs();
  28. /////////////////////////////////////
  29. // INETCOMM.DLL
  30. BOOL DemandLoadINETCOMM(void);
  31. interface IHTMLDocument2;
  32. interface IMimeMessage;
  33. LOADER_FUNCTION( HRESULT, MimeEditViewSource,
  34. (HWND hwnd, IMimeMessage *pMsg),
  35. (hwnd, pMsg),
  36. E_FAIL, INETCOMM)
  37. #define MimeEditViewSource VAR_MimeEditViewSource
  38. LOADER_FUNCTION( HRESULT, MimeEditCreateMimeDocument,
  39. (IHTMLDocument2 *pDoc, IMimeMessage *pMsgSrc, DWORD dwFlags, IMimeMessage **ppMsg),
  40. (pDoc, pMsgSrc, dwFlags, ppMsg),
  41. E_FAIL, INETCOMM)
  42. #define MimeEditCreateMimeDocument VAR_MimeEditCreateMimeDocument