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

/*
** d e m a n d . h
**
** Purpose: create an intelligent method of defer loading functions
**
** Copyright (C) Microsoft Corp. 1997
*/
#define USE_CRITSEC
#ifdef IMPLEMENT_LOADER_FUNCTIONS
#define LOADER_FUNCTION(ret, name, args1, args2, err, dll) \
typedef ret (WINAPI * TYP_##name) args1; \
extern TYP_##name VAR_##name; \
ret WINAPI LOADER_##name args1 \
{ \
DemandLoad##dll(); \
if (VAR_##name == LOADER_##name) return err; \
return VAR_##name args2; \
} \
TYP_##name VAR_##name = LOADER_##name;
#else // !IMPLEMENT_LOADER_FUNCTIONS
#define LOADER_FUNCTION(ret, name, args1, args2, err, dll) \
typedef ret (WINAPI * TYP_##name) args1; \
extern TYP_##name VAR_##name;
#endif // IMPLEMENT_LOADER_FUNCTIONS
extern HMODULE s_hINetComm;
void InitDemandLoadedLibs();
void FreeDemandLoadedLibs();
/////////////////////////////////////
// INETCOMM.DLL
BOOL DemandLoadINETCOMM(void);
interface IHTMLDocument2;
interface IMimeMessage;
LOADER_FUNCTION( HRESULT, MimeEditViewSource,
(HWND hwnd, IMimeMessage *pMsg),
(hwnd, pMsg),
E_FAIL, INETCOMM)
#define MimeEditViewSource VAR_MimeEditViewSource
LOADER_FUNCTION( HRESULT, MimeEditCreateMimeDocument,
(IHTMLDocument2 *pDoc, IMimeMessage *pMsgSrc, DWORD dwFlags, IMimeMessage **ppMsg),
(pDoc, pMsgSrc, dwFlags, ppMsg),
E_FAIL, INETCOMM)
#define MimeEditCreateMimeDocument VAR_MimeEditCreateMimeDocument