Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 3.25 KB

nf-mi-mi_context_getlocalsession.md

File metadata and controls

75 lines (60 loc) · 3.25 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:mi.MI_Context_GetLocalSession
MI_Context_GetLocalSession function (mi.h)
Gets the local session (MI_Session) which allows the provider to perform CIM operations against the local server hosting the provider.
MI_Context_GetLocalSession
MI_Context_GetLocalSession function [Windows Management Infrastructure (MI)]
mi/MI_Context_GetLocalSession
wmi.mi_getlocalsession
wmi_v2.mi_context_getlocalsession
wmi_v2\mi_context_getlocalsession.htm
wmi_v2
275657b1-9e74-456e-9ef9-28b621d27fc7
12/05/2018
MI_Context_GetLocalSession, MI_Context_GetLocalSession function [Windows Management Infrastructure (MI)], mi/MI_Context_GetLocalSession, wmi.mi_getlocalsession, wmi_v2.mi_context_getlocalsession
mi.h
Windows
Windows 8
Windows Server 2012
Windows
Windows Management Framework 3.0 on Windows Server 2008 R2 with SP1, Windows 7 with SP1, and Windows Server 2008 with SP2
19H1
MI_Context_GetLocalSession
mi/MI_Context_GetLocalSession
c++
APIRef
kbSyntax
HeaderDef
Mi.h
MI_Context_GetLocalSession

MI_Context_GetLocalSession function

-description

Gets the local session (MI_Session) which allows the provider to perform CIM operations against the local server hosting the provider.

-parameters

-param context [in]

A pointer to the request context.

-param session [out]

A pointer to the returned MI_Session object. This session must not be closed.

-returns

A value of the MI_Result enumeration that specifies the function return code. This can be one of the following codes.

-remarks

This session is pre-instantiated and has the lifetime of the context from which the session was obtained. The provider must not close this session because its lifetime is bound to the context.

The provider should call this function rather than creating a new session through the MI_Application_NewSession function, because some optimizations may be possible for talking to the CIM server.

The security context used to call the MI_Context_GetLocalSession function should be the same identity used communicate back to the server through the MI_Session_* operation functions. Do not cache these sessions outside the current operation. The provider calls this method multiple times within an operation under different identities, in which case the retrieved session should also be used with the same identity. Any operations on the session should always be the same identity that the user retrieved for the local session, or else the operation could fail with the MI_RESULT_ACCESS_DENIED return code.