Vincent Povirk : setupapi: Implement ProfileItems directive.

Rob Shearman robertshearman at gmail.com
Thu Nov 6 06:00:12 CST 2008


2008/11/5 Vincent Povirk <vincent at codeweavers.com>:
> +    CoInitialize(NULL);
> +
> +    if (!SUCCEEDED(CoCreateInstance( &CLSID_ShellLink, NULL,
> +                                     CLSCTX_INPROC_SERVER, &IID_IShellLinkW, (LPVOID*)&shelllink)))
> +        goto done;
> +
> +    IShellLinkW_SetPath( shelllink, cmdline );
> +    SHPathPrepareForWriteW( NULL, NULL, lnkpath, SHPPFW_DIRCREATE|SHPPFW_IGNOREFILENAME );
> +    if (SUCCEEDED(IShellLinkW_QueryInterface( shelllink, &IID_IPersistFile, (LPVOID*)&persistfile)))
> +    {
> +        TRACE( "writing link: %s\n", debugstr_w(lnkpath) );
> +        IPersistFile_Save( persistfile, lnkpath, FALSE );
> +        IPersistFile_Release( persistfile );
> +    }
> +    IShellLinkW_Release( shelllink );
> +
> +done:
> +    HeapFree( GetProcessHeap(), 0, cmdline );
>     return TRUE;

You've forgotten to call CoUninitialize().

-- 
Rob Shearman



More information about the wine-devel mailing list