Module: wine
Branch: master
Commit: 1a2ccfe9c79973f499e38321bd5267a2cddee59b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1a2ccfe9c79973f499e38321b…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com>
Date: Tue Mar 10 19:01:09 2009 -0400
richedit: Count graphics towards line width.
Images that are inserted into richedit controls store a space for the
text, since that is the character returned when getting the plain text
from the control.
When calculating the width of a line, the space character is skipped,
but images should not be skipped. This can be seen by inserting an
image into wordpad on a line by it's own, then centering the line. The
image will start from the center rather than being centered in the
control.
---
dlls/riched20/wrap.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c
index 54c90eb..579f33a 100644
--- a/dlls/riched20/wrap.c
+++ b/dlls/riched20/wrap.c
@@ -115,7 +115,8 @@ static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd)
WCHAR *text = p->member.run.strText->szData + len - 1;
assert (len);
- while (len && *(text--) == ' ')
+ if (~p->member.run.nFlags & MERF_GRAPHICS)
+ while (len && *(text--) == ' ')
len--;
if (len)
{
Module: wine
Branch: master
Commit: 689a49b52ac462b9988429cd89423faa10b1c33b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=689a49b52ac462b9988429cd8…
Author: Rob Shearman <robertshearman(a)gmail.com>
Date: Tue Mar 10 23:41:39 2009 +0000
rpcrt4: Add a check for a NULL ref pointer to NdrPointerUnmarshall.
---
dlls/rpcrt4/ndr_marshall.c | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 05eb638..b29186c 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -1500,18 +1500,28 @@ unsigned char * WINAPI NdrPointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
- /* Increment the buffer here instead of in PointerUnmarshall,
- * as that is used by embedded pointers which already handle the incrementing
- * the buffer, and shouldn't read any additional pointer data from the
- * buffer */
- if (*pFormat != RPC_FC_RP)
+ if (*pFormat == RPC_FC_RP)
{
- ALIGN_POINTER(pStubMsg->Buffer, 4);
Buffer = pStubMsg->Buffer;
- safe_buffer_increment(pStubMsg, 4);
+ /* Do the NULL ref pointer check here because embedded pointers can be
+ * NULL if the type the pointer is embedded in was allocated rather than
+ * being passed in by the client */
+ if (pStubMsg->IsClient && !*ppMemory)
+ {
+ ERR("NULL ref pointer is not allowed\n");
+ RpcRaiseException(RPC_X_NULL_REF_POINTER);
+ }
}
else
+ {
+ /* Increment the buffer here instead of in PointerUnmarshall,
+ * as that is used by embedded pointers which already handle the incrementing
+ * the buffer, and shouldn't read any additional pointer data from the
+ * buffer */
+ ALIGN_POINTER(pStubMsg->Buffer, 4);
Buffer = pStubMsg->Buffer;
+ safe_buffer_increment(pStubMsg, 4);
+ }
PointerUnmarshall(pStubMsg, Buffer, ppMemory, *ppMemory, pFormat, fMustAlloc);