Module: wine
Branch: master
Commit: e12b487e2621816645a1f98a46249c2c9fa78f9c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e12b487e2621816645a1f98a4…
Author: Rob Shearman <rob(a)codeweavers.com>
Date: Wed Dec 12 14:48:51 2007 +0000
rpcrt4: Try to free every non-stack pointer in PointerFree now that NdrFree does the sanity checking for us.
---
dlls/rpcrt4/ndr_marshall.c | 14 ++++----------
dlls/rpcrt4/tests/ndr_marshall.c | 2 --
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 0fd2456..8c79751 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -1270,23 +1270,17 @@ static void PointerFree(PMIDL_STUB_MESSAGE pStubMsg,
m = NdrFreer[*desc & NDR_TABLE_MASK];
if (m) m(pStubMsg, Pointer, desc);
- /* we should check if the memory comes from NdrAllocate,
- * and deallocate only if so - checking if the pointer is between
- * BufferStart and BufferEnd will not always work since the buffer
- * may be reallocated when the server wants to marshal the reply */
- if (Pointer >= (unsigned char *)pStubMsg->RpcMsg->Buffer ||
- Pointer <= (unsigned char *)pStubMsg->RpcMsg->Buffer + pStubMsg->BufferLength)
- goto notfree;
-
if (attr & RPC_FC_P_ONSTACK) {
TRACE("not freeing stack ptr %p\n", Pointer);
return;
}
+
+ /* try to free everything else. NdrFree will do the job of sorting out
+ * whether we allocated it or whether the app did */
+
TRACE("freeing %p\n", Pointer);
NdrFree(pStubMsg, Pointer);
return;
-notfree:
- TRACE("not freeing %p\n", Pointer);
}
/***********************************************************************
diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c
index 42929d9..f0028bd 100644
--- a/dlls/rpcrt4/tests/ndr_marshall.c
+++ b/dlls/rpcrt4/tests/ndr_marshall.c
@@ -1193,9 +1193,7 @@ todo_wine {
my_free_called = 0;
StubMsg.Buffer = StubMsg.BufferStart;
NdrPointerFree( &StubMsg, mem, fmtstr_conf_str );
-todo_wine {
ok(my_free_called == 1, "free called %d\n", my_free_called);
-}
/* Server */
my_alloc_called = 0;
Module: wine
Branch: master
Commit: 7c3a7d8af1bf56732d87b29d30cf5b9e5acb67df
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7c3a7d8af1bf56732d87b29d3…
Author: Marcel Partap <mpartap(a)gmx.net>
Date: Sun Dec 9 19:52:09 2007 +0100
configure: Add i586-mingw32 prefix for crosscompiling.
---
aclocal.m4 | 2 +-
configure | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index a0b08d7..d5f09e1 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -141,7 +141,7 @@ dnl
AC_DEFUN([WINE_CHECK_MINGW_PROG],
[AC_CHECK_PROGS([$1],
m4_foreach([ac_wine_prefix],
- [i586-mingw32msvc, i386-mingw32msvc, i686-mingw32, i386-mingw32, mingw32, mingw],
+ [i586-mingw32msvc, i386-mingw32msvc, i686-mingw32, i586-mingw32, i386-mingw32, mingw32, mingw],
[ac_wine_prefix-$2 ]),
[$3],[$4])])
diff --git a/configure b/configure
index 0b2e0b4..37104b9 100755
--- a/configure
+++ b/configure
@@ -8880,7 +8880,7 @@ echo "${ECHO_T}$ac_cv_c_dll_hpux" >&6; }
if test "$cross_compiling" = "no"
then
- for ac_prog in i586-mingw32msvc-gcc i386-mingw32msvc-gcc i686-mingw32-gcc i386-mingw32-gcc mingw32-gcc mingw-gcc
+ for ac_prog in i586-mingw32msvc-gcc i386-mingw32msvc-gcc i686-mingw32-gcc i586-mingw32-gcc i386-mingw32-gcc mingw32-gcc mingw-gcc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -8923,7 +8923,7 @@ fi
done
test -n "$CROSSCC" || CROSSCC="false"
- for ac_prog in i586-mingw32msvc-dlltool i386-mingw32msvc-dlltool i686-mingw32-dlltool i386-mingw32-dlltool mingw32-dlltool mingw-dlltool
+ for ac_prog in i586-mingw32msvc-dlltool i386-mingw32msvc-dlltool i686-mingw32-dlltool i586-mingw32-dlltool i386-mingw32-dlltool mingw32-dlltool mingw-dlltool
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -8966,7 +8966,7 @@ fi
done
test -n "$DLLTOOL" || DLLTOOL="false"
- for ac_prog in i586-mingw32msvc-windres i386-mingw32msvc-windres i686-mingw32-windres i386-mingw32-windres mingw32-windres mingw-windres
+ for ac_prog in i586-mingw32msvc-windres i386-mingw32msvc-windres i686-mingw32-windres i586-mingw32-windres i386-mingw32-windres mingw32-windres mingw-windres
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -9009,7 +9009,7 @@ fi
done
test -n "$CROSSWINDRES" || CROSSWINDRES="false"
- for ac_prog in i586-mingw32msvc-ar i386-mingw32msvc-ar i686-mingw32-ar i386-mingw32-ar mingw32-ar mingw-ar
+ for ac_prog in i586-mingw32msvc-ar i386-mingw32msvc-ar i686-mingw32-ar i586-mingw32-ar i386-mingw32-ar mingw32-ar mingw-ar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2