summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--dln.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f95f8d340d..9f0cd8e342 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Apr 16 21:25:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dln.c (rb_w32_check_imported): skip ordinal entries. patched by
+ phasis68 (Heesob Park) at [ruby-core:44381]. [Bug #6303]
+
Mon Apr 16 18:22:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
* spec/default.mspec: expand relative path for ruby_exe which uses
diff --git a/dln.c b/dln.c
index 6e472f08b9..c2ca0a6072 100644
--- a/dln.c
+++ b/dln.c
@@ -1215,9 +1215,13 @@ rb_w32_check_imported(HMODULE ext, HMODULE mine)
PIMAGE_THUNK_DATA pint = (PIMAGE_THUNK_DATA)((char *)ext + desc->Characteristics);
PIMAGE_THUNK_DATA piat = (PIMAGE_THUNK_DATA)((char *)ext + desc->FirstThunk);
while (piat->u1.Function) {
- PIMAGE_IMPORT_BY_NAME pii = (PIMAGE_IMPORT_BY_NAME)((char *)ext + (size_t)pint->u1.AddressOfData);
static const char prefix[] = "rb_";
- const char *name = (const char *)pii->Name;
+ PIMAGE_IMPORT_BY_NAME pii;
+ const char *name;
+
+ if (IMAGE_SNAP_BY_ORDINAL(pint->u1.Ordinal)) continue;
+ pii = (PIMAGE_IMPORT_BY_NAME)((char *)ext + (size_t)pint->u1.AddressOfData);
+ name = (const char *)pii->Name;
if (strncmp(name, prefix, sizeof(prefix) - 1) == 0) {
FARPROC addr = GetProcAddress(mine, name);
if (addr) return (FARPROC)piat->u1.Function == addr;