Module: wine
Branch: master
Commit: 932544d34c24ee3e69dbd9c80a343b29ef96ebbe
URL: http://source.winehq.org/git/wine.git/?a=commit;h=932544d34c24ee3e69dbd9c80…
Author: Rob Shearman <robertshearman(a)gmail.com>
Date: Mon Nov 16 23:41:48 2009 +0000
ole32: OleInitialize should return S_OK if it is called for the first time on a thread independently of CoInitializeEx.
---
dlls/ole32/ole2.c | 3 +++
dlls/ole32/tests/compobj.c | 2 +-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c
index c612f33..6bf79fd 100644
--- a/dlls/ole32/ole2.c
+++ b/dlls/ole32/ole2.c
@@ -190,6 +190,9 @@ HRESULT WINAPI OleInitialize(LPVOID reserved)
if (FAILED(hr))
return hr;
+ if (!COM_CurrentInfo()->ole_inits)
+ hr = S_OK;
+
/*
* Then, it has to initialize the OLE specific modules.
* This includes:
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index 442e7b0..5ddfc11 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -1415,7 +1415,7 @@ static void test_CoInitializeEx(void)
/* Calling OleInitialize for the first time should yield S_OK even with
* apartment already initialized by previous CoInitialize(Ex) calls. */
hr = OleInitialize(NULL);
- todo_wine ok(hr == S_OK, "OleInitialize failed with error 0x%08x\n", hr);
+ ok(hr == S_OK, "OleInitialize failed with error 0x%08x\n", hr);
/* Subsequent calls to OleInitialize should return S_FALSE */
hr = OleInitialize(NULL);
Module: wine
Branch: master
Commit: 50a8b2a633bcdd313353d40df7d96da76843e8ea
URL: http://source.winehq.org/git/wine.git/?a=commit;h=50a8b2a633bcdd313353d40df…
Author: Roderick Colenbrander <thunderbird2k(a)gmail.com>
Date: Mon Nov 16 20:46:01 2009 +0100
wgl: The GLX context creation code isn't needed anymore in wglCopyContext because we always have a GLX context now.
---
dlls/winex11.drv/opengl.c | 36 +-----------------------------------
1 files changed, 1 insertions(+), 35 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 395e2a4..6277e8a 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1630,41 +1630,7 @@ BOOL CDECL X11DRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) {
TRACE("hglrcSrc: (%p), hglrcDst: (%p), mask: %#x\n", hglrcSrc, hglrcDst, mask);
- /* There is a slight difference in the way GL contexts share display lists in WGL and GLX.
- * In case of GLX you need to specify this at context creation time but in case of WGL you
- * do this using wglShareLists which you can call after creating the context.
- * To emulate WGL we try to delay the creation of the context until wglShareLists or wglMakeCurrent.
- * Up to now that works fine.
- *
- * The delayed GLX context creation could cause issues for wglCopyContext as it might get called
- * when there is no GLX context yet. The chance this will cause problems is small as at the time of
- * writing Wine has had OpenGL support for more than 7 years and this function has remained a stub
- * ever since then.
- */
- if(!src->ctx || !dst->ctx) {
- /* NOTE: As a special case, if both GLX contexts are NULL, that means
- * neither WGL context was made current. In that case, both contexts
- * are in a default state, so any copy would no-op.
- */
- if(!src->ctx && !dst->ctx) {
- TRACE("No source or destination contexts set. No-op.\n");
- return TRUE;
- }
-
- if (!src->ctx) {
- wine_tsx11_lock();
- src->ctx = create_glxcontext(gdi_display, src, NULL);
- TRACE(" created a delayed OpenGL context (%p)\n", src->ctx);
- }
- else if (!dst->ctx) {
- wine_tsx11_lock();
- dst->ctx = create_glxcontext(gdi_display, dst, NULL);
- TRACE(" created a delayed OpenGL context (%p)\n", dst->ctx);
- }
- }
- else
- wine_tsx11_lock();
-
+ wine_tsx11_lock();
pglXCopyContext(gdi_display, src->ctx, dst->ctx, mask);
wine_tsx11_unlock();
Module: wine
Branch: master
Commit: 1974e61b598007419637b74ea06ffdd777cf35ff
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1974e61b598007419637b74ea…
Author: Juan Lang <juan.lang(a)gmail.com>
Date: Fri Nov 13 18:05:11 2009 -0800
crypt32: Correctly match subdomains with dns name constraints.
---
dlls/crypt32/chain.c | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c
index 9b09e61..52ac5d9 100644
--- a/dlls/crypt32/chain.c
+++ b/dlls/crypt32/chain.c
@@ -642,9 +642,35 @@ static BOOL dns_name_matches(LPCWSTR constraint, LPCWSTR name,
*trustErrorStatus |= CERT_TRUST_INVALID_NAME_CONSTRAINTS;
else if (!name)
; /* no match */
- else if (lstrlenW(name) >= lstrlenW(constraint))
+ /* RFC 5280, section 4.2.1.10:
+ * "DNS name restrictions are expressed as host.example.com. Any DNS name
+ * that can be constructed by simply adding zero or more labels to the
+ * left-hand side of the name satisfies the name constraint. For example,
+ * www.host.example.com would satisfy the constraint but host1.example.com
+ * would not."
+ */
+ else if (lstrlenW(name) == lstrlenW(constraint))
+ match = !lstrcmpiW(name, constraint);
+ else if (lstrlenW(name) > lstrlenW(constraint))
+ {
match = !lstrcmpiW(name + lstrlenW(name) - lstrlenW(constraint),
constraint);
+ if (match)
+ {
+ BOOL dot = FALSE;
+ LPCWSTR ptr;
+
+ /* This only matches if name is a subdomain of constraint, i.e.
+ * there's a '.' between the beginning of the name and the
+ * matching portion of the name.
+ */
+ for (ptr = name + lstrlenW(name) - lstrlenW(constraint);
+ !dot && ptr >= name; ptr--)
+ if (*ptr == '.')
+ dot = TRUE;
+ match = dot;
+ }
+ }
/* else: name is too short, no match */
return match;
Module: wine
Branch: master
Commit: b74ef17efc1a35a6593113d57069d880e001705e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b74ef17efc1a35a6593113d57…
Author: Juan Lang <juan.lang(a)gmail.com>
Date: Fri Nov 13 17:51:55 2009 -0800
crypt32: If a hostname in a URI or rfc822 name constraint doesn't begin with '.', a match must be exact.
---
dlls/crypt32/chain.c | 39 +++++++++++++++++++++++++++++++++++++--
1 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c
index 0fd9df7..9b09e61 100644
--- a/dlls/crypt32/chain.c
+++ b/dlls/crypt32/chain.c
@@ -506,6 +506,41 @@ static BOOL CRYPT_CheckBasicConstraintsForCA(PCertificateChainEngine engine,
return validBasicConstraints;
}
+static BOOL domain_name_matches(LPCWSTR constraint, LPCWSTR name)
+{
+ BOOL match;
+
+ /* RFC 5280, section 4.2.1.10:
+ * "For URIs, the constraint applies to the host part of the name...
+ * When the constraint begins with a period, it MAY be expanded with one
+ * or more labels. That is, the constraint ".example.com" is satisfied by
+ * both host.example.com and my.host.example.com. However, the constraint
+ * ".example.com" is not satisfied by "example.com". When the constraint
+ * does not begin with a period, it specifies a host."
+ * and for email addresses,
+ * "To indicate all Internet mail addresses on a particular host, the
+ * constraint is specified as the host name. For example, the constraint
+ * "example.com" is satisfied by any mail address at the host
+ * "example.com". To specify any address within a domain, the constraint
+ * is specified with a leading period (as with URIs)."
+ */
+ if (constraint[0] == '.')
+ {
+ /* Must be strictly greater than, a name can't begin with '.' */
+ if (lstrlenW(name) > lstrlenW(constraint))
+ match = !lstrcmpiW(name + lstrlenW(name) - lstrlenW(constraint),
+ constraint);
+ else
+ {
+ /* name is too short, no match */
+ match = FALSE;
+ }
+ }
+ else
+ match = !lstrcmpiW(name, constraint);
+ return match;
+}
+
static BOOL url_matches(LPCWSTR constraint, LPCWSTR name,
DWORD *trustErrorStatus)
{
@@ -567,7 +602,7 @@ static BOOL url_matches(LPCWSTR constraint, LPCWSTR name,
else
hostname = name;
if (hostname)
- match = !lstrcmpiW(constraint, hostname);
+ match = domain_name_matches(constraint, hostname);
}
return match;
}
@@ -589,7 +624,7 @@ static BOOL rfc822_name_matches(LPCWSTR constraint, LPCWSTR name,
else
{
if ((at = strchrW(name, '@')))
- match = url_matches(constraint, at + 1, trustErrorStatus);
+ match = domain_name_matches(constraint, at + 1);
else
match = !lstrcmpiW(constraint, name);
}
Module: wine
Branch: master
Commit: e82005fe2dcd983769b09550e0f69f8bb36def05
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e82005fe2dcd983769b09550e…
Author: Juan Lang <juan.lang(a)gmail.com>
Date: Fri Nov 13 17:44:42 2009 -0800
crypt32: Only compare the hostname portion of a URL when checking against a name constraint.
---
dlls/crypt32/chain.c | 56 ++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c
index 3badef1..0fd9df7 100644
--- a/dlls/crypt32/chain.c
+++ b/dlls/crypt32/chain.c
@@ -517,14 +517,58 @@ static BOOL url_matches(LPCWSTR constraint, LPCWSTR name,
*trustErrorStatus |= CERT_TRUST_INVALID_NAME_CONSTRAINTS;
else if (!name)
; /* no match */
- else if (constraint[0] == '.')
+ else
{
- if (lstrlenW(name) > lstrlenW(constraint))
- match = !lstrcmpiW(name + lstrlenW(name) - lstrlenW(constraint),
- constraint);
+ LPCWSTR colon, authority_end, at, hostname = NULL;
+ /* The maximum length for a hostname is 254 in the DNS, see RFC 1034 */
+ WCHAR hostname_buf[255];
+
+ /* RFC 5280: only the hostname portion of the URL is compared. From
+ * section 4.2.1.10:
+ * "For URIs, the constraint applies to the host part of the name.
+ * The constraint MUST be specified as a fully qualified domain name
+ * and MAY specify a host or a domain."
+ * The format for URIs is in RFC 2396.
+ *
+ * First, remove any scheme that's present. */
+ colon = strchrW(name, ':');
+ if (colon && *(colon + 1) == '/' && *(colon + 2) == '/')
+ name = colon + 3;
+ /* Next, find the end of the authority component. (The authority is
+ * generally just the hostname, but it may contain a username or a port.
+ * Those are removed next.)
+ */
+ authority_end = strchrW(name, '/');
+ if (!authority_end)
+ authority_end = strchrW(name, '?');
+ if (!authority_end)
+ authority_end = name + strlenW(name);
+ /* Remove any port number from the authority */
+ for (colon = authority_end; colon >= name && *colon != ':'; colon--)
+ ;
+ if (*colon == ':')
+ authority_end = colon;
+ /* Remove any username from the authority */
+ if ((at = strchrW(name, '@')))
+ name = at;
+ /* Ignore any path or query portion of the URL. */
+ if (*authority_end)
+ {
+ if (authority_end - name < sizeof(hostname_buf) /
+ sizeof(hostname_buf[0]))
+ {
+ memcpy(hostname_buf, name,
+ (authority_end - name) * sizeof(WCHAR));
+ hostname_buf[authority_end - name] = 0;
+ hostname = hostname_buf;
+ }
+ /* else: Hostname is too long, not a match */
+ }
+ else
+ hostname = name;
+ if (hostname)
+ match = !lstrcmpiW(constraint, hostname);
}
- else
- match = !lstrcmpiW(constraint, name);
return match;
}