summaryrefslogtreecommitdiff
path: root/dln.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-16 12:25:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-16 12:25:29 +0000
commit6655667d738d59cc824b264eef4587fe9700af15 (patch)
tree40f22aeea25888a8e77ba3dc47b04f3e3b75e58e /dln.c
parente0e479fbc58e18e323c9a57bb16773b7a1e8cb50 (diff)
* dln.c (rb_w32_check_imported): skip ordinal entries. patched by
phasis68 (Heesob Park) at [ruby-core:44381]. [Bug #6303] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dln.c')
-rw-r--r--dln.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dln.c b/dln.c
index 6e472f0..c2ca0a6 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;