Hans Leidekker : wbemprox: Add support for negated expressions in WHERE clauses.

Alexandre Julliard julliard at winehq.org
Mon Mar 3 13:20:09 CST 2014


Module: wine
Branch: master
Commit: d0d9b9dcd7fd9bd5114ab8a2f59754caeaa422eb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d0d9b9dcd7fd9bd5114ab8a2f59754caeaa422eb

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Fri Feb 28 11:23:39 2014 +0100

wbemprox: Add support for negated expressions in WHERE clauses.

---

 dlls/wbemprox/query.c            |    9 +++++++++
 dlls/wbemprox/wbemprox_private.h |    3 ++-
 dlls/wbemprox/wql.y              |    6 ++++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c
index 6933da2..921c3cd 100644
--- a/dlls/wbemprox/query.c
+++ b/dlls/wbemprox/query.c
@@ -250,6 +250,15 @@ static HRESULT eval_unary( const struct table *table, UINT row, const struct com
     UINT column;
     LONGLONG lval;
 
+    if (expr->op == OP_NOT)
+    {
+        hr = eval_cond( table, row, expr->left, &lval, type );
+        if (hr != S_OK)
+            return hr;
+        *val = !lval;
+        return S_OK;
+    }
+
     hr = get_column_index( table, expr->left->u.propval->name, &column );
     if (hr != S_OK)
         return hr;
diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h
index 0e39d00..da4f84f 100644
--- a/dlls/wbemprox/wbemprox_private.h
+++ b/dlls/wbemprox/wbemprox_private.h
@@ -53,7 +53,8 @@ enum operator
     OP_NE      = 8,
     OP_ISNULL  = 9,
     OP_NOTNULL = 10,
-    OP_LIKE    = 11
+    OP_LIKE    = 11,
+    OP_NOT     = 12
 };
 
 struct expr;
diff --git a/dlls/wbemprox/wql.y b/dlls/wbemprox/wql.y
index 58663d0..6eabe19 100644
--- a/dlls/wbemprox/wql.y
+++ b/dlls/wbemprox/wql.y
@@ -318,6 +318,12 @@ expr:
             if (!$$)
                 YYABORT;
         }
+  | TK_NOT expr
+        {
+            $$ = expr_unary( ctx, $2, OP_NOT );
+            if (!$$)
+                YYABORT;
+        }
   | prop_val TK_EQ const_val
         {
             $$ = expr_complex( ctx, $1, OP_EQ, $3 );




More information about the wine-cvs mailing list