wined3d/glsl: Flush NaN to zero in ftoi.
[wine.git] / dlls / wbemprox / wbemprox_private.h
blob2701c725c8980f6326cf902b2010ac23a641ecae
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/list.h"
22 enum wbm_namespace
24 WBEMPROX_NAMESPACE_CIMV2,
25 WBEMPROX_NAMESPACE_MS_WINDOWS_STORAGE,
26 WBEMPROX_NAMESPACE_WMI,
27 WBEMPROX_NAMESPACE_LAST,
30 extern IClientSecurity client_security;
31 extern struct list *table_list[WBEMPROX_NAMESPACE_LAST];
33 enum param_direction
35 PARAM_OUT = -1,
36 PARAM_INOUT = 0,
37 PARAM_IN = 1
40 #define CIM_TYPE_MASK 0x00000fff
42 #define COL_TYPE_MASK 0x0000ffff
43 #define COL_FLAG_DYNAMIC 0x00010000
44 #define COL_FLAG_KEY 0x00020000
45 #define COL_FLAG_METHOD 0x00040000
47 typedef HRESULT (class_method)(IWbemClassObject *object, IWbemContext *context, IWbemClassObject *in_params,
48 IWbemClassObject **out_params);
50 enum operator
52 OP_EQ = 1,
53 OP_AND = 2,
54 OP_OR = 3,
55 OP_GT = 4,
56 OP_LT = 5,
57 OP_LE = 6,
58 OP_GE = 7,
59 OP_NE = 8,
60 OP_ISNULL = 9,
61 OP_NOTNULL = 10,
62 OP_LIKE = 11,
63 OP_NOT = 12
66 struct expr;
67 struct complex_expr
69 enum operator op;
70 struct expr *left;
71 struct expr *right;
74 enum expr_type
76 EXPR_COMPLEX = 1,
77 EXPR_UNARY = 2,
78 EXPR_PROPVAL = 3,
79 EXPR_SVAL = 4,
80 EXPR_IVAL = 5,
81 EXPR_BVAL = 6
84 struct expr
86 enum expr_type type;
87 union
89 struct complex_expr expr;
90 const struct property *propval;
91 const WCHAR *sval;
92 int ival;
93 } u;
96 struct column
98 const WCHAR *name;
99 UINT type;
102 enum fill_status
104 FILL_STATUS_FAILED = -1,
105 FILL_STATUS_UNFILTERED,
106 FILL_STATUS_FILTERED
109 #define TABLE_FLAG_DYNAMIC 0x00000001
111 struct table
113 const WCHAR *name;
114 UINT num_cols;
115 const struct column *columns;
116 UINT num_rows;
117 UINT num_rows_allocated;
118 BYTE *data;
119 enum fill_status (*fill)(struct table *, const struct expr *cond);
120 UINT flags;
121 struct list entry;
122 LONG refs;
125 struct property
127 const WCHAR *name;
128 const WCHAR *class;
129 const struct property *next;
132 struct array
134 UINT elem_size;
135 UINT count;
136 void *ptr;
139 struct field
141 UINT type;
142 union
144 LONGLONG ival;
145 WCHAR *sval;
146 struct array *aval;
147 } u;
150 struct record
152 UINT count;
153 struct field *fields;
154 struct table *table;
157 struct keyword
159 const WCHAR *name;
160 const WCHAR *value;
161 const struct keyword *next;
164 enum view_type
166 VIEW_TYPE_SELECT,
167 VIEW_TYPE_ASSOCIATORS,
170 struct view
172 enum wbm_namespace ns;
173 enum view_type type;
174 const WCHAR *path; /* ASSOCIATORS OF query */
175 const struct keyword *keywordlist;
176 const struct property *proplist; /* SELECT query */
177 const struct expr *cond;
178 UINT table_count;
179 struct table **table;
180 UINT result_count;
181 UINT *result;
184 struct query
186 LONG refs;
187 enum wbm_namespace ns;
188 struct view *view;
189 struct list mem;
192 struct path
194 WCHAR *class;
195 UINT class_len;
196 WCHAR *filter;
197 UINT filter_len;
200 HRESULT parse_path( const WCHAR *, struct path ** );
201 void free_path( struct path * );
202 WCHAR *query_from_path( const struct path * );
204 struct query *create_query( enum wbm_namespace );
205 void free_query( struct query * );
206 struct query *addref_query( struct query * );
207 void release_query( struct query *query );
208 HRESULT exec_query( enum wbm_namespace, const WCHAR *, IEnumWbemClassObject ** );
209 HRESULT parse_query( enum wbm_namespace, const WCHAR *, struct view **, struct list * );
210 HRESULT create_view( enum view_type, enum wbm_namespace, const WCHAR *, const struct keyword *, const WCHAR *,
211 const struct property *, const struct expr *, struct view ** );
212 void destroy_view( struct view * );
213 HRESULT execute_view( struct view * );
214 struct table *get_view_table( const struct view *, UINT );
215 void init_table_list( void );
216 enum wbm_namespace get_namespace_from_string( const WCHAR *namespace );
217 struct table *grab_table( enum wbm_namespace, const WCHAR * );
218 struct table *addref_table( struct table * );
219 void release_table( struct table * );
220 struct table *create_table( const WCHAR *, UINT, const struct column *, UINT, UINT, BYTE *,
221 enum fill_status (*)(struct table *, const struct expr *) );
222 BOOL add_table( enum wbm_namespace, struct table * );
223 void free_columns( struct column *, UINT );
224 void free_row_values( const struct table *, UINT );
225 void clear_table( struct table * );
226 void free_table( struct table * );
227 UINT get_type_size( CIMTYPE );
228 HRESULT eval_cond( const struct table *, UINT, const struct expr *, LONGLONG *, UINT * );
229 HRESULT get_column_index( const struct table *, const WCHAR *, UINT * );
230 HRESULT get_value( const struct table *, UINT, UINT, LONGLONG * );
231 BSTR get_value_bstr( const struct table *, UINT, UINT );
232 HRESULT set_value( const struct table *, UINT, UINT, LONGLONG, CIMTYPE );
233 BOOL is_method( const struct table *, UINT );
234 HRESULT get_method( const struct table *, const WCHAR *, class_method ** );
235 HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE *, LONG * );
236 HRESULT put_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE );
237 HRESULT to_longlong( VARIANT *, LONGLONG *, CIMTYPE * );
238 SAFEARRAY *to_safearray( const struct array *, CIMTYPE );
239 VARTYPE to_vartype( CIMTYPE );
240 void destroy_array( struct array *, CIMTYPE );
241 BOOL is_result_prop( const struct view *, const WCHAR * );
242 HRESULT get_properties( const struct view *, UINT, LONG, SAFEARRAY ** );
243 HRESULT get_object( enum wbm_namespace ns, const WCHAR *, IWbemClassObject ** );
244 BSTR get_method_name( enum wbm_namespace ns, const WCHAR *, UINT );
245 void set_variant( VARTYPE, LONGLONG, void *, VARIANT * );
246 HRESULT create_signature( enum wbm_namespace ns, const WCHAR *, const WCHAR *, enum param_direction,
247 IWbemClassObject ** );
249 HRESULT WbemLocator_create(LPVOID *, REFIID);
250 HRESULT WbemServices_create(const WCHAR *, IWbemContext *, LPVOID *);
251 HRESULT WbemContext_create(void **, REFIID);
252 HRESULT create_class_object(enum wbm_namespace ns, const WCHAR *, IEnumWbemClassObject *, UINT,
253 struct record *, IWbemClassObject **);
254 HRESULT EnumWbemClassObject_create(struct query *, LPVOID *);
255 HRESULT WbemQualifierSet_create(enum wbm_namespace, const WCHAR *, const WCHAR *, LPVOID *);
257 HRESULT process_get_owner(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
258 HRESULT process_create(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
259 HRESULT reg_create_key(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
260 HRESULT reg_enum_key(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
261 HRESULT reg_enum_values(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
262 HRESULT reg_get_binaryvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
263 HRESULT reg_get_stringvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
264 HRESULT reg_set_stringvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
265 HRESULT reg_set_dwordvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
266 HRESULT reg_delete_key(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
267 HRESULT service_pause_service(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
268 HRESULT service_resume_service(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
269 HRESULT service_start_service(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
270 HRESULT service_stop_service(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
271 HRESULT security_get_sd(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
272 HRESULT security_set_sd(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
273 HRESULT sysrestore_create(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
274 HRESULT sysrestore_disable(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
275 HRESULT sysrestore_enable(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
276 HRESULT sysrestore_get_last_status(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
277 HRESULT sysrestore_restore(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out);
279 static inline WCHAR *heap_strdupAW( const char *src )
281 int len;
282 WCHAR *dst;
283 if (!src) return NULL;
284 len = MultiByteToWideChar( CP_ACP, 0, src, -1, NULL, 0 );
285 if ((dst = malloc( len * sizeof(*dst) ))) MultiByteToWideChar( CP_ACP, 0, src, -1, dst, len );
286 return dst;
289 static inline BOOL is_digit(WCHAR c)
291 return '0' <= c && c <= '9';