Collapse All
Parallels C API Reference Guide
PrlDisk_CreateDisk Function
PrlDisk.h PHT_VIRTUAL_DISK See Also

Creates a new virtual disk.

Syntax
PRL_RESULT PrlDisk_CreateDisk(
    PRL_HANDLE_PTR pHandle, 
    PRL_CONST_STR pDiskName, 
    PRL_CONST_DISK_PARAMETERS_PTR pParams, 
    const PRL_DISK_CALLBACK pCallback, 
    PRL_CONST_VOID_PTR pAdditional
);
File
Parameters

pHandle
[out] A handle of type PHT_VIRTUAL_DISK identifying the new virtual disk. You must always free the handle using the PrlDisk_Free function when the handle is no longer needed. Failure to do so will result in memory leak.
pDiskName
Virtual disk name in UTF-8 format.
pParams
Virtual disk configuration parameters.
pCallback
A pointer to a callback function or NULL pointer. This parameter allows to call the function asynchronously. If this parameter contains a pointer to a user-implemented callback function, the PrlDisk_CreateDisk function will return immediately and the operation will continue in the background thread. The background thread will be calling the callback function passing the operation progress information to it. See PRL_DISK_CALLBACK for more information. Using a callback might be helpful when the disk creation is expected to take a long time. For example, you may want to use a callback when you are creating a large disk and allocating all space for it right away.

If this parameter contains a NULL pointer, the function will be called synchronously.

pAdditional
A pointer to a buffer containing user-defined data to pass to the callback function.
Returns

PRL_RESULT . Possible values:

PRL_ERR_INVALID_ARG - invalid argument values.

PRL_ERR_SUCCESS - function completed successfully.

Remarks

The function creates a new virtual disk and obtains a handle of type PHT_VIRTUAL_DISK identifying the new disk. The handle can then be used to perform other operations on the disk if necessary (see the complete list of PHT_VIRTUAL_DISK functions). To use this function, you must be connected to the Parallels Service. If you are creating a new virtual disk locally, you can use the PrlDisk_CreateDisk_Local function which doesn't require the Parallels Service connection.

See Also
Links
Copyright © 1999-2011 Parallels Holdings, Ltd. and its affiliates. All rights reserved.
What do you think about this topic? Send feedback!