diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-03-06 04:15:42 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-03-06 04:15:42 +0000 |
commit | f30e4e7d846b33b7adf98eac7695c47234f48d4a (patch) | |
tree | 095315717e3050b4acb09d91e848dc2e3d0b2b5f /ext/Win32API | |
parent | 4a63aea75bf3c7eb1a26ab06d8a56789fa668a79 (diff) | |
download | ruby-f30e4e7d846b33b7adf98eac7695c47234f48d4a.tar.gz ruby-f30e4e7d846b33b7adf98eac7695c47234f48d4a.tar.xz ruby-f30e4e7d846b33b7adf98eac7695c47234f48d4a.zip |
2000-03-06
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/Win32API')
-rw-r--r-- | ext/Win32API/Win32API.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c index 38268d047..433d13abe 100644 --- a/ext/Win32API/Win32API.c +++ b/ext/Win32API/Win32API.c @@ -52,13 +52,10 @@ Win32API_initialize(self, dllname, proc, import, export) int len; int ex; - hdll = GetModuleHandle(RSTRING(dllname)->ptr); - if (!hdll) { - hdll = LoadLibrary(RSTRING(dllname)->ptr); - if (!hdll) - rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING(dllname)->ptr); - Data_Wrap_Struct(self, 0, Win32API_FreeLibrary, hdll); - } + hdll = LoadLibrary(RSTRING(dllname)->ptr); + if (!hdll) + rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING(dllname)->ptr); + rb_iv_set(self, "__hdll__", Data_Wrap_Struct(self, 0, Win32API_FreeLibrary, hdll)); hproc = GetProcAddress(hdll, RSTRING(proc)->ptr); if (!hproc) { str = rb_str_new3(proc); |