1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2012-04-16 12:25:29 +00:00
parent e0e479fbc5
commit 6655667d73
2 changed files with 11 additions and 2 deletions

View file

@ -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

8
dln.c
View file

@ -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;