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.

94 lines
4.5 KiB

  1. /*-----------------------------------------------------------------------------+
  2. | DYNALINK.H |
  3. | |
  4. | (C) Copyright Microsoft Corporation 1994. All rights reserved. |
  5. | |
  6. | This file contains definitions and macros which allow the transparent |
  7. | loading and calling of APIs which are dynamically rather than statically |
  8. | linked. |
  9. | |
  10. | |
  11. | Revision History |
  12. | July 1994 Andrew Bell created |
  13. | |
  14. +-----------------------------------------------------------------------------*/
  15. typedef struct _PROC_INFO
  16. {
  17. LPCSTR Name;
  18. FARPROC Address;
  19. }
  20. PROC_INFO, *PPROC_INFO;
  21. BOOL LoadLibraryAndProcs(LPTSTR pLibrary, PPROC_INFO pProcInfo, HMODULE *phLibrary);
  22. #define PROCS_LOADED( pProcInfo ) ( (pProcInfo)[0].Address != NULL )
  23. #define LOAD_IF_NEEDED( Library, ProcInfo, phLibrary ) ( PROCS_LOADED( ProcInfo ) || \
  24. LoadLibraryAndProcs( Library, ProcInfo, phLibrary ) )
  25. extern TCHAR szComDlg32[];
  26. extern TCHAR szMPR[];
  27. extern TCHAR szOLE32[];
  28. extern HMODULE hComDlg32;
  29. extern HMODULE hMPR;
  30. extern HMODULE hOLE32;
  31. extern PROC_INFO ComDlg32Procs[];
  32. extern PROC_INFO MPRProcs[];
  33. extern PROC_INFO OLE32Procs[];
  34. #ifdef UNICODE
  35. #define GetOpenFileNameW (LOAD_IF_NEEDED(szComDlg32, ComDlg32Procs, &hComDlg32),\
  36. (*ComDlg32Procs[0].Address))
  37. #else
  38. #define GetOpenFileNameA (LOAD_IF_NEEDED(szComDlg32, ComDlg32Procs, &hComDlg32),\
  39. (*ComDlg32Procs[0].Address))
  40. #endif
  41. #ifdef UNICODE
  42. /* This assumes that WNetGetUniversalName will always be the first to be called.
  43. */
  44. #define WNetGetUniversalNameW (LOAD_IF_NEEDED(szMPR, MPRProcs, &hMPR), \
  45. (*MPRProcs[0].Address))
  46. #define WNetGetConnectionW (*MPRProcs[1].Address)
  47. #define WNetGetLastErrorW (*MPRProcs[2].Address)
  48. #else
  49. #define WNetGetUniversalNameA (LOAD_IF_NEEDED(szMPR, MPRProcs, &hMPR), \
  50. (*MPRProcs[0].Address))
  51. #define WNetGetConnectionA (*MPRProcs[1].Address)
  52. #define WNetGetLastErrorA (*MPRProcs[2].Address)
  53. #endif
  54. /* OleInitialize must always be called before before any of the
  55. * other APIs.
  56. */
  57. #define CLSIDFromProgID (*OLE32Procs[0].Address)
  58. #define CoCreateInstance (*OLE32Procs[1].Address)
  59. #define CoDisconnectObject (*OLE32Procs[2].Address)
  60. #define CoGetMalloc (*OLE32Procs[3].Address)
  61. #define CoRegisterClassObject (*OLE32Procs[4].Address)
  62. #define CoRevokeClassObject (*OLE32Procs[5].Address)
  63. #define CreateDataAdviseHolder (*OLE32Procs[6].Address)
  64. #define CreateFileMoniker (*OLE32Procs[7].Address)
  65. #define CreateOleAdviseHolder (*OLE32Procs[8].Address)
  66. #define DoDragDrop (*OLE32Procs[9].Address)
  67. #define IsAccelerator (*OLE32Procs[10].Address)
  68. #define OleCreateMenuDescriptor (HOLEMENU)(*OLE32Procs[11].Address)
  69. #define OleDestroyMenuDescriptor (*OLE32Procs[12].Address)
  70. #define OleDuplicateData (HANDLE)(*OLE32Procs[13].Address)
  71. #define OleFlushClipboard (*OLE32Procs[14].Address)
  72. #define OleGetClipboard (*OLE32Procs[15].Address)
  73. #define OleInitialize (LOAD_IF_NEEDED(szOLE32, OLE32Procs, &hOLE32), \
  74. (*OLE32Procs[16].Address))
  75. #define OleIsCurrentClipboard (*OLE32Procs[17].Address)
  76. #define OleSetClipboard (*OLE32Procs[18].Address)
  77. #define OleTranslateAccelerator (*OLE32Procs[19].Address)
  78. #define OleUninitialize (*OLE32Procs[20].Address)
  79. #define StgCreateDocfile (*OLE32Procs[21].Address)
  80. #define WriteClassStg (*OLE32Procs[22].Address)
  81. #define WriteFmtUserTypeStg (*OLE32Procs[23].Address)
  82. #ifndef IsEqualGUID
  83. #define IsEqualGUID (*OLE32Procs[24].Address)
  84. #endif
  85.