From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Platform:Windows Runtime" |
|---|
| claim | "HSTRING memory layout as mirrored by windows-rs: an HSTRING is a pointer to this header (null = empty string); flags bit 0 marks a stack reference string." |
|---|
| scope | | level | "platform" |
|---|
| applies_to | "Platform:Windows Runtime" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "HStringHeader" |
|---|
| abi | "win64" |
|---|
| size | 32 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "flags" |
|---|
| notes | "bit 0 HSTRING_REFERENCE_FLAG" |
|---|
|
| offset | 4 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "len" |
|---|
| notes | "UTF-16 code units" |
|---|
|
| offset | 8 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "reserved0" |
|---|
|
| offset | 12 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "reserved1" |
|---|
|
| offset | 16 |
|---|
| size | 8 |
|---|
| type | "uint16_t *" |
|---|
| name | "data" |
|---|
| notes | "points to buffer_start for heap strings" |
|---|
|
| offset | 24 |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "count" |
|---|
| notes | "reference count" |
|---|
|
| offset | 28 |
|---|
| size | 2 |
|---|
| type | "uint16_t[]" |
|---|
| name | "buffer_start" |
|---|
| notes | "inline characters then a NUL" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "HStringHeader struct and HSTRING_REFERENCE_FLAG (a Rust re-implementation; the Windows-native layout is assumed equal)" |
|---|
| repo | "https://github.com/microsoft/windows-rs" |
|---|
| commit | "20f6de7473ebb2761a19a73dcc2c25ac9499db6e" |
|---|
| path | "crates/libs/strings/src/hstring_header.rs" |
|---|
| lines | "3-14" |
|---|
|
|
|---|
| confidence | "medium" |
|---|
| related | |
|---|
| key | "HSTRING header" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T19:24:27.734Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-18T20:32:20.348Z" |
|---|
| result | "partial" |
|---|
| method | "Read windows-rs crates/libs/strings/src/hstring_header.rs lines 3-14 at 20f6de74: HSTRING_REFERENCE_FLAG = 1; repr(C) fields flags u32, len u32, _0 u32, _1 u32, data *mut u16, count RefCount, buffer_start u16. Offsets 0/4/8/12/16/24/28 and 8-byte alignment (32 total with inline buffer start) follow from that on win64." |
|---|
| notes | "Only the Rust re-implementation was read; that the Windows-native HSTRING_HEADER is identical is not confirmed by this source." |
|---|
|
|
|---|