Summary
winspool declares ErrorSplNoStartdoc at 0x00000E15, a value [MS-ERREF] 2.2 does not define at all, and renders it as ERROR_SPL_NO_STARTDOC. The specification assigns that name to 0x00000BBB (3003), which the interface's subset omits and therefore reports as undecoded hex.
Location
- File(s):
network/dcerpc/interfaces/12345678-1234-abcd-ef00-0123456789ab/1.0/interface.go
- Line(s) / function(s):
ErrorSplNoStartdoc at L143; StatusString() renders it at L200
Category
functional
Severity
low
A value the specification never assigns is reported under a real error's name, and the code that name belongs to is reported as hex. No comparison uses the constant, so control flow is unaffected.
Reproduction / Evidence
Verified by code analysis against [MS-ERREF] 2.2, using the committed extract at windows/errors/errgen/ms-erref-2.2-win32.tsv:
interface.go:143 reads ErrorSplNoStartdoc uint32 = 0x00000E15 // ERROR_SPL_NO_STARTDOC (3605), and StatusString returns "ERROR_SPL_NO_STARTDOC" for it at L200.
- The table defines
ERROR_SPL_NO_STARTDOC at 0x00000BBB (3003), immediately before ERROR_SPL_NO_ADDJOB at 0x00000BBC. Those are the only two SPL names in the Win32 table.
0x00000E15 (3605) has no row in the table. The highest Win32 code the specification defines below it is 0x00000BCE, and the range 0x00000E00–0x00000E40 is empty, so the value is not a Win32 system error code at all.
- Both the value and its parenthetical comment say 3605, so the declaration is self-consistent and nothing in the file contradicts it. The constant is referenced only by
StatusString; all 88 method stubs compare against success alone.
Expected Behavior
0x00000BBB reports ERROR_SPL_NO_STARTDOC, and 0x00000E15 — which the specification does not define — reports its hexadecimal value.
Actual Behavior
0x00000E15 reports ERROR_SPL_NO_STARTDOC, and 0x00000BBB falls through to the hex default.
Root Cause
The subset was transcribed name-first, and this entry was paired with a value the specification does not assign. Nothing checked the pairing, because the constant and the string it renders to were written in the same edit and agree with each other.
Notes
Found while migrating winspool onto windows/errors/win32 for #1219, by deriving each constant's replacement from its value rather than its name. The same rule found the same class of defect in winreg (#1231).
This is the second instance, which makes it a pattern rather than an isolated slip: a hand-written per-interface subset can pair a correct name with an incorrect value and nothing in the interface will disagree. A generated table cannot express the error.
Summary
winspool declares
ErrorSplNoStartdocat0x00000E15, a value [MS-ERREF] 2.2 does not define at all, and renders it asERROR_SPL_NO_STARTDOC. The specification assigns that name to0x00000BBB(3003), which the interface's subset omits and therefore reports as undecoded hex.Location
network/dcerpc/interfaces/12345678-1234-abcd-ef00-0123456789ab/1.0/interface.goErrorSplNoStartdocat L143;StatusString()renders it at L200Category
functionalSeverity
lowA value the specification never assigns is reported under a real error's name, and the code that name belongs to is reported as hex. No comparison uses the constant, so control flow is unaffected.
Reproduction / Evidence
Verified by code analysis against [MS-ERREF] 2.2, using the committed extract at
windows/errors/errgen/ms-erref-2.2-win32.tsv:interface.go:143readsErrorSplNoStartdoc uint32 = 0x00000E15 // ERROR_SPL_NO_STARTDOC (3605), andStatusStringreturns"ERROR_SPL_NO_STARTDOC"for it at L200.ERROR_SPL_NO_STARTDOCat0x00000BBB(3003), immediately beforeERROR_SPL_NO_ADDJOBat0x00000BBC. Those are the only twoSPLnames in the Win32 table.0x00000E15(3605) has no row in the table. The highest Win32 code the specification defines below it is0x00000BCE, and the range0x00000E00–0x00000E40is empty, so the value is not a Win32 system error code at all.StatusString; all 88 method stubs compare against success alone.Expected Behavior
0x00000BBBreportsERROR_SPL_NO_STARTDOC, and0x00000E15— which the specification does not define — reports its hexadecimal value.Actual Behavior
0x00000E15reportsERROR_SPL_NO_STARTDOC, and0x00000BBBfalls through to the hex default.Root Cause
The subset was transcribed name-first, and this entry was paired with a value the specification does not assign. Nothing checked the pairing, because the constant and the string it renders to were written in the same edit and agree with each other.
Notes
Found while migrating winspool onto
windows/errors/win32for #1219, by deriving each constant's replacement from its value rather than its name. The same rule found the same class of defect in winreg (#1231).This is the second instance, which makes it a pattern rather than an isolated slip: a hand-written per-interface subset can pair a correct name with an incorrect value and nothing in the interface will disagree. A generated table cannot express the error.