[1/4] urlmon: Implemented IUriBuilder_{Get/Set}Fragment
Jacek Caban
jacek at codeweavers.com
Fri Sep 3 08:57:57 CDT 2010
Hi Thomas,
On 9/3/10 1:19 AM, Thomas Mullaly wrote:
> ---
> dlls/urlmon/tests/uri.c | 22 ++++++++++++-
> dlls/urlmon/uri.c | 80
> ++++++++++++++++++++++++++++++++++++++++++----
> 2 files changed, 93 insertions(+), 9 deletions(-)
>
+static HRESULT setup_builder_properties(UriBuilder*builder, const Uri* uri) {
+ if(uri->fragment_start> -1) {
+ builder->fragment = heap_alloc((uri->fragment_len+1)*sizeof(WCHAR));
+ if(!builder->fragment)
+ return E_OUTOFMEMORY;
+
+ memcpy(builder->fragment, uri->canon_uri+uri->fragment_start, uri->fragment_len*sizeof(WCHAR));
+ builder->fragment[uri->fragment_len] = '\0';
+ builder->fragment_len = uri->fragment_len;
+ }
+
+ return S_OK;
+}
I don't think it's a good idea. It should be possible to avoid fetching all
URI properties here. You can do it, eg. on demand, when you get a call to
GetFragment and the fragment is not everwriten by SetFragment call.
Thinking about it, the way these APIs work suggests that Uri object should
store null-terminated properties that we could return here, but it may be
too far conclusion.
Jacek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20100903/337f2b54/attachment.htm>
More information about the wine-devel
mailing list