The Generic Formatter

The generic formatter should be used whenever possible. Using Network Monitor's formatting routines instead of writing your own will not only reduce the code size, but it will also allow for Network Monitor performance adjustments and fixups to porting problems for other platforms without impacting your parser.

Even if the generic formatter is not exactly what you need, you should still use the formatting routines that it calls if you must build your own string. For example, if you want to take the generic formatting routine's output for a WORD that looks like this:

Privilege ID   (PID) = 0x0029

and add something to the end of it to make it look like:

Privilege ID   (PID) = 0x0029   The Process has privileges

then you should call the format function that the Generic Formatter calls. In this case, you would call FormatPropertyDataAsWord and then append your string.

The following table shows how the generic formatter will format the different property types:

PROP_TYPE_VOID

Property qualifier Example output
PROP_QUAL_NONE "XYZ"
PROP_QUAL_RANGE
PROP_QUAL_BITFIELD
PROP_QUAL_LABELED_SET
PROP_QUAL_LABELED_BITFIELD
PROP_QUAL_CONST
PROP_QUAL_FLAGS
PROP_QUAL_ARRAY

PROP_TYPE_SUMMARY

Property qualifier Example output
PROP_QUAL_NONE "XYZ"
PROP_QUAL_RANGE
PROP_QUAL_BITFIELD
PROP_QUAL_LABELED_SET
PROP_QUAL_LABELED_BITFIELD
PROP_QUAL_CONST
PROP_QUAL_FLAGS
PROP_QUAL_ARRAY

PROP_TYPE_BYTE

Property qualifier Example output
PROP_QUAL_NONE "XYZ = 10 (0xa)"
PROP_QUAL_RANGE "XYZ = 10 (0xa) Range:(1 (0x1) - 20 (0x14))"
PROP_QUAL_BITFIELD
PROP_QUAL_LABELED_SET Calls FormatLabeledSet function.
PROP_QUAL_LABELED_BITFIELD Calls FormatLabeledSetAsFlags function.
PROP_QUAL_CONST No output results.
PROP_QUAL_FLAGS ...0 = Label Off String
..1. = Label On String
.0.. = Label Off String
0... = Label Off String
PROP_QUAL_ARRAY "XYZ = 00 0a ff ..."

PROP_TYPE_WORD

Property qualifier Example output
PROP_QUAL_NONE "XYZ = 10 (0xa)"
PROP_QUAL_RANGE "XYZ = 10 (0xa) Range:(1 (0x1) - 20 (0x14))
PROP_QUAL_BITFIELD No output results.
PROP_QUAL_LABELED_SET Calls FormatLabeledWordSet function.
PROP_QUAL_LABELED_BITFIELD Calls FormatLabeledWordSetAsFlags function.
PROP_QUAL_CONST No output results.
PROP_QUAL_FLAGS .......0 = Label Off String
......1. = Label On String
.....0.. = Label Off String
....0... = Label Off String
...1.... = Label On String
..0..... = Label Off String
.0...... = Label Off String
0....... = Label Off String
PROP_QUAL_ARRAY "XYZ = 0000 000a ffff ..."

PROP_TYPE_DWORD

Property qualifier Example output
PROP_QUAL_NONE "XYZ = 10 (0xa)"
PROP_QUAL_RANGE "XYZ = 10 (0xa) Range:(1 (0x1) - 20 (0x14))
PROP_QUAL_BITFIELD
PROP_QUAL_LABELED_SET Calls FormatLabeledDwordSet function.
PROP_QUAL_LABELED_BITFIELD Calls FormatLabeledDwordSetAsFlags function.
PROP_QUAL_CONST No output results.
PROP_QUAL_FLAGS ...............0 = Label Off String
..............1. = Label On String
.............0.. = Label Off String
............0... = Label Off String
...........1.... = Label On String
..........0..... = Label Off String
.........0...... = Label Off String
........0....... = Label Off String
(and so on)
PROP_QUAL_ARRAY "XYZ = 00000000 0000000a ffffffff ..."

PROP_TYPE_LARGEINT

Property qualifier Example output
PROP_QUAL_NONE

PROP_QUAL_RANGE

PROP_QUAL_BITFIELD

