Zebediah Figura z.figura12@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.
On 02/13/2017 06:56 AM, Alexandre Julliard wrote:
Zebediah Figura z.figura12@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@gmail.com writes:
On 02/13/2017 06:56 AM, Alexandre Julliard wrote:
Zebediah Figura z.figura12@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.