[3/4]strmbase: implement OLE registration in AMovieDllRegisterServer2

Alexandre Julliard julliard at winehq.org
Wed Oct 20 09:15:08 CDT 2010


Aric Stewart <aric at codeweavers.com> writes:

>  HRESULT WINAPI AMovieDllRegisterServer2(BOOL bRegister)
>  {
>      HRESULT hr;
>      int i;
>      IFilterMapper2 *pIFM2 = NULL;
> +    HMODULE psapi;
> +    fnGetModuleFileNameExW pFunc;
> +    WCHAR szFileName[MAX_PATH];
> +
> +    psapi = LoadLibraryA("psapi.dll");
> +    if (psapi)
> +    {
> +        pFunc = (fnGetModuleFileNameExW)GetProcAddress(psapi, "GetModuleFileNameExW");
> +        if (pFunc)
> +        {
> +            if (!pFunc(GetCurrentProcess(), g_hInst, szFileName, MAX_PATH))
> +            {
> +                ERR("Failed to get module file name for registration\n");
> +                return E_FAIL;
> +            }
> +        }
> +        else
> +        {
> +            ERR("Failed to get get function GetModuleFileNameExW\n");
> +            return E_FAIL;
> +        }
> +    }
> +    else
> +    {
> +        ERR("Failed to load psapi.dll\n");
> +        return E_FAIL;
> +    }
> +    FreeLibrary(psapi);

There's no reason to use psapi for this.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list