Windbg Javascript Debugger: cast js byte array to a type?

nop90 1 Reputation point
2022-05-27T20:03:37.553+00:00

Hello,

I have the following type:

struct A_TYPE {
UINT64 a;
UINT32 b;
UINT32 c[16];
}

and a code that looks like this:

var buf = new ArrayBuffer(128);
var numbers = new Uint8Array(buf);
//code that sets the numbers array

I have tried without success casting the numbers byte array to A_TYPE using the following:

//attempt 1:
var instantiatedType = host.typeSystem.marshalAs(numbers, srcName, typeName);

//attempt 2:
var type = host.getModuleType(srcName, typeName);
var instantiatedType = type.initialize(numbers) //initialize/constructor was a function i hoped to exist

Any ideas whether this functionality is already implemented? Sounds like a basic feature but i couldn't find it

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.