# Name

VixVM_GetNamedSnapshot

# Description

    VixError
    VixVM_GetNamedSnapshot(VixHandle vmHandle,
                           const char *name,
                           VixHandle *snapshotHandle);

This function returns the handle of the snapshot matching the given name in the virtual machine referenced by vmHandle.

# Parameters

vmHandle
  Identifies a virtual machine. Call VixVM_Open() to create a virtual machine handle.
name
  Identifies a snapshot name.
snapshotHandle
  An output parameter that receives a handle to a snapshot.

# Return Value

VixError.

# Remarks

- This function returns a handle to the snapshot with matching name. When the snapshot name is a duplicate, it returns error 13017 VIX_E_SNAPSHOT_NONUNIQUE_NAME.
- When there are multiple snapshots with the same name, or the same path to that name, you cannot specify a unique name, but you can to use the UI to rename duplicates.
- You can specify the snapshot name as a path using '/' or '\\' as path separators, including snapshots in the tree above the named snapshot, for example 'a/b/c' or 'x/x'. Do not mix '/' and '\\' in the same path expression.
- The snapshotHandle returned by this function is reference counted. The calling application is responsible for releasing the handle.
- This function is not supported when using the VIX_SERVICEPROVIDER_VMWARE_PLAYER host type.

# Side Effects

None.

# Requirements

vix.h, since VMware Workstation 6.0

# Example

    VixHandle snapshotHandle;
    VixError err;

    err = VixVM_GetNamedSnapshot(vmHandle, "snapshot 3",
                                 &snapshotHandle);

    // remove/revert, otherwise use the snapshot

Copyright (C) 2007-2018 VMware, Inc. All rights reserved.