comportamiento indefinido con StructLayout y FieldOffset

Extraje con éxito un objeto de estructura de un puntero válido utilizando la función PtrToStructure (en VB.NET), pero el resultado de algunos miembros de objeto no es correcto (en comparación con el ejemplo de C ++):

el código es:

StructLayout(LayoutKind.Explicit, pack:=1, CharSet:=CharSet.Ansi)> _
    Public Structure MyStruct

        <FieldOffset(0)> _
        Dim Width As UInt32 ' 350 correct
        <FieldOffset(4)> _
        Dim Height As UInt32 ' 466 correct
        <FieldOffset(20)> _
        Dim Buffer As IntPtr ' variable but correct
        <FieldOffset(24)> _
        Dim BufferPitch As Integer ' 1408 correct
        <FieldOffset(16)> _
        Dim SurfaceType As Integer ' -2147483645 correct
        <FieldOffset(unknow)> _
        Dim WindowWidth As UInt32 ' must be 356, tested from 0 to 230
        <FieldOffset(unknow)> _
        Dim WindowHeight As UInt32 ' must be 495, tested from 0 to 100
        <FieldOffset(15)> _
        Dim ScreenHeight As UInt32 ' 768 correct
        <FieldOffset(36)> _
        Dim ScreenWidth As UInt32 ' 1366 correct
        <FieldOffset(44)> _
        Dim ScreenDepth As UInt32 ' 32 correct
End Structure

No puedo encontrar los valores exactos para el parámetro FieldOffset de WindowWidth y WindowHeight. la pregunta es por qué y cómo solucionarlos

struct myStruct 
{ 
    U32 Width; // U32 = 32-bit unsigned integer 
    U32 Height; 
    VOID_PTR Buffer;
    S32 BufferPitch; // 32-bit signed integer 
    COPY_FLAGS SurfaceType; // integer 
    U32 WindowWidth; 
    U32 WindowHeight; 
    U32 ScreenWidth; 
    U32 ScreenHeight; 
    U32 ScreenDepth; 
}

Respuestas a la pregunta(1)

Su respuesta a la pregunta