From 2814ddff4f4b4e32f1862ea891201557fed88fa2 Mon Sep 17 00:00:00 2001 From: wj32 Date: Thu, 14 Jan 2010 10:44:55 +0000 Subject: [PATCH] fixed the PHA_DEREFERENCE macro (now an inline function) git-svn-id: svn://svn.code.sf.net/p/processhacker/code@2622 21ef857c-d57f-4fe0-8362-d861dc6d29cd --- 2.x/trunk/ProcessHacker/basesupa.c | 8 ++++++++ 2.x/trunk/ProcessHacker/include/phbase.h | 5 +++++ 2.x/trunk/ProcessHacker/include/ref.h | 13 +++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/2.x/trunk/ProcessHacker/basesupa.c b/2.x/trunk/ProcessHacker/basesupa.c index 73a459e7e..73dc19c97 100644 --- a/2.x/trunk/ProcessHacker/basesupa.c +++ b/2.x/trunk/ProcessHacker/basesupa.c @@ -56,6 +56,14 @@ PPH_STRING PhaConcatStrings( return PHA_DEREFERENCE(PhConcatStrings_V(Count, argptr)); } +PPH_STRING PhaConcatStrings2( + __in PWSTR String1, + __in PWSTR String2 + ) +{ + return PHA_DEREFERENCE(PhConcatStrings2(String1, String2)); +} + PPH_STRING PhaPrintfString( __in PWSTR Format, ... diff --git a/2.x/trunk/ProcessHacker/include/phbase.h b/2.x/trunk/ProcessHacker/include/phbase.h index db2536305..5596c9bfa 100644 --- a/2.x/trunk/ProcessHacker/include/phbase.h +++ b/2.x/trunk/ProcessHacker/include/phbase.h @@ -1142,6 +1142,11 @@ PPH_STRING PhaConcatStrings( ... ); +PPH_STRING PhaConcatStrings2( + __in PWSTR String1, + __in PWSTR String2 + ); + PPH_STRING PhaLowerString( __in PPH_STRING String ); diff --git a/2.x/trunk/ProcessHacker/include/ref.h b/2.x/trunk/ProcessHacker/include/ref.h index dd6f3c939..6adac0883 100644 --- a/2.x/trunk/ProcessHacker/include/ref.h +++ b/2.x/trunk/ProcessHacker/include/ref.h @@ -135,10 +135,19 @@ VOID PhDrainAutoPool( /** * Calls PhaDereferenceObject() and returns the given object. * - * \param Object A pointer to an object. + * \param Object A pointer to an object. The value can be + * null; in that case no action is performed. * * \return The value of \a Object. */ -#define PHA_DEREFERENCE(Object) (PhaDereferenceObject(Object), (Object)) +FORCEINLINE PVOID PHA_DEREFERENCE( + __in PVOID Object + ) +{ + if (Object) + PhaDereferenceObject(Object); + + return Object; +} #endif