wined3d: Properly compare integers in wined3d_bo_slab_vk_compare().
[wine.git] / dlls / wbemprox / wbemprox_private.h
bloba2bf50716128ad876c6ed3f28d98fd7b9564ea13
1 /*
2 * Copyright 2009 Hans Leidekker for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "wine/debug.h"
20 #include "wine/heap.h"
21 #include "wine/list.h"
23 enum wbm_namespace
25 WBEMPROX_NAMESPACE_CIMV2,
26 WBEMPROX_NAMESPACE_MS_WINDOWS_STORAGE,
27 WBEMPROX_NAMESPACE_WMI,
28 WBEMPROX_NAMESPACE_LAST,
31 extern IClientSecurity client_security DECLSPEC_HIDDEN;
32 extern struct list *table_list[WBEMPROX_NAMESPACE_LAST] DECLSPEC_HIDDEN;
34 enum param_direction
36 PARAM_OUT = -1,
37 PARAM_INOUT = 0,
38 PARAM_IN = 1
41 #define CIM_TYPE_MASK 0x00000fff
43 #define COL_TYPE_MASK 0x0000ffff
44 #define COL_FLAG_DYNAMIC 0x00010000
45 #define COL_FLAG_KEY 0x00020000
46 #define COL_FLAG_METHOD 0x00040000
48 typedef HRESULT (class_method)(IWbemClassObject *object, IWbemContext *context, IWbemClassObject *in_params,
49 IWbemClassObject **out_params);
51 enum operator
53 OP_EQ = 1,
54 OP_AND = 2,
55 OP_OR = 3,
56 OP_GT = 4,
57 OP_LT = 5,
58 OP_LE = 6,
59 OP_GE = 7,
60 OP_NE = 8,
61 OP_ISNULL = 9,
62 OP_NOTNULL = 10,
63 OP_LIKE = 11,
64 OP_NOT = 12
67 struct expr;
68 struct complex_expr
70 enum operator op;
71 struct expr *left;
72 struct expr *right;
75 enum expr_type
77 EXPR_COMPLEX = 1,
78 EXPR_UNARY = 2,
79 EXPR_PROPVAL = 3,
80 EXPR_SVAL = 4,
81 EXPR_IVAL = 5,
82 EXPR_BVAL = 6
85 struct expr
87 enum expr_type type;
88 union
90 struct complex_expr expr;
91 const struct property *propval;
92 const WCHAR *sval;
93 int ival;
94 } u;
97 struct column
99 const WCHAR *name;
100 UINT type;
103 enum fill_status
105 FILL_STATUS_FAILED = -1,
106 FILL_STATUS_UNFILTERED,
107 FILL_STATUS_FILTERED
110 #define TABLE_FLAG_DYNAMIC 0x00000001
112 struct table
114 const WCHAR *name;
115 UINT num_cols;
116 const struct column *columns;
117 UINT num_rows;
118 UINT num_rows_allocated;
119 BYTE *data;
120 enum fill_status (*fill)(struct table *, const struct expr *cond);
121 UINT flags;
122 struct list entry;
123 LONG refs;
126 struct property
128 const WCHAR *name;
129 const WCHAR *class;
130 const struct property *next;
133 struct array
135 UINT elem_size;
136 UINT count;
137 void *ptr;
140 struct field
142 UINT type;
143 union
145 LONGLONG ival;
146 WCHAR *sval;
147 struct array *aval;
148 } u;
151 struct record
153 UINT count;
154 struct field *fields;
155 struct table *table;
158 struct keyword
160 const WCHAR *name;
161 const WCHAR *value;
162 const struct keyword *next;
165 enum view_type
167 VIEW_TYPE_SELECT,
168 VIEW_TYPE_ASSOCIATORS,
171 struct view
173 enum wbm_namespace ns;
174 enum view_type type;
175 const WCHAR *path; /* ASSOCIATORS OF query */
176 const struct keyword *keywordlist;
177 const struct property *proplist; /* SELECT query */
178 const struct expr *cond;
179 UINT table_count;
180 struct table **table;
181 UINT result_count;
182 UINT *result;
185 struct query
187 LONG refs;
188 enum wbm_namespace ns;
189 struct view *view;
190 struct list mem;
193 struct path
195 WCHAR *class;
196 UINT class_len;
197 WCHAR *filter;
198 UINT filter_len;
201 HRESULT parse_path( const WCHAR *, struct path ** ) DECLSPEC_HIDDEN;
202 void free_path( struct path * ) DECLSPEC_HIDDEN;
203 WCHAR *query_from_path( const struct path * ) DECLSPEC_HIDDEN;
205 struct query *create_query( enum wbm_namespace ) DECLSPEC_HIDDEN;
206 void free_query( struct query * ) DECLSPEC_HIDDEN;
207 struct query *addref_query( struct query * ) DECLSPEC_HIDDEN;
208 void release_query( struct query *query ) DECLSPEC_HIDDEN;
209 HRESULT exec_query( enum wbm_namespace, const WCHAR *, IEnumWbemClassObject ** ) DECLSPEC_HIDDEN;
210 HRESULT parse_query( enum wbm_namespace, const WCHAR *, struct view **, struct list * ) DECLSPEC_HIDDEN;
211 HRESULT create_view( enum view_type, enum wbm_namespace, const WCHAR *, const struct keyword *, const WCHAR *,
212 const struct property *, const struct expr *, struct view ** ) DECLSPEC_HIDDEN;
213 void destroy_view( struct view * ) DECLSPEC_HIDDEN;
214 HRESULT execute_view( struct view * ) DECLSPEC_HIDDEN;
215 struct table *get_view_table( const struct view *, UINT ) DECLSPEC_HIDDEN;
216 void init_table_list( void ) DECLSPEC_HIDDEN;
217 enum wbm_namespace get_namespace_from_string( const WCHAR *namespace ) DECLSPEC_HIDDEN;
218 struct table *grab_table( enum wbm_namespace, const WCHAR * ) DECLSPEC_HIDDEN;
219 struct table *addref_table( struct table * ) DECLSPEC_HIDDEN;
220 void release_table( struct table * ) DECLSPEC_HIDDEN;
221 struct table *create_table( const WCHAR *, UINT, const struct column *, UINT, UINT, BYTE *,
222 enum fill_status (*)(struct table *, const struct expr *) ) DECLSPEC_HIDDEN;
223 BOOL add_table( enum wbm_namespace, struct table * ) DECLSPEC_HIDDEN;
224 void free_columns( struct column *, UINT ) DECLSPEC_HIDDEN;
225 void free_row_values( const struct table *, UINT ) DECLSPEC_HIDDEN;
226 void clear_table( struct table * ) DECLSPEC_HIDDEN;
227 void free_table( struct table * ) DECLSPEC_HIDDEN;
228 UINT get_type_size( CIMTYPE ) DECLSPEC_HIDDEN;
229 HRESULT eval_cond( const struct table *, UINT, const struct expr *, LONGLONG *, UINT * ) DECLSPEC_HIDDEN;
230 HRESULT get_column_index( const struct table *, const WCHAR *, UINT * ) DECLSPEC_HIDDEN;
231 HRESULT get_value( const struct table *, UINT, UINT, LONGLONG * ) DECLSPEC_HIDDEN;
232 BSTR get_value_bstr( const struct table *, UINT, UINT ) DECLSPEC_HIDDEN;
233 HRESULT set_value( const struct table *, UINT, UINT, LONGLONG, CIMTYPE ) DECLSPEC_HIDDEN;
234 BOOL is_method( const struct table *, UINT ) DECLSPEC_HIDDEN;
235 HRESULT get_method( const struct table *, const WCHAR *, class_method ** ) DECLSPEC_HIDDEN;
236 HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE *, LONG * ) DECLSPEC_HIDDEN;
237 HRESULT put_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE ) DECLSPEC_HIDDEN;
238 HRESULT to_longlong( VARIANT *, LONGLONG *, CIMTYPE * ) DECLSPEC_HIDDEN;
239 SAFEARRAY *to_safearray( const struct array *, CIMTYPE ) DECLSPEC_HIDDEN;
240 VARTYPE to_vartype( CIMTYPE ) DECLSPEC_HIDDEN;
241 void destroy_array( struct array *, CIMTYPE ) DECLSPEC_HIDDEN;
242 BOOL is_result_prop( const struct view *, const WCHAR * ) DECLSPEC_HIDDEN;
243 HRESULT get_properties( const struct view *, UINT, LONG, SAFEARRAY ** ) DECLSPEC_HIDDEN;
244 HRESULT get_object( enum wbm_namespace ns, const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN;
245 BSTR get_method_name( enum wbm_namespace ns, const WCHAR *, UINT ) DECLSPEC_HIDDEN;
246 void set_variant( VARTYPE, LONGLONG, void *, VARIANT * ) DECLSPEC_HIDDEN;
247 HRESULT create_signature( enum wbm_namespace ns, const WCHAR *, const WCHAR *, enum param_direction,
248 IWbemClassObject ** ) DECLSPEC_HIDDEN;
250 HRESULT WbemLocator_create(LPVOID *) DECLSPEC_HIDDEN;
251 HRESULT WbemServices_create(const WCHAR *, IWbemContext *, LPVOID *) DECLSPEC_HIDDEN;
252 HRESULT WbemContext_create(void **) DECLSPEC_HIDDEN;
253 HRESULT create_class_object(enum wbm_namespace ns, const WCHAR *, IEnumWbemClassObject *, UINT,
254 struct record *, IWbemClassObject **) DECLSPEC_HIDDEN;
255 HRESULT EnumWbemClassObject_create(struct query *, LPVOID *) DECLSPEC_HIDDEN;
256 HRESULT WbemQualifierSet_create(enum wbm_namespace, const WCHAR *, const WCHAR *, LPVOID *) DECLSPEC_HIDDEN;
258 HRESULT process_get_owner(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
259 HRESULT process_create(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
260 HRESULT reg_create_key(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
261 HRESULT reg_enum_key(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
262 HRESULT reg_enum_values(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
263 HRESULT reg_get_stringvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
264 HRESULT reg_set_stringvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
265 HRESULT reg_set_dwordvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
266 HRESULT reg_delete_key(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
267 HRESULT service_pause_service(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
268 HRESULT service_resume_service(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
269 HRESULT service_start_service(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
270 HRESULT service_stop_service(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
271 HRESULT security_get_sd(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
272 HRESULT security_set_sd(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
273 HRESULT sysrestore_create(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
274 HRESULT sysrestore_disable(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
275 HRESULT sysrestore_enable(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
276 HRESULT sysrestore_get_last_status(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
277 HRESULT sysrestore_restore(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
279 static inline WCHAR *heap_strdupW( const WCHAR *src )
281 WCHAR *dst;
282 if (!src) return NULL;
283 if ((dst = heap_alloc( (lstrlenW( src ) + 1) * sizeof(WCHAR) ))) lstrcpyW( dst, src );
284 return dst;
287 static inline WCHAR *heap_strdupAW( const char *src )
289 int len;
290 WCHAR *dst;
291 if (!src) return NULL;
292 len = MultiByteToWideChar( CP_ACP, 0, src, -1, NULL, 0 );
293 if ((dst = heap_alloc( len * sizeof(*dst) ))) MultiByteToWideChar( CP_ACP, 0, src, -1, dst, len );
294 return dst;
297 static inline BOOL is_digit(WCHAR c)
299 return '0' <= c && c <= '9';