MI_Instance_AddElement function

Adds a new property to a dynamic instance (supported only by dynamic instances whose schema may be extended at run time).

Syntax


 MI_INLINE MI_Result MI_Instance_AddElement(
  _Inout_        MI_Instance          *self,
                 _In_z_ const MI_Char *name,
  _In_opt_ const MI_Value             *value,
                 MI_Type              type,
                 MI_Uint32            flags
);

Parameters

self [in, out]

Instance to which the element will be added.

name

A null-terminated string that represents the name of the new element.

value [in, optional]

Element value.

type

Element type.

flags

Flags of the new element that can be a combination of the following flag values.

MI_FLAG_KEY (0x00001000)

Element is a key.

MI_FLAG_IN (0x00002000)

Parameter is of type In and is passed into a method.

MI_FLAG_OUT (0x00004000)

Parameter is of type Out and is returned from a method.

MI_FLAG_REQUIRED (0x00008000)

Parameter is required.

MI_FLAG_STREAM (0x00100000)

Method parameter will be streamed back to the client from the provider.

MI_FLAG_BORROW (0x4000000)

Used while adding and setting properties on an MI_Instance to indicate that the instance will not copy the value. The value must stay valid until the instance is deleted.

MI_FLAG_ADOPT (0x8000000)

Used while adding and setting properties on an MI_Instance to indicate that the instance will adopt the pointer and will be responsible for deleting it.

MI_FLAG_NULL (0x2000000)

Element value is Null.

MI_FLAG_ANY (0x0000007F)

Bitmask used to filter out other flags.

Return value

MI_RESULT_OK

The operation succeeded.

MI_RESULT_SERVER_LIMITS_EXCEEDED

There is not enough memory to complete the request.

MI_RESULT_INVALID_PARAMETER

One or more parameters passed to the function were not valid.

MI_RESULT_FAILED

A failure not covered by other MI_Result error codes.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Redistributable

Windows Management Framework 3.0 on Windows Server 2008 R2 with SP1, Windows 7 with SP1, and Windows Server 2008 with SP2

Header

Mi.h

See also

MI_Instance_ClearElement
MI_Instance_GetElement
MI_Instance_SetElement

 

 

Show: