Module: wine
Branch: master
Commit: a552c2ead7c406dd75dc49d32c797f3d1863a846
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=a552c2ead7c406dd75dc49d…
Author: Robert Shearman <rob(a)codeweavers.com>
Date: Mon Sep 11 11:11:56 2006 +0100
ole32: Fix the HGLOBAL stream IStream_Read function to return S_OK even if not all of the requested bytes were available.
---
dlls/ole32/hglobalstream.c | 7 ++-----
dlls/ole32/tests/hglobalstream.c | 2 --
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c
index eb2af30..7c78d68 100644
--- a/dlls/ole32/hglobalstream.c
+++ b/dlls/ole32/hglobalstream.c
@@ -255,14 +255,11 @@ static HRESULT WINAPI HGLOBALStreamImpl_
GlobalUnlock(This->supportHandle);
/*
- * The function returns S_OK if the buffer was filled completely
- * it returns S_FALSE if the end of the stream is reached before the
+ * Always returns S_OK even if the end of the stream is reached before the
* buffer is filled
*/
- if(*pcbRead == cb)
- return S_OK;
- return S_FALSE;
+ return S_OK;
}
/***
diff --git a/dlls/ole32/tests/hglobalstream.c b/dlls/ole32/tests/hglobalstream.c
index f335852..df63093 100644
--- a/dlls/ole32/tests/hglobalstream.c
+++ b/dlls/ole32/tests/hglobalstream.c
@@ -53,9 +53,7 @@ static void test_streamonhglobal(IStream
/* should return S_OK, not S_FALSE */
hr = IStream_Read(pStream, buffer, sizeof(buffer), &read);
- todo_wine {
ok_ole_success(hr, "IStream_Read");
- }
ok(read == sizeof(data), "IStream_Read returned read %ld instead of %d\n", read, sizeof(data));
/* ignores HighPart */
Module: wine
Branch: master
Commit: f9141fddbe3e8a44c22006e6e0160af4d36813ad
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=f9141fddbe3e8a44c22006e…
Author: Paul Vriens <Paul.Vriens(a)xs4all.nl>
Date: Mon Sep 11 11:23:20 2006 +0200
wintrust: Use the return value of CryptRegisterOIDFunction.
---
dlls/wintrust/register.c | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/wintrust/register.c b/dlls/wintrust/register.c
index c9baea5..955aad9 100644
--- a/dlls/wintrust/register.c
+++ b/dlls/wintrust/register.c
@@ -740,9 +740,25 @@ HRESULT WINAPI DllRegisterServer(void)
* - One call to CryptSIPRemoveProvider (do we need that?)
*/
+ /* Testing on native shows that when an error is encountered in one of the CryptRegisterOIDFunction calls
+ * the rest of these calls is skipped. Registering is however continued for the trust providers.
+ *
+ * We are not totally in line with native as there all decoding functions are registered after all encoding
+ * functions.
+ */
#define WINTRUST_REGISTEROID( oid, encode_funcname, decode_funcname ) \
- CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_ENCODE_OBJECT_FUNC, oid, SP_POLICY_PROVIDER_DLL_NAME, encode_funcname); \
- CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_DECODE_OBJECT_FUNC, oid, SP_POLICY_PROVIDER_DLL_NAME, decode_funcname)
+ do { \
+ if (!CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_ENCODE_OBJECT_FUNC, oid, SP_POLICY_PROVIDER_DLL_NAME, encode_funcname)) \
+ { \
+ Res = HRESULT_FROM_WIN32(GetLastError()); \
+ goto add_trust_providers; \
+ } \
+ if (!CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_DECODE_OBJECT_FUNC, oid, SP_POLICY_PROVIDER_DLL_NAME, decode_funcname)) \
+ { \
+ Res = HRESULT_FROM_WIN32(GetLastError()); \
+ goto add_trust_providers; \
+ } \
+ } while (0)
WINTRUST_REGISTEROID(SPC_PE_IMAGE_DATA_OBJID, WVTAsn1SpcPeImageDataEncode, WVTAsn1SpcPeImageDataDecode);
WINTRUST_REGISTEROID(SPC_PE_IMAGE_DATA_STRUCT, WVTAsn1SpcPeImageDataEncode, WVTAsn1SpcPeImageDataDecode);
@@ -773,6 +789,8 @@ #define WINTRUST_REGISTEROID( oid, encod
#undef WINTRUST_REGISTEROID
+add_trust_providers:
+
/* Testing on W2K3 shows:
* If we cannot open HKLM\Software\Microsoft\Cryptography\Providers\Trust
* for writing, DllRegisterServer returns S_FALSE. If the key can be opened