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.

69 lines
1.8 KiB

  1. #include "OTScan.hpp"
  2. #ifndef _OIDTOFILE_HPP
  3. #define _OIDTOFILE_HPP
  4. class SIMCOidTreeNode;
  5. class OidToFile : public OidTreeScanner
  6. {
  7. typedef struct _FileNode
  8. {
  9. long lNextOffset;
  10. UINT uNumChildren;
  11. UINT uStrLen;
  12. LPSTR lpszTextSubID;
  13. UINT uNumSubID;
  14. } T_FILE_NODE;
  15. // mib.bin file actually needs the following platform independent format
  16. // on 32bit(x86) and 64bit(ia64) environment. The uReserved field is used
  17. // for backward compatibility to T_FILE_NODE on 32bit platform because
  18. // mib.bin file format has been around since NT 3.51 time frame.
  19. typedef struct _FileNodeEx
  20. {
  21. long lNextOffset; // This field must remain first
  22. UINT uNumChildren;
  23. UINT uStrLen;
  24. UINT uReserved;
  25. UINT uNumSubID;
  26. } T_FILE_NODE_EX;
  27. HFILE m_hMibFile;
  28. const char *m_pszMibFilename;
  29. public:
  30. OidToFile();
  31. // DESCRIPTION:
  32. // wrapper for the base class Scan();
  33. // it find first the sizes of subtrees;
  34. // RETURN VALUE:
  35. // 0 on success
  36. // -1 on failure;
  37. virtual int Scan();
  38. // DESCRIPTION:
  39. // Creates the output file, containing the OID encoding
  40. // PARAMETERS:
  41. // (in) pointer to the output file name
  42. // RETURN VALUE:
  43. // 0 on success, -1 on failure
  44. int SetMibFilename(const char * pszMibFilename);
  45. // DESCRIPTION:
  46. // "callback" function, called each time a
  47. // tree node passes through the scan. The user
  48. // should redefine this function in the derived
  49. // object to perform the action desired.
  50. // PARAMETERS:
  51. // (in) Pointer to the current node in the tree.
  52. // Nodes are supplied in lexicographic order.
  53. // RETURN VALUE:
  54. // 0 - the scanner should continue
  55. // -1 - the scanner should abort.
  56. int OnScanNode(const SIMCOidTreeNode *pOidNode);
  57. ~OidToFile();
  58. };
  59. #endif