ole32: Check buffer bounds when reading storage properties.
[wine.git] / dlls / msi / cond.y
blob1a79de31bf8810fb5bfe20d7cff9f8fcd82d848e
1 %{
3 /*
4 * Implementation of the Microsoft Installer (msi.dll)
6 * Copyright 2003 Mike McCormack for CodeWeavers
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #define COBJMACROS
25 #include <stdarg.h>
26 #include <stdio.h>
27 #include <stdlib.h>
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winuser.h"
32 #include "msi.h"
33 #include "msiquery.h"
34 #include "objbase.h"
35 #include "oleauto.h"
37 #include "msipriv.h"
38 #include "winemsi.h"
39 #include "wine/debug.h"
40 #include "wine/exception.h"
41 #include "wine/list.h"
43 WINE_DEFAULT_DEBUG_CHANNEL(msi);
45 typedef struct tag_yyinput
47 MSIPACKAGE *package;
48 LPCWSTR str;
49 INT n;
50 MSICONDITION result;
51 struct list mem;
52 } COND_input;
54 struct cond_str {
55 LPCWSTR data;
56 INT len;
59 struct value {
60 enum value_type {
61 VALUE_INTEGER,
62 VALUE_LITERAL,
63 VALUE_SYMBOL
64 } type;
65 union {
66 INT integer;
67 WCHAR *string;
68 } u;
71 static LPWSTR COND_GetString( COND_input *info, const struct cond_str *str );
72 static LPWSTR COND_GetLiteral( COND_input *info, const struct cond_str *str );
73 static int cond_lex( void *COND_lval, COND_input *info);
74 static int cond_error( COND_input *info, const char *str);
76 static void *cond_alloc( COND_input *cond, unsigned int sz );
77 static void *cond_track_mem( COND_input *cond, void *ptr, unsigned int sz );
78 static void cond_free( void *ptr );
80 static INT compare_int( INT a, INT operator, INT b );
81 static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert );
83 static BOOL num_from_prop( LPCWSTR p, INT *val )
85 INT ret = 0, sign = 1;
87 if (!p)
88 return FALSE;
89 if (*p == '-')
91 sign = -1;
92 p++;
94 if (!*p)
95 return FALSE;
96 while (*p)
98 if( *p < '0' || *p > '9' )
99 return FALSE;
100 ret = ret*10 + (*p - '0');
101 p++;
103 *val = ret*sign;
104 return TRUE;
107 static void value_free( struct value val )
109 if (val.type != VALUE_INTEGER)
110 cond_free( val.u.string );
115 %lex-param { COND_input *info }
116 %parse-param { COND_input *info }
117 %define api.pure
119 %union
121 struct cond_str str;
122 struct value value;
123 LPWSTR identifier;
124 INT operator;
125 BOOL bool;
128 %token COND_SPACE COND_EOF
129 %token COND_OR COND_AND COND_NOT COND_XOR COND_IMP COND_EQV
130 %token COND_LT COND_GT COND_EQ COND_NE COND_GE COND_LE
131 %token COND_ILT COND_IGT COND_IEQ COND_INE COND_IGE COND_ILE
132 %token COND_LPAR COND_RPAR COND_TILDA COND_SS COND_ISS
133 %token COND_ILHS COND_IRHS COND_LHS COND_RHS
134 %token COND_PERCENT COND_DOLLARS COND_QUESTION COND_AMPER COND_EXCLAM
135 %token <str> COND_IDENT <str> COND_NUMBER <str> COND_LITER
137 %nonassoc COND_ERROR COND_EOF
139 %type <bool> expression boolean_term boolean_factor
140 %type <value> value
141 %type <identifier> identifier
142 %type <operator> operator
146 condition:
147 expression
149 COND_input* cond = (COND_input*) info;
150 cond->result = $1;
152 | /* empty */
154 COND_input* cond = (COND_input*) info;
155 cond->result = MSICONDITION_NONE;
159 expression:
160 boolean_term
162 $$ = $1;
164 | expression COND_OR boolean_term
166 $$ = $1 || $3;
168 | expression COND_IMP boolean_term
170 $$ = !$1 || $3;
172 | expression COND_XOR boolean_term
174 $$ = ( $1 || $3 ) && !( $1 && $3 );
176 | expression COND_EQV boolean_term
178 $$ = ( $1 && $3 ) || ( !$1 && !$3 );
182 boolean_term:
183 boolean_factor
185 $$ = $1;
187 | boolean_term COND_AND boolean_factor
189 $$ = $1 && $3;
193 boolean_factor:
194 COND_NOT boolean_factor
196 $$ = !$2;
198 | value
200 if ($1.type == VALUE_INTEGER)
201 $$ = $1.u.integer ? 1 : 0;
202 else
203 $$ = $1.u.string && $1.u.string[0];
204 value_free( $1 );
206 | value operator value
208 if ($1.type == VALUE_INTEGER && $3.type == VALUE_INTEGER)
210 $$ = compare_int($1.u.integer, $2, $3.u.integer);
212 else if ($1.type != VALUE_INTEGER && $3.type != VALUE_INTEGER)
214 $$ = compare_string($1.u.string, $2, $3.u.string,
215 $1.type == VALUE_SYMBOL || $3.type == VALUE_SYMBOL);
217 else if ($1.type == VALUE_LITERAL || $3.type == VALUE_LITERAL)
219 $$ = ($2 == COND_NE || $2 == COND_INE );
221 else if ($1.type == VALUE_SYMBOL) /* symbol operator integer */
223 int num;
224 if (num_from_prop( $1.u.string, &num ))
225 $$ = compare_int( num, $2, $3.u.integer );
226 else
227 $$ = ($2 == COND_NE || $2 == COND_INE );
229 else /* integer operator symbol */
231 int num;
232 if (num_from_prop( $3.u.string, &num ))
233 $$ = compare_int( $1.u.integer, $2, num );
234 else
235 $$ = ($2 == COND_NE || $2 == COND_INE );
238 value_free( $1 );
239 value_free( $3 );
241 | COND_LPAR expression COND_RPAR
243 $$ = $2;
247 operator:
248 /* common functions */
249 COND_EQ { $$ = COND_EQ; }
250 | COND_NE { $$ = COND_NE; }
251 | COND_LT { $$ = COND_LT; }
252 | COND_GT { $$ = COND_GT; }
253 | COND_LE { $$ = COND_LE; }
254 | COND_GE { $$ = COND_GE; }
255 | COND_SS { $$ = COND_SS; }
256 | COND_IEQ { $$ = COND_IEQ; }
257 | COND_INE { $$ = COND_INE; }
258 | COND_ILT { $$ = COND_ILT; }
259 | COND_IGT { $$ = COND_IGT; }
260 | COND_ILE { $$ = COND_ILE; }
261 | COND_IGE { $$ = COND_IGE; }
262 | COND_ISS { $$ = COND_ISS; }
263 | COND_LHS { $$ = COND_LHS; }
264 | COND_RHS { $$ = COND_RHS; }
265 | COND_ILHS { $$ = COND_ILHS; }
266 | COND_IRHS { $$ = COND_IRHS; }
269 value:
270 identifier
272 COND_input* cond = (COND_input*) info;
273 UINT len;
275 $$.type = VALUE_SYMBOL;
276 $$.u.string = msi_dup_property( cond->package->db, $1 );
277 if ($$.u.string)
279 len = (lstrlenW($$.u.string) + 1) * sizeof (WCHAR);
280 $$.u.string = cond_track_mem( cond, $$.u.string, len );
282 cond_free( $1 );
284 | COND_PERCENT identifier
286 COND_input* cond = (COND_input*) info;
287 UINT len = GetEnvironmentVariableW( $2, NULL, 0 );
288 $$.type = VALUE_SYMBOL;
289 $$.u.string = NULL;
290 if (len++)
292 $$.u.string = cond_alloc( cond, len*sizeof (WCHAR) );
293 if( !$$.u.string )
294 YYABORT;
295 GetEnvironmentVariableW( $2, $$.u.string, len );
297 cond_free( $2 );
299 | COND_LITER
301 COND_input* cond = (COND_input*) info;
302 $$.type = VALUE_LITERAL;
303 $$.u.string = COND_GetLiteral( cond, &$1 );
304 if( !$$.u.string )
305 YYABORT;
307 | COND_NUMBER
309 COND_input* cond = (COND_input*) info;
310 LPWSTR szNum = COND_GetString( cond, &$1 );
311 if( !szNum )
312 YYABORT;
313 $$.type = VALUE_INTEGER;
314 $$.u.integer = wcstol( szNum, NULL, 10 );
315 cond_free( szNum );
317 | COND_DOLLARS identifier
319 COND_input* cond = (COND_input*) info;
320 INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN;
322 if(MSI_GetComponentStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
324 $$.type = VALUE_LITERAL;
325 $$.u.string = NULL;
327 else
329 $$.type = VALUE_INTEGER;
330 $$.u.integer = action;
332 cond_free( $2 );
334 | COND_QUESTION identifier
336 COND_input* cond = (COND_input*) info;
337 INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN;
339 if(MSI_GetComponentStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
341 $$.type = VALUE_LITERAL;
342 $$.u.string = NULL;
344 else
346 $$.type = VALUE_INTEGER;
347 $$.u.integer = install;
349 cond_free( $2 );
351 | COND_AMPER identifier
353 COND_input* cond = (COND_input*) info;
354 INSTALLSTATE install, action;
356 if (MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
358 $$.type = VALUE_LITERAL;
359 $$.u.string = NULL;
361 else
363 $$.type = VALUE_INTEGER;
364 $$.u.integer = action;
366 cond_free( $2 );
368 | COND_EXCLAM identifier
370 COND_input* cond = (COND_input*) info;
371 INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN;
373 if(MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
375 $$.type = VALUE_LITERAL;
376 $$.u.string = NULL;
378 else
380 $$.type = VALUE_INTEGER;
381 $$.u.integer = install;
383 cond_free( $2 );
387 identifier:
388 COND_IDENT
390 COND_input* cond = (COND_input*) info;
391 $$ = COND_GetString( cond, &$1 );
392 if( !$$ )
393 YYABORT;
400 static int COND_IsAlpha( WCHAR x )
402 return( ( ( x >= 'A' ) && ( x <= 'Z' ) ) ||
403 ( ( x >= 'a' ) && ( x <= 'z' ) ) ||
404 ( ( x == '_' ) ) );
407 static int COND_IsNumber( WCHAR x )
409 return( (( x >= '0' ) && ( x <= '9' )) || (x =='-') || (x =='.') );
412 static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub )
414 LPWSTR strlower, sublower, r;
415 strlower = CharLowerW( strdupW( str ) );
416 sublower = CharLowerW( strdupW( sub ) );
417 r = wcsstr( strlower, sublower );
418 if (r)
419 r = (LPWSTR)str + (r - strlower);
420 msi_free( strlower );
421 msi_free( sublower );
422 return r;
425 static BOOL str_is_number( LPCWSTR str )
427 int i;
429 if (!*str)
430 return FALSE;
432 for (i = 0; i < lstrlenW( str ); i++)
433 if (!iswdigit(str[i]))
434 return FALSE;
436 return TRUE;
439 static INT compare_substring( LPCWSTR a, INT operator, LPCWSTR b )
441 int lhs, rhs;
443 /* substring operators return 0 if LHS is missing */
444 if (!a || !*a)
445 return 0;
447 /* substring operators return 1 if RHS is missing */
448 if (!b || !*b)
449 return 1;
451 /* if both strings contain only numbers, use integer comparison */
452 lhs = wcstol(a, NULL, 10);
453 rhs = wcstol(b, NULL, 10);
454 if (str_is_number(a) && str_is_number(b))
455 return compare_int( lhs, operator, rhs );
457 switch (operator)
459 case COND_SS:
460 return wcsstr( a, b ) != 0;
461 case COND_ISS:
462 return strstriW( a, b ) != 0;
463 case COND_LHS:
465 int l = lstrlenW( a );
466 int r = lstrlenW( b );
467 if (r > l) return 0;
468 return !wcsncmp( a, b, r );
470 case COND_RHS:
472 int l = lstrlenW( a );
473 int r = lstrlenW( b );
474 if (r > l) return 0;
475 return !wcsncmp( a + (l - r), b, r );
477 case COND_ILHS:
479 int l = lstrlenW( a );
480 int r = lstrlenW( b );
481 if (r > l) return 0;
482 return !wcsnicmp( a, b, r );
484 case COND_IRHS:
486 int l = lstrlenW( a );
487 int r = lstrlenW( b );
488 if (r > l) return 0;
489 return !wcsnicmp( a + (l - r), b, r );
491 default:
492 ERR("invalid substring operator\n");
493 return 0;
495 return 0;
498 static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert )
500 if (operator >= COND_SS && operator <= COND_RHS)
501 return compare_substring( a, operator, b );
503 /* null and empty string are equivalent */
504 if (!a) a = szEmpty;
505 if (!b) b = szEmpty;
507 if (convert && str_is_number(a) && str_is_number(b))
508 return compare_int( wcstol(a, NULL, 10), operator, wcstol(b, NULL, 10) );
510 /* a or b may be NULL */
511 switch (operator)
513 case COND_LT:
514 return wcscmp( a, b ) < 0;
515 case COND_GT:
516 return wcscmp( a, b ) > 0;
517 case COND_EQ:
518 return wcscmp( a, b ) == 0;
519 case COND_NE:
520 return wcscmp( a, b ) != 0;
521 case COND_GE:
522 return wcscmp( a, b ) >= 0;
523 case COND_LE:
524 return wcscmp( a, b ) <= 0;
525 case COND_ILT:
526 return wcsicmp( a, b ) < 0;
527 case COND_IGT:
528 return wcsicmp( a, b ) > 0;
529 case COND_IEQ:
530 return wcsicmp( a, b ) == 0;
531 case COND_INE:
532 return wcsicmp( a, b ) != 0;
533 case COND_IGE:
534 return wcsicmp( a, b ) >= 0;
535 case COND_ILE:
536 return wcsicmp( a, b ) <= 0;
537 default:
538 ERR("invalid string operator\n");
539 return 0;
541 return 0;
545 static INT compare_int( INT a, INT operator, INT b )
547 switch (operator)
549 case COND_LT:
550 case COND_ILT:
551 return a < b;
552 case COND_GT:
553 case COND_IGT:
554 return a > b;
555 case COND_EQ:
556 case COND_IEQ:
557 return a == b;
558 case COND_NE:
559 case COND_INE:
560 return a != b;
561 case COND_GE:
562 case COND_IGE:
563 return a >= b;
564 case COND_LE:
565 case COND_ILE:
566 return a <= b;
567 case COND_SS:
568 case COND_ISS:
569 return ( a & b ) ? 1 : 0;
570 case COND_RHS:
571 return ( ( a & 0xffff ) == b ) ? 1 : 0;
572 case COND_LHS:
573 return ( ( (a>>16) & 0xffff ) == b ) ? 1 : 0;
574 default:
575 ERR("invalid integer operator\n");
576 return 0;
578 return 0;
582 static int COND_IsIdent( WCHAR x )
584 return( COND_IsAlpha( x ) || COND_IsNumber( x ) || ( x == '_' )
585 || ( x == '#' ) || (x == '.') );
588 static int COND_GetOperator( COND_input *cond )
590 static const struct {
591 const WCHAR str[4];
592 int id;
593 } table[] = {
594 { {'~','<','=',0}, COND_ILE },
595 { {'~','>','<',0}, COND_ISS },
596 { {'~','>','>',0}, COND_IRHS },
597 { {'~','<','>',0}, COND_INE },
598 { {'~','>','=',0}, COND_IGE },
599 { {'~','<','<',0}, COND_ILHS },
600 { {'~','=',0}, COND_IEQ },
601 { {'~','<',0}, COND_ILT },
602 { {'~','>',0}, COND_IGT },
603 { {'>','=',0}, COND_GE },
604 { {'>','<',0}, COND_SS },
605 { {'<','<',0}, COND_LHS },
606 { {'<','>',0}, COND_NE },
607 { {'<','=',0}, COND_LE },
608 { {'>','>',0}, COND_RHS },
609 { {'>',0}, COND_GT },
610 { {'<',0}, COND_LT },
611 { {0}, 0 }
613 LPCWSTR p = &cond->str[cond->n];
614 int i = 0, len;
616 while ( 1 )
618 len = lstrlenW( table[i].str );
619 if ( !len || 0 == wcsncmp( table[i].str, p, len ) )
620 break;
621 i++;
623 cond->n += len;
624 return table[i].id;
627 static int COND_GetOne( struct cond_str *str, COND_input *cond )
629 int rc, len = 1;
630 WCHAR ch;
632 str->data = &cond->str[cond->n];
634 ch = str->data[0];
636 switch( ch )
638 case 0: return 0;
639 case '(': rc = COND_LPAR; break;
640 case ')': rc = COND_RPAR; break;
641 case '&': rc = COND_AMPER; break;
642 case '!': rc = COND_EXCLAM; break;
643 case '$': rc = COND_DOLLARS; break;
644 case '?': rc = COND_QUESTION; break;
645 case '%': rc = COND_PERCENT; break;
646 case ' ': rc = COND_SPACE; break;
647 case '=': rc = COND_EQ; break;
649 case '~':
650 case '<':
651 case '>':
652 rc = COND_GetOperator( cond );
653 if (!rc)
654 rc = COND_ERROR;
655 return rc;
656 default:
657 rc = 0;
660 if ( rc )
662 cond->n += len;
663 return rc;
666 if (ch == '"' )
668 LPCWSTR p = wcschr( str->data + 1, '"' );
669 if (!p) return COND_ERROR;
670 len = p - str->data + 1;
671 rc = COND_LITER;
673 else if( COND_IsAlpha( ch ) )
675 static const WCHAR szNot[] = {'N','O','T',0};
676 static const WCHAR szAnd[] = {'A','N','D',0};
677 static const WCHAR szXor[] = {'X','O','R',0};
678 static const WCHAR szEqv[] = {'E','Q','V',0};
679 static const WCHAR szImp[] = {'I','M','P',0};
680 static const WCHAR szOr[] = {'O','R',0};
682 while( COND_IsIdent( str->data[len] ) )
683 len++;
684 rc = COND_IDENT;
686 if ( len == 3 )
688 if ( !wcsnicmp( str->data, szNot, len ) )
689 rc = COND_NOT;
690 else if( !wcsnicmp( str->data, szAnd, len ) )
691 rc = COND_AND;
692 else if( !wcsnicmp( str->data, szXor, len ) )
693 rc = COND_XOR;
694 else if( !wcsnicmp( str->data, szEqv, len ) )
695 rc = COND_EQV;
696 else if( !wcsnicmp( str->data, szImp, len ) )
697 rc = COND_IMP;
699 else if( (len == 2) && !wcsnicmp( str->data, szOr, len ) )
700 rc = COND_OR;
702 else if( COND_IsNumber( ch ) )
704 while( COND_IsNumber( str->data[len] ) )
705 len++;
706 rc = COND_NUMBER;
708 else
710 ERR("Got unknown character %c(%x)\n",ch,ch);
711 return COND_ERROR;
714 cond->n += len;
715 str->len = len;
717 return rc;
720 static int cond_lex( void *COND_lval, COND_input *cond )
722 int rc;
723 struct cond_str *str = COND_lval;
725 do {
726 rc = COND_GetOne( str, cond );
727 } while (rc == COND_SPACE);
729 return rc;
732 static LPWSTR COND_GetString( COND_input *cond, const struct cond_str *str )
734 LPWSTR ret;
736 ret = cond_alloc( cond, (str->len+1) * sizeof (WCHAR) );
737 if( ret )
739 memcpy( ret, str->data, str->len * sizeof(WCHAR));
740 ret[str->len]=0;
742 TRACE("Got identifier %s\n",debugstr_w(ret));
743 return ret;
746 static LPWSTR COND_GetLiteral( COND_input *cond, const struct cond_str *str )
748 LPWSTR ret;
750 ret = cond_alloc( cond, (str->len-1) * sizeof (WCHAR) );
751 if( ret )
753 memcpy( ret, str->data+1, (str->len-2) * sizeof(WCHAR) );
754 ret[str->len - 2]=0;
756 TRACE("Got literal %s\n",debugstr_w(ret));
757 return ret;
760 static void *cond_alloc( COND_input *cond, unsigned int sz )
762 struct list *mem;
764 mem = msi_alloc( sizeof (struct list) + sz );
765 if( !mem )
766 return NULL;
768 list_add_head( &(cond->mem), mem );
769 return mem + 1;
772 static void *cond_track_mem( COND_input *cond, void *ptr, unsigned int sz )
774 void *new_ptr;
776 if( !ptr )
777 return ptr;
779 new_ptr = cond_alloc( cond, sz );
780 if( !new_ptr )
782 msi_free( ptr );
783 return NULL;
786 memcpy( new_ptr, ptr, sz );
787 msi_free( ptr );
788 return new_ptr;
791 static void cond_free( void *ptr )
793 struct list *mem = (struct list *)ptr - 1;
795 if( ptr )
797 list_remove( mem );
798 msi_free( mem );
802 static int cond_error( COND_input *info, const char *str )
804 TRACE("%s\n", str );
805 return 0;
808 MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *package, LPCWSTR szCondition )
810 COND_input cond;
811 MSICONDITION r;
812 struct list *mem, *safety;
814 TRACE("%s\n", debugstr_w( szCondition ) );
816 if (szCondition == NULL) return MSICONDITION_NONE;
818 cond.package = package;
819 cond.str = szCondition;
820 cond.n = 0;
821 cond.result = MSICONDITION_ERROR;
823 list_init( &cond.mem );
825 if ( !cond_parse( &cond ) )
826 r = cond.result;
827 else
828 r = MSICONDITION_ERROR;
830 LIST_FOR_EACH_SAFE( mem, safety, &cond.mem )
832 /* The tracked memory lives directly after the list struct */
833 void *ptr = mem + 1;
834 if ( r != MSICONDITION_ERROR )
835 WARN( "condition parser failed to free up some memory: %p\n", ptr );
836 cond_free( ptr );
839 TRACE("%i <- %s\n", r, debugstr_w(szCondition));
840 return r;
843 MSICONDITION WINAPI MsiEvaluateConditionW( MSIHANDLE hInstall, LPCWSTR szCondition )
845 MSIPACKAGE *package;
846 UINT ret;
848 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
849 if( !package )
851 MSIHANDLE remote;
853 if (!(remote = msi_get_remote(hInstall)))
854 return MSICONDITION_ERROR;
856 if (!szCondition)
857 return MSICONDITION_NONE;
859 __TRY
861 ret = remote_EvaluateCondition(remote, szCondition);
863 __EXCEPT(rpc_filter)
865 ret = GetExceptionCode();
867 __ENDTRY
869 return ret;
872 ret = MSI_EvaluateConditionW( package, szCondition );
873 msiobj_release( &package->hdr );
874 return ret;
877 MSICONDITION WINAPI MsiEvaluateConditionA( MSIHANDLE hInstall, LPCSTR szCondition )
879 LPWSTR szwCond = NULL;
880 MSICONDITION r;
882 szwCond = strdupAtoW( szCondition );
883 if( szCondition && !szwCond )
884 return MSICONDITION_ERROR;
886 r = MsiEvaluateConditionW( hInstall, szwCond );
887 msi_free( szwCond );
888 return r;