Re: [v3 1/5] compobj.dll16: Implement CoLoadLibrary16 and CoFreeLibrary16.
Zebediah Figura <z.figura12(a)gmail.com> writes:
+static HRESULT dll_list_add(LPCSTR library_name, struct open_dll **ret) +{ + struct open_dll *dll; + HMODULE16 library; + FARPROC16 DllCanUnloadNow; + + LIST_FOR_EACH_ENTRY(dll, &open_dll_list, struct open_dll, entry) + { + if(!strcasecmp(library_name, dll->library_name)) + { + TRACE("found %s already loaded\n", debugstr_a(library_name)); + InterlockedIncrement(&dll->refs); + *ret = dll; + return S_OK; + } + }
I don't think that comparing file names is appropriate for 16-bit, only the module name matters. You should probably call LoadLibrary16 in all cases.
+ + library = LoadLibrary16(library_name); + if (!library) + { + ERR("couldn't load in-process dll %s\n", debugstr_a(library_name)); + return E_ACCESSDENIED; /* FIXME: or should this be CO_E_DLLNOTFOUND? */ + }
You'd need to check again if the dll already exists, like the 32-bit code does. -- Alexandre Julliard julliard(a)winehq.org
On 02/13/2017 06:56 AM, Alexandre Julliard wrote:
Zebediah Figura <z.figura12(a)gmail.com> writes:
+static HRESULT dll_list_add(LPCSTR library_name, struct open_dll **ret) +{ + struct open_dll *dll; + HMODULE16 library; + FARPROC16 DllCanUnloadNow; + + LIST_FOR_EACH_ENTRY(dll, &open_dll_list, struct open_dll, entry) + { + if(!strcasecmp(library_name, dll->library_name)) + { + TRACE("found %s already loaded\n", debugstr_a(library_name)); + InterlockedIncrement(&dll->refs); + *ret = dll; + return S_OK; + } + }
I don't think that comparing file names is appropriate for 16-bit, only the module name matters. You should probably call LoadLibrary16 in all cases.
Please excuse my ignorance, but if LoadLibrary16 already implements a refcount, then is it even necessary to reimplement one here?
Zebediah Figura <z.figura12(a)gmail.com> writes:
On 02/13/2017 06:56 AM, Alexandre Julliard wrote:
Zebediah Figura <z.figura12(a)gmail.com> writes:
+static HRESULT dll_list_add(LPCSTR library_name, struct open_dll **ret) +{ + struct open_dll *dll; + HMODULE16 library; + FARPROC16 DllCanUnloadNow; + + LIST_FOR_EACH_ENTRY(dll, &open_dll_list, struct open_dll, entry) + { + if(!strcasecmp(library_name, dll->library_name)) + { + TRACE("found %s already loaded\n", debugstr_a(library_name)); + InterlockedIncrement(&dll->refs); + *ret = dll; + return S_OK; + } + }
I don't think that comparing file names is appropriate for 16-bit, only the module name matters. You should probably call LoadLibrary16 in all cases.
Please excuse my ignorance, but if LoadLibrary16 already implements a refcount, then is it even necessary to reimplement one here?
No, probably not. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Zebediah Figura