nmfinder.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:5k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //=============================================================================
  2. //  Microsoft (R) Network Monitor (tm). 
  3. //  Copyright (C) 1996-1999. All rights reserved.
  4. //
  5. //  MODULE: NMFinder.h
  6. //
  7. //  External Header for the NPP finder
  8. //=============================================================================
  9. #ifndef NMFINDER_H
  10. #define NMFINDER_H
  11. #include <NPPTypes.h>
  12. #ifdef __cplusplus
  13. extern "C"
  14. {
  15. #endif
  16. // FINDER errors -- see also nmerr.h, blob.h
  17. #define NMERR_NO_NPPS                       3016
  18. #define NMERR_NO_MATCHING_NPPS              3017
  19. #define NMERR_NO_NPP_SELECTED               3018
  20. #define NMERR_NO_INPUT_BLOBS                3019
  21. #define NMERR_NO_NPP_DLLS                   3020
  22. #define NMERR_NO_VALID_NPP_DLLS             3021
  23. //****************************************************************************
  24. // Structures use by NPPs, the Finder, and monitors
  25. //****************************************************************************
  26. #pragma warning(disable:4200)
  27. typedef struct
  28. {
  29.     DWORD         dwNumBlobs;
  30.     HBLOB         hBlobs[0];
  31. } BLOB_TABLE;
  32. typedef BLOB_TABLE* PBLOB_TABLE;
  33. typedef struct 
  34. {
  35. DWORD size;
  36. BYTE* pBytes;
  37. } MBLOB;
  38. typedef struct
  39. {
  40.     DWORD         dwNumBlobs;
  41.     MBLOB         mBlobs[0];
  42. } MBLOB_TABLE;
  43. typedef MBLOB_TABLE* PMBLOB_TABLE;
  44. #pragma warning(default:4200)
  45. //****************************************************************************
  46. // Functions called by monitors, tools, netmon
  47. //****************************************************************************
  48. DWORD _cdecl GetNPPBlobTable(HBLOB          hFilterBlob,  
  49.                       PBLOB_TABLE*   ppBlobTable);
  50. DWORD _cdecl GetNPPBlobFromUI(HWND          hwnd,
  51.                        HBLOB         hFilterBlob,
  52.                        HBLOB*        phBlob);          
  53. DWORD _cdecl GetNPPBlobFromUIExU(HWND          hwnd,
  54.                           HBLOB         hFilterBlob,
  55.                           HBLOB*        phBlob,
  56.                           char*         szHelpFileName);          
  57. DWORD _cdecl SelectNPPBlobFromTable( HWND   hwnd,
  58.                               PBLOB_TABLE    pBlobTable,
  59.                               HBLOB*         hBlob);
  60. DWORD _cdecl SelectNPPBlobFromTableExU( HWND   hwnd,
  61.                                  PBLOB_TABLE    pBlobTable,
  62.                                  HBLOB*         hBlob,
  63.                                  char*          szHelpFileName);
  64. //****************************************************************************
  65. // Helper functions provided by the Finder
  66. //****************************************************************************
  67. __inline DWORD BLOB_TABLE_SIZE(DWORD dwNumBlobs)
  68. {
  69.     return (DWORD) (sizeof(BLOB_TABLE)+dwNumBlobs*sizeof(HBLOB));
  70. }
  71. __inline PBLOB_TABLE  AllocBlobTable(DWORD dwNumBlobs)
  72. {
  73.     DWORD size = BLOB_TABLE_SIZE(dwNumBlobs);
  74.     return (PBLOB_TABLE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
  75. }
  76. __inline DWORD MBLOB_TABLE_SIZE(DWORD dwNumBlobs)
  77. {
  78.     return (DWORD) (sizeof(MBLOB_TABLE)+dwNumBlobs*sizeof(MBLOB));
  79. }
  80. __inline PMBLOB_TABLE  AllocMBlobTable(DWORD dwNumBlobs)
  81. {
  82.     DWORD size = MBLOB_TABLE_SIZE(dwNumBlobs);
  83.     return (PMBLOB_TABLE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
  84. }
  85. //****************************************************************************
  86. // Functions provided by NPPs, called by the Finder
  87. //****************************************************************************
  88. // For NPP's that can return a Blob table without additional configuration.
  89. DWORD _cdecl GetNPPBlobs(PBLOB_TABLE*       ppBlobTable);
  90. typedef DWORD (_cdecl FAR* BLOBSPROC) (PBLOB_TABLE*       ppBlobTable);
  91. // For NPP's that need additional information to return a Blob table.
  92. DWORD _cdecl GetConfigBlob(HBLOB*      phBlob);
  93. typedef DWORD (_cdecl FAR* GETCFGBLOB) (HBLOB, HBLOB*);
  94. typedef DWORD (_cdecl FAR* CFGPROC) (HWND               hwnd,
  95.                               HBLOB              SpecialBlob,
  96.                               PBLOB_TABLE*       ppBlobTable);
  97. //****************************************************************************
  98. // Handy functions
  99. BOOL  _cdecl FilterNPPBlob(HBLOB hBlob, HBLOB FilterBlob);
  100. BOOL  _cdecl RaiseNMEvent(HINSTANCE    hInstance,
  101.                    WORD         EventType, 
  102.                    DWORD        EventID,
  103.                    WORD         nStrings, 
  104.                    const char** aInsertStrs,
  105.                    LPVOID       lpvData,
  106.                    DWORD        dwDataSize);
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110. #endif