[PATCH v4 1/5] compobj.dll16: Implement CoLoadLibrary16 and CoFreeLibrary16.

Zebediah Figura z.figura12 at gmail.com
Fri Feb 17 12:14:38 CST 2017


On 02/17/2017 12:05 PM, Alexandre Julliard wrote:
> Zebediah Figura <z.figura12 at gmail.com> writes:
> 
>> +/* --- loaded dll list implementation */
>> +struct open_dll
>> +{
>> +    HMODULE16 library;
>> +    FARPROC16 DllCanUnloadNow;
>> +    struct list entry;
>> +};
>> +
>> +static struct list open_dll_list = LIST_INIT(open_dll_list);
>> +
>> +static HRESULT dll_list_add(LPCSTR library_name, struct open_dll **ret)
>> +{
>> +    struct open_dll *dll;
>> +    HMODULE16 library;
>> +    FARPROC16 DllCanUnloadNow;
>> +
>> +    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? */
>> +    }
>> +
>> +    DllCanUnloadNow = GetProcAddress16(library, "DllCanUnloadNow");
>> +    /* Note: failing to find DllCanUnloadNow is not a failure */
>> +
>> +    dll = HeapAlloc(GetProcessHeap(), 0, sizeof(struct open_dll));
>> +    dll->library = library;
>> +    dll->DllCanUnloadNow = DllCanUnloadNow;
>> +    list_add_tail(&open_dll_list, &dll->entry);
>> +    *ret = dll;
>> +    TRACE("added new loaded dll %d\n", dll->library);
>> +
>> +    return S_OK;
>> +}
> 
> I'm not sure we even need the list at all. It would be needed for
> CoFreeAllLibraries16, but it's not clear that this is a useful function.
> 

That's a good point. I'll get rid of these and just implement
CoGetClassObject.




More information about the wine-devel mailing list