DismCloseSession function

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

Closes a DISMSession created by DismOpenSession. This function does not unmount the image. To unmount the image, use the DismUnmountImage once all sessions are closed.

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

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.

 

Requirements

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

 

 

Show: