Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
947e4ec5
Commit
947e4ec5
authored
Sep 17, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Sep 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: IUriBuilder_CreateUri* functions return base IUri if there were no changes.
parent
2e1f8548
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
41 deletions
+85
-41
uri.c
dlls/urlmon/tests/uri.c
+0
-0
uri.c
dlls/urlmon/uri.c
+85
-41
No files found.
dlls/urlmon/tests/uri.c
View file @
947e4ec5
This diff is collapsed.
Click to expand it.
dlls/urlmon/uri.c
View file @
947e4ec5
...
...
@@ -41,6 +41,7 @@ typedef struct {
DWORD
canon_size
;
DWORD
canon_len
;
BOOL
display_absolute
;
DWORD
create_flags
;
INT
scheme_start
;
DWORD
scheme_len
;
...
...
@@ -335,6 +336,31 @@ static inline BOOL is_hierarchical_scheme(URL_SCHEME type) {
type
==
URL_SCHEME_RES
);
}
/* Checks if 'flags' contains an invalid combination of Uri_CREATE flags. */
static
inline
BOOL
has_invalid_flag_combination
(
DWORD
flags
)
{
return
((
flags
&
Uri_CREATE_DECODE_EXTRA_INFO
&&
flags
&
Uri_CREATE_NO_DECODE_EXTRA_INFO
)
||
(
flags
&
Uri_CREATE_CANONICALIZE
&&
flags
&
Uri_CREATE_NO_CANONICALIZE
)
||
(
flags
&
Uri_CREATE_CRACK_UNKNOWN_SCHEMES
&&
flags
&
Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
)
||
(
flags
&
Uri_CREATE_PRE_PROCESS_HTML_URI
&&
flags
&
Uri_CREATE_NO_PRE_PROCESS_HTML_URI
)
||
(
flags
&
Uri_CREATE_IE_SETTINGS
&&
flags
&
Uri_CREATE_NO_IE_SETTINGS
));
}
/* Applies each default Uri_CREATE flags to 'flags' if it
* doesn't cause a flag conflict.
*/
static
void
apply_default_flags
(
DWORD
*
flags
)
{
if
(
!
(
*
flags
&
Uri_CREATE_NO_CANONICALIZE
))
*
flags
|=
Uri_CREATE_CANONICALIZE
;
if
(
!
(
*
flags
&
Uri_CREATE_NO_DECODE_EXTRA_INFO
))
*
flags
|=
Uri_CREATE_DECODE_EXTRA_INFO
;
if
(
!
(
*
flags
&
Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
))
*
flags
|=
Uri_CREATE_CRACK_UNKNOWN_SCHEMES
;
if
(
!
(
*
flags
&
Uri_CREATE_NO_PRE_PROCESS_HTML_URI
))
*
flags
|=
Uri_CREATE_PRE_PROCESS_HTML_URI
;
if
(
!
(
*
flags
&
Uri_CREATE_IE_SETTINGS
))
*
flags
|=
Uri_CREATE_NO_IE_SETTINGS
;
}
/* Determines if the URI is hierarchical using the information already parsed into
* data and using the current location of parsing in the URI string.
*
...
...
@@ -3381,6 +3407,40 @@ static void reset_builder(UriBuilder *builder) {
builder
->
modified_props
=
0
;
}
static
HRESULT
build_uri
(
const
UriBuilder
*
builder
,
IUri
**
uri
,
DWORD
create_flags
,
DWORD
use_orig_flags
,
DWORD
encoding_mask
)
{
if
(
!
uri
)
return
E_POINTER
;
if
(
encoding_mask
&&
(
!
builder
->
uri
||
builder
->
modified_props
))
{
*
uri
=
NULL
;
return
E_NOTIMPL
;
}
/* Decide what flags should be used when creating the Uri. */
if
((
use_orig_flags
&
UriBuilder_USE_ORIGINAL_FLAGS
)
&&
builder
->
uri
)
create_flags
=
builder
->
uri
->
create_flags
;
else
{
if
(
has_invalid_flag_combination
(
create_flags
))
{
*
uri
=
NULL
;
return
E_INVALIDARG
;
}
/* Set the default flags if they don't cause a conflict. */
apply_default_flags
(
&
create_flags
);
}
/* Return the base IUri if no changes have been made and the create_flags match. */
if
(
builder
->
uri
&&
!
builder
->
modified_props
&&
builder
->
uri
->
create_flags
==
create_flags
)
{
*
uri
=
URI
(
builder
->
uri
);
IUri_AddRef
(
*
uri
);
return
S_OK
;
}
return
E_NOTIMPL
;
}
#define URI_THIS(iface) DEFINE_THIS(Uri, IUri, iface)
static
HRESULT
WINAPI
Uri_QueryInterface
(
IUri
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -4246,11 +4306,7 @@ HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IU
}
/* Check for invalid flags. */
if
((
dwFlags
&
Uri_CREATE_DECODE_EXTRA_INFO
&&
dwFlags
&
Uri_CREATE_NO_DECODE_EXTRA_INFO
)
||
(
dwFlags
&
Uri_CREATE_CANONICALIZE
&&
dwFlags
&
Uri_CREATE_NO_CANONICALIZE
)
||
(
dwFlags
&
Uri_CREATE_CRACK_UNKNOWN_SCHEMES
&&
dwFlags
&
Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
)
||
(
dwFlags
&
Uri_CREATE_PRE_PROCESS_HTML_URI
&&
dwFlags
&
Uri_CREATE_NO_PRE_PROCESS_HTML_URI
)
||
(
dwFlags
&
Uri_CREATE_IE_SETTINGS
&&
dwFlags
&
Uri_CREATE_NO_IE_SETTINGS
))
{
if
(
has_invalid_flag_combination
(
dwFlags
))
{
*
ppURI
=
NULL
;
return
E_INVALIDARG
;
}
...
...
@@ -4266,6 +4322,9 @@ HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IU
ret
->
lpIUriVtbl
=
&
UriVtbl
;
ret
->
ref
=
1
;
/* Explicitly set the default flags if it doesn't cause a flag conflict. */
apply_default_flags
(
&
dwFlags
);
/* Pre process the URI, unless told otherwise. */
if
(
!
(
dwFlags
&
Uri_CREATE_NO_PRE_PROCESS_HTML_URI
))
ret
->
raw_uri
=
pre_process_uri
(
pwzURI
);
...
...
@@ -4298,6 +4357,8 @@ HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IU
return
hr
;
}
ret
->
create_flags
=
dwFlags
;
*
ppURI
=
URI
(
ret
);
return
S_OK
;
}
...
...
@@ -4436,19 +4497,13 @@ static HRESULT WINAPI UriBuilder_CreateUriSimple(IUriBuilder *iface,
IUri
**
ppIUri
)
{
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p)->(%d %d %p)
\n
"
,
This
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
if
(
!
ppIUri
)
return
E_POINTER
;
/* Acts the same way as CreateUri. */
if
(
dwAllowEncodingPropertyMask
&&
(
!
This
->
uri
||
This
->
modified_props
))
{
*
ppIUri
=
NULL
;
return
E_NOTIMPL
;
}
FIXME
(
"(%p)->(%d %d %p)
\n
"
,
This
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
return
E_NOTIMPL
;
hr
=
build_uri
(
This
,
ppIUri
,
0
,
UriBuilder_USE_ORIGINAL_FLAGS
,
dwAllowEncodingPropertyMask
);
if
(
hr
==
E_NOTIMPL
)
FIXME
(
"(%p)->(%d %d %p)
\n
"
,
This
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
return
hr
;
}
static
HRESULT
WINAPI
UriBuilder_CreateUri
(
IUriBuilder
*
iface
,
...
...
@@ -4458,22 +4513,17 @@ static HRESULT WINAPI UriBuilder_CreateUri(IUriBuilder *iface,
IUri
**
ppIUri
)
{
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p)->(0x%08x %d %d %p)
\n
"
,
This
,
dwCreateFlags
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
if
(
!
ppIUri
)
return
E_POINTER
;
/* The only time it doesn't return E_NOTIMPL when the dwAllow parameter
* has flags set, is when the IUriBuilder has a IUri set and it hasn't
* been modified (a call to a "Set*" hasn't been performed).
*/
if
(
dwAllowEncodingPropertyMask
&&
(
!
This
->
uri
||
This
->
modified_props
))
{
*
ppIUri
=
NULL
;
return
E_NOTIMPL
;
}
if
(
dwCreateFlags
==
-
1
)
hr
=
build_uri
(
This
,
ppIUri
,
0
,
UriBuilder_USE_ORIGINAL_FLAGS
,
dwAllowEncodingPropertyMask
);
else
hr
=
build_uri
(
This
,
ppIUri
,
dwCreateFlags
,
0
,
dwAllowEncodingPropertyMask
);
FIXME
(
"(%p)->(0x%08x %d %d %p)
\n
"
,
This
,
dwCreateFlags
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
return
E_NOTIMPL
;
if
(
hr
==
E_NOTIMPL
)
FIXME
(
"(%p)->(0x%08x %d %d %p)
\n
"
,
This
,
dwCreateFlags
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
return
hr
;
}
static
HRESULT
WINAPI
UriBuilder_CreateUriWithFlags
(
IUriBuilder
*
iface
,
...
...
@@ -4484,21 +4534,15 @@ static HRESULT WINAPI UriBuilder_CreateUriWithFlags(IUriBuilder *iface,
IUri
**
ppIUri
)
{
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p)->(0x%08x 0x%08x %d %d %p)
\n
"
,
This
,
dwCreateFlags
,
dwUriBuilderFlags
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
if
(
!
ppIUri
)
return
E_POINTER
;
/* Same as CreateUri. */
if
(
dwAllowEncodingPropertyMask
&&
(
!
This
->
uri
||
This
->
modified_props
))
{
*
ppIUri
=
NULL
;
return
E_NOTIMPL
;
}
FIXME
(
"(%p)->(0x%08x 0x%08x %d %d %p)
\n
"
,
This
,
dwCreateFlags
,
dwUriBuilderFlags
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
return
E_NOTIMPL
;
hr
=
build_uri
(
This
,
ppIUri
,
dwCreateFlags
,
dwUriBuilderFlags
,
dwAllowEncodingPropertyMask
);
if
(
hr
==
E_NOTIMPL
)
FIXME
(
"(%p)->(0x%08x 0x%08x %d %d %p)
\n
"
,
This
,
dwCreateFlags
,
dwUriBuilderFlags
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
return
hr
;
}
static
HRESULT
WINAPI
UriBuilder_GetIUri
(
IUriBuilder
*
iface
,
IUri
**
ppIUri
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment