OpenVAS Scanner 23.40.3
wmi_interface_stub.c File Reference

Stub implementation for a wmi interface. More...

#include "openvas_wmi_interface.h"
#include <string.h>
Include dependency graph for wmi_interface_stub.c:

Go to the source code of this file.

Functions

char * wmi_versioninfo ()
 Return version info for WMI implementation.
WMI_HANDLE wmi_connect (int argc, char **argv)
 Establish connection to a WMI service.
int wmi_close (WMI_HANDLE handle)
 Close the connection handle for a WMI service.
int wmi_query (WMI_HANDLE handle, const char *query, char **result)
 Query WMI service using a WQL query.
WMI_HANDLE wmi_connect_rsop (int argc, char **argv)
 Establish connection to a WMI RSOP service.
int wmi_query_rsop (WMI_HANDLE handle, const char *query, char **res)
 WMI RSOP query.
WMI_HANDLE wmi_connect_reg (int argc, char **argv)
 Establish connection to a WMI Registry service.
int wmi_reg_get_sz (WMI_HANDLE handle, unsigned int hive, const char *key, const char *key_name, char **res)
 Get Registry string value.
int wmi_reg_enum_value (WMI_HANDLE handle, unsigned int hive, const char *key, char **res)
 Enumerate Registry values.
int wmi_reg_enum_key (WMI_HANDLE handle, unsigned int hive, const char *key, char **res)
 Enumerate Registry keys.
int wmi_reg_get_bin_val (WMI_HANDLE handle, unsigned int hive, const char *key, const char *val_name, char **res)
 Get Registry binary value.
int wmi_reg_get_dword_val (WMI_HANDLE handle, unsigned int hive, const char *key, const char *val_name, char **res)
 Get Registry DWORD value.
int wmi_reg_get_ex_string_val (WMI_HANDLE handle, unsigned int hive, const char *key, const char *val_name, char **res)
 Get Registry Expanded string value.
int wmi_reg_get_mul_string_val (WMI_HANDLE handle, unsigned int hive, const char *key, const char *val_name, char **res)
 Get Registry multi-valued strings.
int wmi_reg_get_qword_val (WMI_HANDLE handle, unsigned int hive, const char *key, const char *val_name, char **res)
 Get Registry QWORD value.
int wmi_reg_set_dword_val (WMI_HANDLE handle, const char *key, const char *val_name, uint32_t val)
 Set Registry DWORD value.
int wmi_reg_set_qword_val (WMI_HANDLE handle, const char *key, const char *val_name, uint64_t val)
 Set Registry QWORD value.
int wmi_reg_set_ex_string_val (WMI_HANDLE handle, const char *key, const char *val_name, const char *val)
 Set Registry Expanded string value.
int wmi_reg_set_string_val (WMI_HANDLE handle, const char *key, const char *val_name, const char *val)
 Set Registry string value.
int wmi_reg_create_key (WMI_HANDLE handle, const char *key)
 Create Registry Key.
int wmi_reg_delete_key (WMI_HANDLE handle, const char *key)
 Delete Registry Key.

Detailed Description

Stub implementation for a wmi interface.

This file contains an empty implementation that fulfills the wmi interface specfified in openvas_wmi_interface.h

Definition in file wmi_interface_stub.c.

Function Documentation

◆ wmi_close()

int wmi_close ( WMI_HANDLE handle)

Close the connection handle for a WMI service.

Parameters
[in]handle- WMI service connection handle
Returns
, 0 on success, -1 on failure

Definition at line 57 of file wmi_interface_stub.c.

58{
59 (void) handle;
60 return -1;
61}

Referenced by nasl_wmi_close().

Here is the caller graph for this function:

◆ wmi_connect()

WMI_HANDLE wmi_connect ( int argc,
char ** argv )

Establish connection to a WMI service.

Parameters
[in]argcNumber of arguments.
[in]argvArray of arguments.
Returns
, WMI_HANDLE on success, NULL on failure.

Definition at line 42 of file wmi_interface_stub.c.

43{
44 (void) argc;
45 (void) argv;
46 return NULL;
47}

Referenced by nasl_wmi_connect().

Here is the caller graph for this function:

◆ wmi_connect_reg()

WMI_HANDLE wmi_connect_reg ( int argc,
char ** argv )

Establish connection to a WMI Registry service.

Parameters
[in]argcNumber of arguments.
[in]argvArray of arguments.
Returns
, WMI_HANDLE on success, NULL on failure.

Definition at line 130 of file wmi_interface_stub.c.

131{
132 (void) argc;
133 (void) argv;
134 return NULL;
135}

Referenced by nasl_wmi_connect_reg().

Here is the caller graph for this function:

◆ wmi_connect_rsop()

WMI_HANDLE wmi_connect_rsop ( int argc,
char ** argv )

Establish connection to a WMI RSOP service.

Parameters
[in]argcNumber of arguments.
[in]argvArray of arguments.
Returns
, WMI_HANDLE on success, NULL on failure.

Definition at line 93 of file wmi_interface_stub.c.

94{
95 (void) argc;
96 (void) argv;
97 return NULL;
98}

Referenced by nasl_wmi_connect_rsop().

Here is the caller graph for this function:

◆ wmi_query()

int wmi_query ( WMI_HANDLE handle,
const char * query,
char ** result )

Query WMI service using a WQL query.

Parameters
[in]handle- WMI connection handle
[in]query- The WQL query string
[out]result- Result of query as string
Returns
, 0 on success, -1 on failure

Definition at line 75 of file wmi_interface_stub.c.

76{
77 (void) handle;
78 (void) query;
79 (void) result;
80 return -1;
81}

Referenced by nasl_wmi_query().

Here is the caller graph for this function:

◆ wmi_query_rsop()

int wmi_query_rsop ( WMI_HANDLE handle,
const char * query,
char ** res )

WMI RSOP query.

Parameters
[in]handle- WMI connection handle
[in]query- WQL RSOP query
[in]res- Registry value to be queried
Returns
, 0 on success, -1 on failure

Definition at line 112 of file wmi_interface_stub.c.

113{
114 (void) handle;
115 (void) query;
116 (void) res;
117 return -1;
118}

Referenced by nasl_wmi_query_rsop().

Here is the caller graph for this function:

◆ wmi_reg_create_key()

int wmi_reg_create_key ( WMI_HANDLE handle,
const char * key )

Create Registry Key.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key need to be created
Returns
, 0 on success, -1 on failure

Definition at line 448 of file wmi_interface_stub.c.

449{
450 (void) handle;
451 (void) key;
452 return -1;
453}

Referenced by nasl_wmi_reg_create_key().

Here is the caller graph for this function:

◆ wmi_reg_delete_key()

int wmi_reg_delete_key ( WMI_HANDLE handle,
const char * key )

Delete Registry Key.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key need to be Deleted
Returns
, 0 on success, -1 on failure

Definition at line 465 of file wmi_interface_stub.c.

466{
467 (void) handle;
468 (void) key;
469 return -1;
470}

Referenced by nasl_wmi_reg_delete_key().

Here is the caller graph for this function:

◆ wmi_reg_enum_key()

int wmi_reg_enum_key ( WMI_HANDLE handle,
unsigned int hive,
const char * key,
char ** res )

Enumerate Registry keys.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 204 of file wmi_interface_stub.c.

206{
207 (void) handle;
208 (void) hive;
209 (void) key;
210 (void) res;
211 return -1;
212}

Referenced by nasl_wmi_reg_enum_key().

Here is the caller graph for this function:

◆ wmi_reg_enum_value()

int wmi_reg_enum_value ( WMI_HANDLE handle,
unsigned int hive,
const char * key,
char ** res )

Enumerate Registry values.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key name
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 179 of file wmi_interface_stub.c.

181{
182 (void) handle;
183 (void) hive;
184 (void) key;
185 (void) res;
186 return -1;
187}

Referenced by nasl_wmi_reg_enum_value().

Here is the caller graph for this function:

◆ wmi_reg_get_bin_val()

int wmi_reg_get_bin_val ( WMI_HANDLE handle,
unsigned int hive,
const char * key,
const char * val_name,
char ** res )

Get Registry binary value.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key containing the value to be queried
[in]val_name- Registry value to be queried
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 230 of file wmi_interface_stub.c.

232{
233 (void) handle;
234 (void) hive;
235 (void) key;
236 (void) val_name;
237 (void) res;
238 return -1;
239}

Referenced by nasl_wmi_reg_get_bin_val().

Here is the caller graph for this function:

◆ wmi_reg_get_dword_val()

int wmi_reg_get_dword_val ( WMI_HANDLE handle,
unsigned int hive,
const char * key,
const char * val_name,
char ** res )

Get Registry DWORD value.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key containing the value to be queried
[in]val_name- Registry value to be queried
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 257 of file wmi_interface_stub.c.

259{
260 (void) handle;
261 (void) hive;
262 (void) key;
263 (void) val_name;
264 (void) res;
265 return -1;
266}

Referenced by nasl_wmi_reg_get_dword_val().

Here is the caller graph for this function:

◆ wmi_reg_get_ex_string_val()

int wmi_reg_get_ex_string_val ( WMI_HANDLE handle,
unsigned int hive,
const char * key,
const char * val_name,
char ** res )

Get Registry Expanded string value.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key containing the value to be queried
[in]val_name- Registry value to be queried
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 284 of file wmi_interface_stub.c.

286{
287 (void) handle;
288 (void) hive;
289 (void) key;
290 (void) val_name;
291 (void) res;
292 return -1;
293}

Referenced by nasl_wmi_reg_get_ex_string_val().

Here is the caller graph for this function:

◆ wmi_reg_get_mul_string_val()

int wmi_reg_get_mul_string_val ( WMI_HANDLE handle,
unsigned int hive,
const char * key,
const char * val_name,
char ** res )

Get Registry multi-valued strings.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key containing the value to be queried
[in]val_name- Registry value to be queried
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 311 of file wmi_interface_stub.c.

313{
314 (void) handle;
315 (void) hive;
316 (void) key;
317 (void) val_name;
318 (void) res;
319 return -1;
320}

Referenced by nasl_wmi_reg_get_mul_string_val().

Here is the caller graph for this function:

◆ wmi_reg_get_qword_val()

int wmi_reg_get_qword_val ( WMI_HANDLE handle,
unsigned int hive,
const char * key,
const char * val_name,
char ** res )

Get Registry QWORD value.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key containing the value to be queried
[in]val_name- Registry value to be queried
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 338 of file wmi_interface_stub.c.

340{
341 (void) handle;
342 (void) hive;
343 (void) key;
344 (void) val_name;
345 (void) res;
346 return -1;
347}

Referenced by nasl_wmi_reg_get_qword_val().

Here is the caller graph for this function:

◆ wmi_reg_get_sz()

int wmi_reg_get_sz ( WMI_HANDLE handle,
unsigned int hive,
const char * key,
const char * key_name,
char ** res )

Get Registry string value.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry Hive
[in]key- Registry key name
[in]key_name- Registry value name.
[out]res- Result string.
Returns
, 0 on success, -1 on failure

Definition at line 153 of file wmi_interface_stub.c.

155{
156 (void) handle;
157 (void) hive;
158 (void) key;
159 (void) key_name;
160 (void) res;
161 return -1;
162}

Referenced by nasl_wmi_reg_get_sz().

Here is the caller graph for this function:

◆ wmi_reg_set_dword_val()

int wmi_reg_set_dword_val ( WMI_HANDLE handle,
const char * key,
const char * val_name,
uint32_t val )

Set Registry DWORD value.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key containing the value to be set
[in]val_name- Registry value to set
Returns
, 0 on success, -1 on failure

Definition at line 362 of file wmi_interface_stub.c.

364{
365 (void) handle;
366 (void) key;
367 (void) val_name;
368 (void) val;
369 return -1;
370}
const char * val
Definition nasl_init.c:441

References val.

Referenced by nasl_wmi_reg_set_dword_val().

Here is the caller graph for this function:

◆ wmi_reg_set_ex_string_val()

int wmi_reg_set_ex_string_val ( WMI_HANDLE handle,
const char * key,
const char * val_name,
const char * val )

Set Registry Expanded string value.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key containing the value to be set
[in]val_name- Registry value to set
Returns
, 0 on success, -1 on failure

Definition at line 406 of file wmi_interface_stub.c.

408{
409 (void) handle;
410 (void) key;
411 (void) val_name;
412 (void) val;
413 return -1;
414}

References val.

Referenced by nasl_wmi_reg_set_ex_string_val().

Here is the caller graph for this function:

◆ wmi_reg_set_qword_val()

int wmi_reg_set_qword_val ( WMI_HANDLE handle,
const char * key,
const char * val_name,
uint64_t val )

Set Registry QWORD value.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key containing the value to be set
[in]val_name- Registry value to set
Returns
, 0 on success, -1 on failure

Definition at line 384 of file wmi_interface_stub.c.

386{
387 (void) handle;
388 (void) key;
389 (void) val_name;
390 (void) val;
391 return -1;
392}

References val.

Referenced by nasl_wmi_reg_set_qword_val().

Here is the caller graph for this function:

◆ wmi_reg_set_string_val()

int wmi_reg_set_string_val ( WMI_HANDLE handle,
const char * key,
const char * val_name,
const char * val )

Set Registry string value.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key containing the value to be set
[in]val_name- Registry value to set
Returns
, 0 on success, -1 on failure

Definition at line 428 of file wmi_interface_stub.c.

430{
431 (void) handle;
432 (void) key;
433 (void) val_name;
434 (void) val;
435 return -1;
436}

References val.

Referenced by nasl_wmi_reg_set_string_val().

Here is the caller graph for this function:

◆ wmi_versioninfo()

char * wmi_versioninfo ( void )

Return version info for WMI implementation.

Returns
NULL if this the implementation is a non-functional stub, else a arbitrary string that explains the version of the implementation.

Definition at line 27 of file wmi_interface_stub.c.

28{
29 return NULL;
30}

Referenced by nasl_wmi_versioninfo().

Here is the caller graph for this function: