Name

VixVM_AddSharedFolder

Description

VixHandle
VixVM_AddSharedFolder(VixHandle vmHandle,
                      const char *shareName,
                      const char *hostPathName,
                      VixMsgSharedFolderOptions flags,
                      VixEventProc *callbackProc,
                      void *clientData);

This function mounts a new shared folder in the virtual machine.

Parameters

vmHandle
Identifies a virtual machine. Call VixVM_Open() to create a virtual machine handle.
shareName
Specifies the guest path name of the new shared folder.
hostPathName
Specifies the host path of the shared folder.
flags
The folder options.
callbackProc
A callback function that will be invoked when the operation is complete.
clientData
A parameter that will be passed to the callbackProc function.

Return Value

VixHandle. A job handle that describes the state of this asynchronous operation.

Remarks

Side Effects

None.

Requirements

vix.h, since VMware Workstation 6.0, not available on Server 2.0.

Example

VixHandle jobHandle;
VixError err;

jobHandle = VixVM_AddSharedFolder(vmHandle, 
                                  "WorkDir",
                                  "/work",
                                  VIX_SHAREDFOLDER_WRITE_ACCESS,
                                  NULL, NULL);
err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);
Vix_ReleaseHandle(jobHandle);
if (VIX_OK != err) {
   // handle error
}

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