Questions arising from general review and familiarization with minheadless...
platforms/minheadless/windows/sqWin32Common.c defines functions...
fromSqueakInto()
fromSqueak()
fromSqueak2()
sqWin32PrintLastError()
The first three don't seem to be used from Windows...
$ grep -RIn fromSqueak * | grep -v sqWin32Common.c
platforms/Mac OS/plugins/SecurityPlugin/sqMacSecurity.c:21:#define fromSqueak(string,length) string
platforms/Mac OS/plugins/SecurityPlugin/sqMacSecurity.c:72: return isAccessiblePathName(fromSqueak(pathString, pathStringLength));
platforms/Mac OS/plugins/SecurityPlugin/sqMacSecurity.c:78: return isAccessiblePathName(fromSqueak(pathString, pathStringLength));
platforms/Mac OS/plugins/SecurityPlugin/sqMacSecurity.c:84: return isAccessiblePathName(fromSqueak(pathString, pathStringLength));
platforms/Mac OS/plugins/SecurityPlugin/sqMacSecurity.c:91: return isAccessibleFileName(fromSqueak(pathString, pathStringLength));
platforms/Mac OS/plugins/SecurityPlugin/sqMacSecurity.c:100: return isAccessibleFileName(fromSqueak(pathString, pathStringLength));
platforms/Mac OS/plugins/SecurityPlugin/sqMacSecurity.c:106: return isAccessibleFileName(fromSqueak(pathString, pathStringLength));
platforms/minheadless/windows/sqWin32.h:32:TCHAR *fromSqueak(const char *sqPtr, int sqSize);
platforms/minheadless/windows/sqWin32.h:33:TCHAR *fromSqueak2(const char *sqPtr, int sqSize);
platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c:24:static char* fromSqueak(char* string, int len)
platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c:76: return isAccessiblePathName(fromSqueak(pathString, pathStringLength));
platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c:84: return isAccessiblePathName(fromSqueak(pathString, pathStringLength));
platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c:92: return isAccessiblePathName(fromSqueak(pathString, pathStringLength));
platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c:103: return isAccessibleFileName(fromSqueak(pathString, pathStringLength));
platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c:118: return isAccessibleFileName(fromSqueak(pathString, pathStringLength));
platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c:125: return isAccessibleFileName(fromSqueak(pathString, pathStringLength));
So what are the pros/cons of the other two definitions? Can these be consolidated to a higher-commonality? Is there a security benefit to defining the function statically local just to that file.
#define fromSqueak(string,length) string
static char* fromSqueak(char* string, int len)
{
static char buf[MAXPATHLEN];
strncpy(buf, string, len);
buf[len] = '\0';
return buf;
}
For the last, what is the benefit versus printLastError(TEXT())...
$ grep -RIn sqWin32PrintLastError * | grep -v sqWin32Common.c
platforms/minheadless/windows/sqWin32.h:30:void sqWin32PrintLastError(const char *message);
platforms/minheadless/windows/sqWin32Alloc.c:192: sqWin32PrintLastError("VirtualProtect(x,y,PAGE_EXECUTE_READWRITE)");
platforms/minheadless/windows/sqWin32Alloc.c:204: sqWin32PrintLastError("VirtualProtect(x,y,PAGE_EXECUTE_READWRITE)");
platforms/minheadless/windows/sqWin32SpurAlloc.c:210: sqWin32PrintLastError("VirtualProtect(x,y,PAGE_EXECUTE_READWRITE)");
platforms/minheadless/windows/sqWin32SpurAlloc.c:224: sqWin32PrintLastError("VirtualProtect(x,y,PAGE_EXECUTE_READWRITE)");
@nicolas-cellier-aka-nice some of the above seems related to your recent comments on the mail list
—
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":"minheadless sqWin32Common.c (#345)"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/345"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/345",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/345",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>