[2/5] urlmon: Improved MapUrlToZone{Ex2} and GetSecurityId support

Jacek Caban jacek at codeweavers.com
Fri Oct 7 11:10:28 CDT 2011


Hi Thomas,

On 10/6/11 6:42 PM, Thomas Mullaly wrote:
> ---
>   dlls/urlmon/sec_mgr.c       |   41 +++++++++++++++++++++++++++++++++++++++--
>   dlls/urlmon/tests/sec_mgr.c |   30 +++++++++++++++++++++++++++++-
>   2 files changed, 68 insertions(+), 3 deletions(-)

+        if(hres == S_FALSE){
+            DWORD scheme_type;
+            BOOL has_host;
+
+            hres = IUri_GetScheme(uri,&scheme_type);
+            if(FAILED(hres)) {
+                SysFreeString(scheme);
+                return hres;
+            }
+
+            hres = IUri_HasProperty(uri, Uri_PROPERTY_HOST,&has_host);
+            if(FAILED(hres)) {
+                SysFreeString(scheme);
+                return hres;
+            }
+
+            /* Known hierarchical scheme types must have a host. If they don't Windows
+             * assigns URLZONE_INVALID to the zone.
+             */
+            if((scheme_type != URL_SCHEME_UNKNOWN&&  scheme_type != URL_SCHEME_FILE)
+&&  is_hierarchical_scheme(scheme_type)&&  !has_host) {
+                *zone = URLZONE_INVALID;


It looks like get_zone_from_domains would be more logical place for 
this. It already does GetScheme call and you could just handle 
differently GetHost returning empty host.

      if(FAILED(hres))
          return hres == 0x80041001 ? E_INVALIDARG : hres;
+    else if(zone == URLZONE_INVALID)
+        return E_INVALIDARG;

You don't need 'else' here since if the previous if expression is true, we return anyways.

Jacek





More information about the wine-devel mailing list