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.

96 lines
2.3 KiB

  1. #pragma once
  2. typedef struct _DLOAD_PROCNAME_ENTRY
  3. {
  4. LPCSTR pszProcName;
  5. FARPROC pfnProc;
  6. } DLOAD_PROCNAME_ENTRY;
  7. #define DLPENTRY(_fcn) { #_fcn, (FARPROC)_fcn },
  8. #define DEFINE_PROCNAME_ENTRIES(_dllbasename) \
  9. const DLOAD_PROCNAME_ENTRY c_PmapEntries_##_dllbasename [] =
  10. typedef struct _DLOAD_PROCNAME_MAP
  11. {
  12. UINT NumberOfEntries;
  13. const DLOAD_PROCNAME_ENTRY* pProcNameEntry;
  14. } DLOAD_PROCNAME_MAP;
  15. #define DECLARE_PROCNAME_MAP(_dllbasename) \
  16. extern const DLOAD_PROCNAME_MAP c_Pmap_##_dllbasename;
  17. #define DEFINE_PROCNAME_MAP(_dllbasename) \
  18. const DLOAD_PROCNAME_MAP c_Pmap_##_dllbasename = \
  19. { \
  20. countof(c_PmapEntries_##_dllbasename), \
  21. c_PmapEntries_##_dllbasename \
  22. };
  23. typedef struct _DLOAD_ORDINAL_ENTRY
  24. {
  25. DWORD dwOrdinal;
  26. FARPROC pfnProc;
  27. } DLOAD_ORDINAL_ENTRY;
  28. #define DLOENTRY(_ord, _fcn) { _ord, (FARPROC)_fcn },
  29. #define DEFINE_ORDINAL_ENTRIES(_dllbasename) \
  30. const DLOAD_ORDINAL_ENTRY c_OmapEntries_##_dllbasename [] =
  31. typedef struct _DLOAD_ORDINAL_MAP
  32. {
  33. UINT NumberOfEntries;
  34. const DLOAD_ORDINAL_ENTRY* pOrdinalEntry;
  35. } DLOAD_ORDINAL_MAP;
  36. #define DECLARE_ORDINAL_MAP(_dllbasename) \
  37. extern const DLOAD_ORDINAL_MAP c_Omap_##_dllbasename;
  38. #define DEFINE_ORDINAL_MAP(_dllbasename) \
  39. const DLOAD_ORDINAL_MAP c_Omap_##_dllbasename = \
  40. { \
  41. countof(c_OmapEntries_##_dllbasename), \
  42. c_OmapEntries_##_dllbasename \
  43. };
  44. typedef struct _DLOAD_DLL_ENTRY
  45. {
  46. LPCSTR pszDll;
  47. const DLOAD_PROCNAME_MAP* pProcNameMap;
  48. const DLOAD_ORDINAL_MAP* pOrdinalMap;
  49. } DLOAD_DLL_ENTRY;
  50. // 'B' for both
  51. // 'P' for procname only
  52. // 'O' for ordinal only
  53. //
  54. #define DLDENTRYB(_dllbasename) \
  55. { #_dllbasename".dll", \
  56. &c_Pmap_##_dllbasename, \
  57. &c_Omap_##_dllbasename },
  58. #define DLDENTRYP(_dllbasename) \
  59. { #_dllbasename".dll", \
  60. &c_Pmap_##_dllbasename, \
  61. NULL },
  62. #define DLDENTRYO(_dllbasename) \
  63. { #_dllbasename".dll", \
  64. NULL, \
  65. &c_Omap_##_dllbasename },
  66. typedef struct _DLOAD_DLL_MAP
  67. {
  68. UINT NumberOfEntries;
  69. const DLOAD_DLL_ENTRY* pDllEntry;
  70. } DLOAD_DLL_MAP;