Jaa


DismCloseSession function

Syntax

HRESULT WINAPI DismCloseSession(
  _In_ DismSession Session
);

Parameters

Session [in]
A valid DismSession. The DismSession must be associated with an image. You can associate a session with an image by using the DismOpenSession.

Return value

Returns S_OK on success.

If the DISMSession is performing operations on other threads, those operations will complete before the DISMSession is destroyed. If additional operations are invoked by other threads after DismCloseSession is called, but before DismCloseSession returns, those operations will fail and return a DISMAPI_E_INVALID_DISM_SESSION error.

Remarks

The DISMSession will be shut down after this call is completed but the image will not be unmounted. To unmount the image, use the DismUnmountImage once all sessions are closed.

Example

HRESULT hr = S_OK;
DismSession session;
hr = DismOpenSession( DISM_ONLINE_IMAGE, NULL, NULL, &session ); hr = DismCloseSession( session );

Requirements

Requirement Description
Supported host platforms DISM API can be used on any operating system supported by the Windows Assessment and Deployment Kit (Windows ADK). For more information, see the Windows ADK Technical Reference.
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Header DismAPI.h
Library DismAPI.lib
DLL DismAPI.dll

See also

DismOpenSession

DISMSession