Relates to Windows Update 24H2 Update Issue : compatibility bug in the new JScript legacy engine

Anonymous
2024-11-22T09:22:03.49+00:00

Hi Team,

We are using Jscript in our C++ / COM based software on windows platform and with the recent update of Windows 11 (24H2) we have seen one regression related to JScriptLegacy9.dll.

VT_I8 and VT_UI8 (64-bit signed and unsigned integers) were kept as it in JScript, handled as opaque "unknown" types that could be passed around between COM objects. In the new engine, those values are automatically coerced into Numbers (VT_R8), and lose their precision.

For example, an object could return a VT_I8, you could store it in a JScript variable, and pass it to another object's method, keeping the 64-bit integer precision. Now, they will be converted to VT_R8 (Number/Double/binary64) when received by JScript, and will therefore lose precision (as the mantissa is only 53 bits, not 64).

This makes it impossible to reliably pass around 64-bit integers when using JScript as a glue language between COM objects.

Could you please suggest how we can proceed to fix this issue? Please let me know if you need anything.

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-11-25T09:16:26.4766667+00:00

    Hello

    Thank you for posting in Q&A forum.

    1. If possible, consider using a different scripting engine that supports 64-bit integers without coercion. For example, switching to VBScript or another scripting language that maintains the precision of VT_I8 and VT_UI8 types.
    2. If you must use JScript, consider implementing a precision handling mechanism within your script. This could involve using libraries or custom code to manage large integers as strings or arrays of smaller integers.

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

    Best Regards,

    Daisy Zhou

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Was this answer helpful?


Your answer

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