shdocvw: Added get_LocationURL implementation.

Robert Shearman rob at codeweavers.com
Mon Mar 6 09:13:14 CST 2006


Jacek Caban wrote:

>c24b7d0d0c498ec98785b93eba54b41d53ab2c9b
>diff --git a/dlls/shdocvw/navigate.c b/dlls/shdocvw/navigate.c
>index 9c4893c..40d4a06 100644
>--- a/dlls/shdocvw/navigate.c
>+++ b/dlls/shdocvw/navigate.c
>@@ -316,7 +316,7 @@ static IBindStatusCallback *create_callb
>     return BINDSC(ret);
> }
> 
>-static void on_before_navigate2(WebBrowser *This, PBYTE post_data, ULONG post_data_len,
>+static void on_before_navigate2(WebBrowser *This, LPWSTR url, PBYTE post_data, ULONG post_data_len,
>                                 LPWSTR headers, VARIANT_BOOL *cancel)
> {
>     VARIANT var_url, var_flags, var_frame_name, var_post_data, var_post_data2, var_headers;
>@@ -367,7 +367,7 @@ static void on_before_navigate2(WebBrows
>     V_VT(params+5) = (VT_BYREF|VT_VARIANT);
>     V_VARIANTREF(params+5) = &var_url;
>     V_VT(&var_url) = VT_BSTR;
>-    V_BSTR(&var_url) = SysAllocString(This->url);
>+    V_BSTR(&var_url) = url;
> 
>     V_VT(params+6) = (VT_DISPATCH);
>     V_DISPATCH(params+6) = (IDispatch*)WEBBROWSER2(This);
>  
>

BSTR and LPWSTR are not interchangable. A lot of the time you can get 
away with it, but if anything tries to access the length that prefixes a 
BSTR on the LPWSTR then bad things will happen.

-- 
Rob Shearman




More information about the wine-devel mailing list