Export (0) Print
Expand All
Expand Minimize

MI_Instance_SetElement function

Set the value of the element with the given name in the given instance.

Syntax


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

Parameters

self [out]

A pointer to an instance.

name

A null-terminated string that represents the name of the element that will be set.

value [in, optional]

The new value for the element.

type

The CIM type of the element that will be set.

flags

Bit flags indicating memory management policy.

flagsMeaning
MI_FLAG_BORROW

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

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

Element value is Null.

 

Return value

Return codeDescription
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_TYPE_MISSMATCH

The specified type does not match the type of the existing element

MI_RESULT_NOT_FOUND

Specified element does not exist.

MI_RESULT_FAILED

A failure not covered by other MI_Result error codes.

 

Remarks

By default, all memory referred to by the value parameter is copied. By passing the flag MI_FLAG_BORROW, memory pointers within the value structure are stored directly in the instance's element. The caller must guarantee that the memory outlives the instance.

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

 

 

Show:
© 2014 Microsoft