Files
histsdk/docs/reverse-engineering/ildasm-historyquery-movenext-excerpt-latest.il
dohertj2 c95824a65d Initial commit: managed .NET 10 AVEVA Historian SDK + reverse-engineering toolkit
Full read-only SDK (src/AVEVA.Historian.Client) implementing the CLAUDE.md required
surface against AVEVA Historian's binary WCF protocol — no native AVEVA runtime
dependency. All operations live-verified against a local Historian:

- ProbeAsync, ReadRawAsync, ReadAggregateAsync, ReadAtTimeAsync, ReadEventsAsync
- BrowseTagNamesAsync, GetTagMetadataAsync (17 native data-type codes mapped)
- GetConnectionStatusAsync, GetStoreForwardStatusAsync, GetSystemParameterAsync
- 108/108 unit + integration tests pass

Includes the reverse-engineering toolkit (tools/AVEVA.Historian.ReverseEngineering)
used to decode the protocol: WCF probes, IL inspection via dnlib, and IL-rewrite
instrumentation (instrument-wcf-{write,read}message etc.) plus the .NET Framework
trace harness (tools/AVEVA.Historian.NativeTraceHarness) for parity testing.

Sanitized handoff evidence under docs/reverse-engineering/. Native AVEVA binaries
(current/, aveva-install-x64/, aveva-install-x86/) are gitignored — fetch separately
from the AVEVA installer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 06:31:48 -04:00

109 lines
8.3 KiB
Plaintext

.class /*02001EF9*/ public auto ansi beforefieldinit ArchestrA.HistoryQuery
extends ArchestrA.BaseQuery/*02001E55*/
implements [mscorlib/*23000001*/]System.IDisposable/*01000049*/
{
.method /*060062A2*/ public hidebysig instance bool
marshal( unsigned int8)
MoveNext([out] class ArchestrA.HistorianAccessError/*02001E2E*/& 'error') cil managed
// SIG: 20 01 02 10 12 C0 00 78 B8
{
// Method begins at RVA 0x4405d4
// Code size 142 (0x8e)
.maxstack 4
.locals /*110030A3*/ (bool V_0,
valuetype HistorianClient/*02001D42*/* V_1,
valuetype SError/*0200043D*/ V_2,
uint32 V_3)
IL_0000: /* 16 | */ ldc.i4.0
IL_0001: /* 0D | */ stloc.3
IL_0002: /* 02 | */ ldarg.0
IL_0003: /* 03 | */ ldarg.1
IL_0004: /* 28 | (06)0061B5 */ call instance valuetype HistorianClient/*02001D42*/* ArchestrA.BaseQuery/*02001E55*/::GetClient(class ArchestrA.HistorianAccessError/*02001E2E*/&) /* 060061B5 */
IL_0009: /* 0B | */ stloc.1
IL_000a: /* 07 | */ ldloc.1
IL_000b: /* 2D | 02 */ brtrue.s IL_000f
IL_000d: /* 16 | */ ldc.i4.0
IL_000e: /* 2A | */ ret
IL_000f: /* 02 | */ ldarg.0
IL_0010: /* 7B | (04)009EFB */ ldfld uint32 modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsLong/*0100000C*/) ArchestrA.BaseQuery/*02001E55*/::queryHandle /* 04009EFB */
IL_0015: /* 2D | 0C */ brtrue.s IL_0023
IL_0017: /* 03 | */ ldarg.1
IL_0018: /* 1A | */ ldc.i4.4
IL_0019: /* 1F | 3A */ ldc.i4.s 58
IL_001b: /* 73 | (06)005F77 */ newobj instance void ArchestrA.HistorianAccessError/*02001E2E*/::.ctor(valuetype ArchestrA.HistorianAccessError/*02001E2E*//ErrorTypeValue/*02001E30*/,
valuetype ArchestrA.HistorianAccessError/*02001E2E*//ErrorValue/*02001E2F*/) /* 06005F77 */
IL_0020: /* 51 | */ stind.ref
IL_0021: /* 16 | */ ldc.i4.0
IL_0022: /* 2A | */ ret
IL_0023: /* 02 | */ ldarg.0
IL_0024: /* 7B | (04)00A087 */ ldfld class ArchestrA.HistoryQueryResult/*02001EF8*/ ArchestrA.HistoryQuery/*02001EF9*/::queryResult /* 0400A087 */
IL_0029: /* 28 | (06)006262 */ call instance void ArchestrA.HistoryQueryResult/*02001EF8*/::CleanResult() /* 06006262 */
IL_002e: /* 12 | 02 */ ldloca.s V_2
IL_0030: /* 16 | */ ldc.i4.0
IL_0031: /* 6A | */ conv.i8
IL_0032: /* 55 | */ stind.i8
IL_0033: /* 12 | 02 */ ldloca.s V_2
IL_0035: /* 1E | */ ldc.i4.8
IL_0036: /* 58 | */ add
IL_0037: /* 16 | */ ldc.i4.0
IL_0038: /* 54 | */ stind.i4
IL_0039: /* 12 | 02 */ ldloca.s V_2
IL_003b: /* 1F | 0C */ ldc.i4.s 12
IL_003d: /* 58 | */ add
IL_003e: /* 16 | */ ldc.i4.0
IL_003f: /* 54 | */ stind.i4
.try
{
IL_0040: /* 07 | */ ldloc.1
IL_0041: /* 02 | */ ldarg.0
IL_0042: /* 7B | (04)009EFB */ ldfld uint32 modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsLong/*0100000C*/) ArchestrA.BaseQuery/*02001E55*/::queryHandle /* 04009EFB */
IL_0047: /* 02 | */ ldarg.0
IL_0048: /* 7B | (04)00A087 */ ldfld class ArchestrA.HistoryQueryResult/*02001EF8*/ ArchestrA.HistoryQuery/*02001EF9*/::queryResult /* 0400A087 */
IL_004d: /* 28 | (06)006263 */ call instance valuetype DataQueryResultRow/*020004E8*/* ArchestrA.HistoryQueryResult/*02001EF8*/::get_UnmanagedQueryResult() /* 06006263 */
IL_0052: /* 12 | 02 */ ldloca.s V_2
IL_0054: /* 28 | (06)00588D */ call bool modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.CallConvCdecl/*0100000B*/) 'HistorianClient.GetNextRow<class DataQueryResultRow>'(valuetype HistorianClient/*02001D42*/* modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsConst/*0100000D*/) modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsConst/*0100000D*/),
uint32 modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsLong/*0100000C*/),
valuetype DataQueryResultRow/*020004E8*/*,
valuetype SError/*0200043D*/* modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsImplicitlyDereferenced/*01000012*/)) /* 0600588D */
IL_0059: /* 2D | 0D */ brtrue.s IL_0068
IL_005b: /* 03 | */ ldarg.1
IL_005c: /* 12 | 02 */ ldloca.s V_2
IL_005e: /* 73 | (06)005F73 */ newobj instance void ArchestrA.HistorianAccessError/*02001E2E*/::.ctor(valuetype SError/*0200043D*/ modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsConst/*0100000D*/)* modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsImplicitlyDereferenced/*01000012*/)) /* 06005F73 */
IL_0063: /* 51 | */ stind.ref
IL_0064: /* 16 | */ ldc.i4.0
IL_0065: /* 0A | */ stloc.0
IL_0066: /* DE | 1D */ leave.s IL_0085
IL_0068: /* 02 | */ ldarg.0
IL_0069: /* 7B | (04)00A087 */ ldfld class ArchestrA.HistoryQueryResult/*02001EF8*/ ArchestrA.HistoryQuery/*02001EF9*/::queryResult /* 0400A087 */
IL_006e: /* 28 | (06)006260 */ call instance void ArchestrA.HistoryQueryResult/*02001EF8*/::InitializeBasicProperties() /* 06006260 */
IL_0073: /* 17 | */ ldc.i4.1
IL_0074: /* 0A | */ stloc.0
IL_0075: /* DE | 0E */ leave.s IL_0085
} // end .try
fault
{
IL_0077: /* FE06 | (06)000159 */ ldftn void modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.CallConvCdecl/*0100000B*/) 'SError.{dtor}'(valuetype SError/*0200043D*/* modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsConst/*0100000D*/) modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsConst/*0100000D*/)) /* 06000159 */
IL_007d: /* 12 | 02 */ ldloca.s V_2
IL_007f: /* 28 | (06)005C0F */ call void ___CxxCallUnwindDtor(method void *(void*),
void*) /* 06005C0F */
IL_0084: /* DC | */ endfinally
} // end handler
// HEX: 04 00 00 00 40 00 00 00 37 00 00 00 77 00 00 00 0E 00 00 00 73 00 00 01
IL_0085: /* 12 | 02 */ ldloca.s V_2
IL_0087: /* 28 | (06)000165 */ call void modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.CallConvCdecl/*0100000B*/) SError.ClearErrorDetail(valuetype SError/*0200043D*/* modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsConst/*0100000D*/) modopt([mscorlib/*23000001*/]System.Runtime.CompilerServices.IsConst/*0100000D*/)) /* 06000165 */
IL_008c: /* 06 | */ ldloc.0
IL_008d: /* 2A | */ ret
} // end of method HistoryQuery::MoveNext
} // end of class ArchestrA.HistoryQuery
// *********** DISASSEMBLY COMPLETE ***********************