[OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

David T Lewis
 

We can now at least compile the whole VM and main plugins with -DUNICODE


You can view, comment on, or merge this pull request online at:

  https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332

Commit Summary

  • Handle both an ASCII (UTF8) and a WIDE (UTF16) version of image/vm name/path
  • DropPlugin: modernize OpenFile/_lwrite/_lclose API
  • Drop plugin: let tempPathName be Wide
  • Fix 2 potential buffer overrun in sqWin32Service.c
  • Setting fp flags _MCW_PC and _MCW_IC is not supported on ARM nor X64
  • The pageSize and pageMask are too short on WIN64
  • Use the eventually true UNICODE imageNameT if -DUNICODE
  • interpret pluginName as UTF8 rather than pure ASCII
  • refactor sqMessageBox to void using toUnicode
  • Discard now unused toUnicode fromUnicode fromSqueak fromSqueak2 lstrrchr
  • #if 0 ? YAGNI ! we now use builtin _WIN32 _WIN64 anyway
  • which SetUpPreferences()? There is no SetUpPreferences()!
  • RegisterWindowMessage takes a TCHAR *
  • Platform specific knowledge: WIN32_FILE and STD_FILE are mutually exclusive options
  • We can't compare a TCHAR*windowClassName with a char*buf
  • Tu quoque NewspeakVM, frustra TEXT macro...
  • gai_strerror returns a TCHAR*, we cannot simply fprintf it...
  • Let lookup account for NULL terminating a WCHAR*
  • Revert to ASCII only version of DnsInfo
  • iconPath is char*, LoadImage expects a TCHAR*
  • And account for the fact that iconPath is not NULL-TERMINATED!
  • DPRINTF must take a TCHAR*fmt because wvsprintf does!
  • NOTIFYICONDATA.szTip maybe a WCHAR* if -DUNICODE
  • _DISPLAY_DEVICE.DeviceString may be a WCHAR* if -DUNICODE, we cannot simply sprintf
  • VM_VERSION_TEXT is a TCHAR*, we cannot simply fprintf
  • iniName, manufacturer and model may be WCHAR* if -DUNICODE
  • Information queried in Registry can be WideChar if -DUNICODE
  • Make stderrName and stdoutName be WCHAR*
  • Retract support for Windows95 (no you don't dream it's nearly 2019!)
  • Handle UTF16 logName and serviceName

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<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":"DESCRIPTION","message":"Win64 unicode (#332)"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

David T Lewis
 

@nicolas-cellier-aka-nice pushed 1 commit.

  • e5cd4fb Fix 3 potential buffer overrun


You are receiving this because you are subscribed to this thread.
View it on GitHub or mute the thread.

<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 pushed 1 commit in #332"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/1f616371ff559224ad6200d1a1109e6c1a5007b3..e5cd4fb0538cdd090e7ceb4078edc261cb5099a0"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/1f616371ff559224ad6200d1a1109e6c1a5007b3..e5cd4fb0538cdd090e7ceb4078edc261cb5099a0", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/1f616371ff559224ad6200d1a1109e6c1a5007b3..e5cd4fb0538cdd090e7ceb4078edc261cb5099a0", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

David T Lewis
In reply to this post by David T Lewis
 

@nicolas-cellier-aka-nice pushed 1 commit.

  • 4ded318 Fix my own confusion about wcsncat


You are receiving this because you are subscribed to this thread.
View it on GitHub or mute the thread.

<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 pushed 1 commit in #332"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/e5cd4fb0538cdd090e7ceb4078edc261cb5099a0..4ded3182b34a2cc2ac3ec1299590a71515a07972"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/e5cd4fb0538cdd090e7ceb4078edc261cb5099a0..4ded3182b34a2cc2ac3ec1299590a71515a07972", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/e5cd4fb0538cdd090e7ceb4078edc261cb5099a0..4ded3182b34a2cc2ac3ec1299590a71515a07972", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

David T Lewis
In reply to this post by David T Lewis
 

@nicolas-cellier-aka-nice pushed 1 commit.

  • af19ed7 Fix: Shlemiel the painter needs to paint strncat too


You are receiving this because you are subscribed to this thread.
View it on GitHub or mute the thread.

<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 pushed 1 commit in #332"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/4ded3182b34a2cc2ac3ec1299590a71515a07972..af19ed7e15bed953ddbc3d3ab4295683e34d0ab6"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/4ded3182b34a2cc2ac3ec1299590a71515a07972..af19ed7e15bed953ddbc3d3ab4295683e34d0ab6", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/4ded3182b34a2cc2ac3ec1299590a71515a07972..af19ed7e15bed953ddbc3d3ab4295683e34d0ab6", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

David T Lewis
In reply to this post by David T Lewis
 

@nicolas-cellier-aka-nice pushed 1 commit.

  • bf3840c Fix a TCHAR*crashInfo trying to mix a char*msg


You are receiving this because you are subscribed to this thread.
View it on GitHub or mute the thread.

<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 pushed 1 commit in #332"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/af19ed7e15bed953ddbc3d3ab4295683e34d0ab6..bf3840c320cf6cd488d83b1ebf7d0ea124b6ad87"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/af19ed7e15bed953ddbc3d3ab4295683e34d0ab6..bf3840c320cf6cd488d83b1ebf7d0ea124b6ad87", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/af19ed7e15bed953ddbc3d3ab4295683e34d0ab6..bf3840c320cf6cd488d83b1ebf7d0ea124b6ad87", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

David T Lewis
In reply to this post by David T Lewis
 

@nicolas-cellier-aka-nice pushed 1 commit.

  • 252e2a8 Fix another potential Buffer overrun in sqWin32MIDI.c


You are receiving this because you are subscribed to this thread.
View it on GitHub or mute the thread.

<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 pushed 1 commit in #332"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/bf3840c320cf6cd488d83b1ebf7d0ea124b6ad87..252e2a84a250faa99dbacae6c439ac132b8ca9e7"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/bf3840c320cf6cd488d83b1ebf7d0ea124b6ad87..252e2a84a250faa99dbacae6c439ac132b8ca9e7", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/bf3840c320cf6cd488d83b1ebf7d0ea124b6ad87..252e2a84a250faa99dbacae6c439ac132b8ca9e7", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

David T Lewis
In reply to this post by David T Lewis
 

@nicolas-cellier-aka-nice commented on this pull request.


In platforms/win32/vm/sqWin32Main.c:

>      WCHAR buffer[256];
     DWORD memSize;
 
     /* Argh. It seems that the registry key regularly starts
        with \Registry\Machine\ which doesn't work with RegOpenKey below.
        I have no idea why but for now I'll just truncate that part if
        we recognize it... */
-    if (_strnicmp(keyName, "\\registry\\machine\\", 18) == 0) {
-      memcpy(keyName, keyName+18, strlen(keyName)-17);
+    if (_wcsnicmp(keyName, L"\\registry\\machine\\", 18) == 0) {
+      memmove(keyName, keyName+18*sizeof(WCHAR), (wcslen(keyName)-17)*sizeof(WCHAR));

Err: keyName is WCHAR*, keyName+18 skips 18 characters, keyName+18*sizeof(WCHAR) skips 36 characters!


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<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 commented on #332"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332#pullrequestreview-188685921"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332#pullrequestreview-188685921", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332#pullrequestreview-188685921", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

David T Lewis
In reply to this post by David T Lewis
 

@nicolas-cellier-aka-nice pushed 1 commit.

  • 3e51616 fixup: skip only 18 WCHAR if keyName begins with \\registry\\machine


You are receiving this because you are subscribed to this thread.
View it on GitHub or mute the thread.

<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 pushed 1 commit in #332"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/252e2a84a250faa99dbacae6c439ac132b8ca9e7..3e51616a56a0ef49b7c67a580db0f0fbaaea588f"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/252e2a84a250faa99dbacae6c439ac132b8ca9e7..3e51616a56a0ef49b7c67a580db0f0fbaaea588f", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332/files/252e2a84a250faa99dbacae6c439ac132b8ca9e7..3e51616a56a0ef49b7c67a580db0f0fbaaea588f", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

David T Lewis
In reply to this post by David T Lewis
 

@nicolas-cellier-aka-nice commented on this pull request.


In platforms/win32/vm/sqWin32Main.c:

>      WCHAR buffer[256];
     DWORD memSize;
 
     /* Argh. It seems that the registry key regularly starts
        with \Registry\Machine\ which doesn't work with RegOpenKey below.
        I have no idea why but for now I'll just truncate that part if
        we recognize it... */
-    if (_strnicmp(keyName, "\\registry\\machine\\", 18) == 0) {
-      memcpy(keyName, keyName+18, strlen(keyName)-17);
+    if (_wcsnicmp(keyName, L"\\registry\\machine\\", 18) == 0) {
+      memmove(keyName, keyName+18*sizeof(WCHAR), (wcslen(keyName)-17)*sizeof(WCHAR));

Fixed in 3e51616


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<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 commented on #332"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332#discussion_r244744996"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332#discussion_r244744996", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332#discussion_r244744996", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

David T Lewis
In reply to this post by David T Lewis
 

Merged #332 into Cog.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<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":"DESCRIPTION","message":"Merged #332 into Cog."}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332#event-2050509837"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332#event-2050509837", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332#event-2050509837", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>