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.

126 lines
3.4 KiB

  1. /*-----------------------------------------------------------------------------+
  2. | DYNALINK.H |
  3. | |
  4. | (C) Copyright Microsoft Corporation 1994. All rights reserved. |
  5. | |
  6. | This file contains static PROC_INFO structures listing APIs called in each |
  7. | dynamically linked DLL. |
  8. | |
  9. | |
  10. | Revision History |
  11. | July 1994 Andrew Bell created |
  12. | |
  13. +-----------------------------------------------------------------------------*/
  14. #include <windows.h>
  15. #include "mplayer.h"
  16. TCHAR szComDlg32[] = TEXT("ComDlg32");
  17. TCHAR szMPR[] = TEXT("MPR");
  18. TCHAR szOLE32[] = TEXT("OLE32");
  19. HMODULE hComDlg32;
  20. HMODULE hMPR;
  21. HMODULE hOLE32;
  22. PROC_INFO ComDlg32Procs[] =
  23. {
  24. #ifdef UNICODE
  25. "GetOpenFileNameW", 0,
  26. #else
  27. "GetOpenFileNameA", 0,
  28. #endif
  29. NULL, 0
  30. };
  31. PROC_INFO MPRProcs[] =
  32. {
  33. #ifdef UNICODE
  34. "WNetGetUniversalNameW", 0,
  35. "WNetGetConnectionW", 0,
  36. "WNetGetLastErrorW", 0,
  37. #else
  38. "WNetGetUniversalNameA", 0,
  39. "WNetGetConnectionA", 0,
  40. "WNetGetLastErrorA", 0,
  41. #endif
  42. NULL, 0
  43. };
  44. PROC_INFO OLE32Procs[] =
  45. {
  46. "CLSIDFromProgID", 0,
  47. "CoCreateInstance", 0,
  48. "CoDisconnectObject", 0,
  49. "CoGetMalloc", 0,
  50. "CoRegisterClassObject", 0,
  51. "CoRevokeClassObject", 0,
  52. "CreateDataAdviseHolder", 0,
  53. "CreateFileMoniker", 0,
  54. "CreateOleAdviseHolder", 0,
  55. "DoDragDrop", 0,
  56. "IsAccelerator", 0,
  57. "OleCreateMenuDescriptor", 0,
  58. "OleDestroyMenuDescriptor", 0,
  59. "OleDuplicateData", 0,
  60. "OleFlushClipboard", 0,
  61. "OleGetClipboard", 0,
  62. "OleInitialize", 0,
  63. "OleIsCurrentClipboard", 0,
  64. "OleSetClipboard", 0,
  65. "OleTranslateAccelerator", 0,
  66. "OleUninitialize", 0,
  67. "StgCreateDocfile", 0,
  68. "WriteClassStg", 0,
  69. "WriteFmtUserTypeStg", 0,
  70. #ifndef IsEqualGUID
  71. /* This is now a macro on Daytona!
  72. */
  73. "IsEqualGUID", 0,
  74. #endif
  75. NULL, 0
  76. };
  77. BOOL LoadLibraryAndProcs(LPTSTR pLibrary, PPROC_INFO pProcInfo, HMODULE *phLibrary)
  78. {
  79. HMODULE hLibrary;
  80. PPROC_INFO p;
  81. #ifdef DEBUG
  82. if (PROCS_LOADED(pProcInfo))
  83. {
  84. DPF0("Attempt to load %s when already loaded\n", pLibrary);
  85. return TRUE;
  86. }
  87. #endif
  88. hLibrary = LoadLibrary(pLibrary);
  89. if (hLibrary == NULL)
  90. {
  91. Error1(ghwndApp, IDS_CANTLOADLIB, pLibrary);
  92. ExitProcess(0);
  93. }
  94. p = pProcInfo;
  95. while (p->Name)
  96. {
  97. p->Address = GetProcAddress(hLibrary, p->Name);
  98. if (p->Address == NULL)
  99. {
  100. Error2(ghwndApp, IDS_CANTFINDPROC, p->Name, pLibrary);
  101. ExitProcess(0);
  102. }
  103. p++;
  104. }
  105. *phLibrary = hLibrary;
  106. return TRUE;
  107. }
  108.