<p>Unfortunately, this ain't gonna work, because dwSize is the size of the buffer in bytes, not the size in character (WCHAR)</p>
<p>This is because RegQueryValueEx is very low level and can read several types, thus handle the buffer as un-interpreted bytes.<br>
Therefore, dwSize must be multiplied by sizeof(WCHAR) before the call, and divided by sizeof(WCHAR) after the call if we use the RegExQueryValueW variant, so as to express the size in characters like we intend to.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/2a6304d3586af4d7ada93d74be9ab4bcccbacdec#commitcomment-31827279">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW8ofjWOX5R_Oq3PDd7uKOtGr2SGxks5u_bvzgaJpZM4ZnWxM">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyW9DVhEemXKBuscH_Z8a_JLgD2Na6ks5u_bvzgaJpZM4ZnWxM.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@nicolas-cellier-aka-nice on 2a6304d: Unfortunately, this ain't gonna work, because dwSize is the size of the buffer in bytes, not the size in character (WCHAR)\r\n\r\nThis is because RegQueryValueEx is very low level and can read several types, thus handle the buffer as un-interpreted bytes.\r\nTherefore, dwSize must be multiplied by sizeof(WCHAR) before the call, and divided by sizeof(WCHAR) after the call if we use the RegExQueryValueW variant, so as to express the size in characters like we intend to."}],"action":{"name":"View Commit","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/2a6304d3586af4d7ada93d74be9ab4bcccbacdec#commitcomment-31827279"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/2a6304d3586af4d7ada93d74be9ab4bcccbacdec#commitcomment-31827279",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/2a6304d3586af4d7ada93d74be9ab4bcccbacdec#commitcomment-31827279",
"name": "View Commit"
},
"description": "View this Commit on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>