PROP_QUAL_LABELED_SET

PROP_QUAL_LABELED_BITFIELD

PROP_QUAL_CONST

PROP_QUAL_FLAGS

PROP_QUAL_ARRAY

No output results.

PROP_TYPE_ADDR

Property qualifier Example output
PROP_QUAL_NONE

PROP_QUAL_RANGE

PROP_QUAL_BITFIELD

PROP_QUAL_LABELED_SET

PROP_QUAL_LABELED_BITFIELD

PROP_QUAL_CONST

PROP_QUAL_FLAGS

PROP_QUAL_ARRAY

No output results.

PROP_TYPE_TIME

Property qualifier Example output
PROP_QUAL_NONE

PROP_QUAL_RANGE

PROP_QUAL_BITFIELD

PROP_QUAL_LABELED_SET

PROP_QUAL_LABELED_BITFIELD

PROP_QUAL_CONST

PROP_QUAL_FLAGS

PROP_QUAL_ARRAY

Calls FormatPropertyDataAsTime function.

PROP_TYPE_STRING

Property qualifier Example output
PROP_QUAL_NONE

PROP_QUAL_RANGE

PROP_QUAL_BITFIELD

PROP_QUAL_LABELED_SET

PROP_QUAL_LABELED_BITFIELD

PROP_QUAL_CONST

PROP_QUAL_FLAGS

PROP_QUAL_ARRAY

"XYZ = String, which was attached as an AttachPropertyInstEx."

PROP_TYPE_IP_ADDRESS

Property qualifier Example output
PROP_QUAL_NONE

PROP_QUAL_RANGE

PROP_QUAL_BITFIELD

PROP_QUAL_LABELED_SET

PROP_QUAL_LABELED_BITFIELD

PROP_QUAL_CONST

PROP_QUAL_FLAGS

PROP_QUAL_ARRAY

"XYZ = 129.65.100.2"

PROP_TYPE_BYTESWAPPED_WORD

Property qualifier Example output
PROP_QUAL_NONE "XYZ = 10 (0xa)"
PROP_QUAL_RANGE "XYZ = 10 (0xa) Range:(1 (0x1) - 20 (0x14))
PROP_QUAL_BITFIELD No output results.
PROP_QUAL_LABELED_SET Calls FormatLabeledWordSet function.
PROP_QUAL_LABELED_BITFIELD Calls FormatLabeledWordSetAsFlags function.
PROP_QUAL_CONST No output results.
PROP_QUAL_FLAGS .......0 = Label Off String
......1. = Label On String
.....0.. = Label Off String
....0... = Label Off String
...1.... = Label On String
..0..... = Label Off String
.0...... = Label Off String
0....... = Label Off String
PROP_QUAL_ARRAY "XYZ = 0000 000a ffff ..."

PROP_TYPE_BYTESWAPPED_DWORD

Property qualifier Example output
PROP_QUAL_NONE "XYZ = 10 (0xa)"
PROP_QUAL_RANGE "XYZ = 10 (0xa) Range:(1 (0x1) - 20 (0x14))
PROP_QUAL_BITFIELD No output results.
PROP_QUAL_LABELED_SET Calls FormatLabeledDwordSet function.
PROP_QUAL_LABELED_BITFIELD Calls FormatLabeledDwordSetAsFlags function.
PROP_QUAL_CONST No output results.
PROP_QUAL_FLAGS ...............0 = Label Off String
..............1. = Label On String
.............0.. = Label Off String
............0... = Label Off String
...........1.... = Label On String
..........0..... = Label Off String
.........0...... = Label Off String
........0....... = Label Off String
(and so on)
PROP_QUAL_ARRAY "XYZ = 00000000 0000000a ffffffff ..."

PROP_TYPE_OBJECT_IDENTIFIER

Property qualifier Example output
PROP_QUAL_NONE "OID = 1.3.6.1.2.1.1.3.0"

PROP_TYPE_VINES_IP_ADDRESS

Property qualifier Example output
PROP_QUAL_NONE "Address = 172345:52"

PROP_TYPE_VAR_LEN_SMALL_INT

Property qualifier Example output
PROP_QUAL_NONE "Version = 2"