Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
aca407bf
Commit
aca407bf
authored
May 22, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
May 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Return a status from table fillers and add an optional condition parameter.
parent
8f69a44b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
80 deletions
+100
-80
builtin.c
dlls/wbemprox/builtin.c
+40
-26
query.c
dlls/wbemprox/query.c
+2
-5
table.c
dlls/wbemprox/table.c
+2
-1
wbemprox_private.h
dlls/wbemprox/wbemprox_private.h
+56
-48
No files found.
dlls/wbemprox/builtin.c
View file @
aca407bf
This diff is collapsed.
Click to expand it.
dlls/wbemprox/query.c
View file @
aca407bf
...
...
@@ -114,8 +114,6 @@ static inline BOOL is_strcmp( const struct complex_expr *expr )
(
expr
->
left
->
type
==
EXPR_SVAL
&&
expr
->
right
->
type
==
EXPR_PROPVAL
));
}
static
HRESULT
eval_cond
(
const
struct
table
*
,
UINT
,
const
struct
expr
*
,
LONGLONG
*
);
static
HRESULT
eval_binary
(
const
struct
table
*
table
,
UINT
row
,
const
struct
complex_expr
*
expr
,
LONGLONG
*
val
)
{
...
...
@@ -211,8 +209,7 @@ static HRESULT eval_propval( const struct table *table, UINT row, const struct p
return
get_value
(
table
,
row
,
column
,
val
);
}
static
HRESULT
eval_cond
(
const
struct
table
*
table
,
UINT
row
,
const
struct
expr
*
cond
,
LONGLONG
*
val
)
HRESULT
eval_cond
(
const
struct
table
*
table
,
UINT
row
,
const
struct
expr
*
cond
,
LONGLONG
*
val
)
{
if
(
!
cond
)
{
...
...
@@ -249,7 +246,7 @@ static HRESULT execute_view( struct view *view )
if
(
view
->
table
->
fill
)
{
clear_table
(
view
->
table
);
view
->
table
->
fill
(
view
->
table
);
view
->
table
->
fill
(
view
->
table
,
view
->
cond
);
}
if
(
!
view
->
table
->
num_rows
)
return
S_OK
;
...
...
dlls/wbemprox/table.c
View file @
aca407bf
...
...
@@ -344,7 +344,8 @@ struct table *grab_table( const WCHAR *name )
}
struct
table
*
create_table
(
const
WCHAR
*
name
,
UINT
num_cols
,
const
struct
column
*
columns
,
UINT
num_rows
,
BYTE
*
data
,
void
(
*
fill
)(
struct
table
*
)
)
UINT
num_rows
,
BYTE
*
data
,
enum
fill_status
(
*
fill
)(
struct
table
*
,
const
struct
expr
*
cond
)
)
{
struct
table
*
table
;
...
...
dlls/wbemprox/wbemprox_private.h
View file @
aca407bf
...
...
@@ -41,6 +41,51 @@ enum param_direction
typedef
HRESULT
(
class_method
)(
IWbemClassObject
*
,
IWbemClassObject
*
,
IWbemClassObject
**
);
enum
operator
{
OP_EQ
=
1
,
OP_AND
=
2
,
OP_OR
=
3
,
OP_GT
=
4
,
OP_LT
=
5
,
OP_LE
=
6
,
OP_GE
=
7
,
OP_NE
=
8
,
OP_ISNULL
=
9
,
OP_NOTNULL
=
10
,
OP_LIKE
=
11
};
struct
expr
;
struct
complex_expr
{
enum
operator
op
;
struct
expr
*
left
;
struct
expr
*
right
;
};
enum
expr_type
{
EXPR_COMPLEX
=
1
,
EXPR_UNARY
=
2
,
EXPR_PROPVAL
=
3
,
EXPR_SVAL
=
4
,
EXPR_IVAL
=
5
,
EXPR_BVAL
=
6
};
struct
expr
{
enum
expr_type
type
;
union
{
struct
complex_expr
expr
;
const
struct
property
*
propval
;
const
WCHAR
*
sval
;
int
ival
;
}
u
;
};
struct
column
{
const
WCHAR
*
name
;
...
...
@@ -48,6 +93,13 @@ struct column
VARTYPE
vartype
;
/* 0 for default mapping */
};
enum
fill_status
{
FILL_STATUS_FAILED
=
-
1
,
FILL_STATUS_UNFILTERED
,
FILL_STATUS_FILTERED
};
#define TABLE_FLAG_DYNAMIC 0x00000001
struct
table
...
...
@@ -57,7 +109,7 @@ struct table
const
struct
column
*
columns
;
UINT
num_rows
;
BYTE
*
data
;
void
(
*
fill
)(
struct
table
*
);
enum
fill_status
(
*
fill
)(
struct
table
*
,
const
struct
expr
*
cond
);
UINT
flags
;
struct
list
entry
;
LONG
refs
;
...
...
@@ -95,51 +147,6 @@ struct record
struct
table
*
table
;
};
enum
operator
{
OP_EQ
=
1
,
OP_AND
=
2
,
OP_OR
=
3
,
OP_GT
=
4
,
OP_LT
=
5
,
OP_LE
=
6
,
OP_GE
=
7
,
OP_NE
=
8
,
OP_ISNULL
=
9
,
OP_NOTNULL
=
10
,
OP_LIKE
=
11
};
struct
expr
;
struct
complex_expr
{
enum
operator
op
;
struct
expr
*
left
;
struct
expr
*
right
;
};
enum
expr_type
{
EXPR_COMPLEX
=
1
,
EXPR_UNARY
=
2
,
EXPR_PROPVAL
=
3
,
EXPR_SVAL
=
4
,
EXPR_IVAL
=
5
,
EXPR_BVAL
=
6
};
struct
expr
{
enum
expr_type
type
;
union
{
struct
complex_expr
expr
;
const
struct
property
*
propval
;
const
WCHAR
*
sval
;
int
ival
;
}
u
;
};
struct
view
{
const
struct
property
*
proplist
;
...
...
@@ -167,13 +174,14 @@ void init_table_list( void ) DECLSPEC_HIDDEN;
struct
table
*
grab_table
(
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
struct
table
*
addref_table
(
struct
table
*
)
DECLSPEC_HIDDEN
;
void
release_table
(
struct
table
*
)
DECLSPEC_HIDDEN
;
struct
table
*
create_table
(
const
WCHAR
*
,
UINT
,
const
struct
column
*
,
UINT
,
BYTE
*
,
void
(
*
)(
struct
table
*
)
)
DECLSPEC_HIDDEN
;
struct
table
*
create_table
(
const
WCHAR
*
,
UINT
,
const
struct
column
*
,
UINT
,
BYTE
*
,
enum
fill_status
(
*
)(
struct
table
*
,
const
struct
expr
*
)
)
DECLSPEC_HIDDEN
;
BOOL
add_table
(
struct
table
*
)
DECLSPEC_HIDDEN
;
void
free_columns
(
struct
column
*
,
UINT
)
DECLSPEC_HIDDEN
;
void
clear_table
(
struct
table
*
)
DECLSPEC_HIDDEN
;
void
free_table
(
struct
table
*
)
DECLSPEC_HIDDEN
;
UINT
get_type_size
(
CIMTYPE
)
DECLSPEC_HIDDEN
;
HRESULT
eval_cond
(
const
struct
table
*
,
UINT
,
const
struct
expr
*
,
LONGLONG
*
)
DECLSPEC_HIDDEN
;
HRESULT
get_column_index
(
const
struct
table
*
,
const
WCHAR
*
,
UINT
*
)
DECLSPEC_HIDDEN
;
HRESULT
get_value
(
const
struct
table
*
,
UINT
,
UINT
,
LONGLONG
*
)
DECLSPEC_HIDDEN
;
BSTR
get_value_bstr
(
const
struct
table
*
,
UINT
,
UINT
)
DECLSPEC_HIDDEN
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment