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:
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 |
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 |
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 |
PROP_QUAL_ARRAY | "XYZ = 00 0a ff ..." |
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 |
PROP_QUAL_ARRAY | "XYZ = 0000 000a ffff ..." |
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 |
PROP_QUAL_ARRAY | "XYZ = 00000000 0000000a ffffffff ..." |
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. |
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. |
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. |
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." |
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" |
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 |
PROP_QUAL_ARRAY | "XYZ = 0000 000a ffff ..." |
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 |
PROP_QUAL_ARRAY | "XYZ = 00000000 0000000a ffffffff ..." |
Property qualifier | Example output |
---|---|
PROP_QUAL_NONE | "OID = 1.3.6.1.2.1.1.3.0" |
Property qualifier | Example output |
---|---|
PROP_QUAL_NONE | "Address = 172345:52" |
Property qualifier | Example output |
---|---|
PROP_QUAL_NONE | "Version = 2" |