Using Win32 functions in Visual FoxPro Image Gallery
Virtual Hard Disk (Win7)
AttachVirtualDisk
CreateVirtualDisk
DetachVirtualDisk
OpenVirtualDisk
Code examples:
CreateVirtualDisk
..msdn    Add comment     W32 Constants      Translate this page
Creates a virtual hard disk (VHD) image file, either using default parameters or using an existing virtual disk or physical disk.
Code examples:
Declaration:
DWORD CreateVirtualDisk(
    __in   PVIRTUAL_STORAGE_TYPE VirtualStorageType,
    __in   PCWSTR Path,
    __in   VIRTUAL_DISK_ACCESS_MASK VirtualDiskAccessMask,
    __in   PSECURITY_DESCRIPTOR SecurityDescriptor,
    __in   CREATE_VIRTUAL_DISK_FLAG Flags,
    __in   ULONG ProviderSpecificFlags,
    __in   PCREATE_VIRTUAL_DISK_PARAMETERS Parameters,
    __in   LPOVERLAPPED Overlapped,
    __out  PHANDLE Handle
);
FoxPro declaration:
DECLARE LONG CreateVirtualDisk IN virtdisk;
    STRING @VirtualStorageType,;
    STRING ImageFilePath,;
    INTEGER VirtualDiskAccessMask,;
    INTEGER SecurityDescriptor,;
    INTEGER VirtualDiskFlags,;
    LONG ProviderSpecificFlags,;
    STRING @VirtualDiskParameters,;
    INTEGER Overlapped,;
    INTEGER @Handle
Parameters:
VirtualStorageType [in]
A pointer to a VIRTUAL_STORAGE_TYPE structure that contains the desired disk type and vendor information.

Path [in]
A pointer to a valid string that represents the path to the new virtual disk image file.

VirtualDiskAccessMask [in]
The VIRTUAL_DISK_ACCESS_MASK value to use when opening the newly created virtual disk file.

SecurityDescriptor [in]
An optional pointer to a SECURITY_DESCRIPTOR to apply to the virtual disk image file. If this parameter is NULL, the parent directory"s security descriptor will be used.

Flags [in]
Creation flags, which must be a valid combination of the CREATE_VIRTUAL_DISK_FLAG enumeration.

ProviderSpecificFlags [in]
Flags specific to the type of virtual disk being created. May be zero if none are required.

Parameters [in]
A pointer to a valid CREATE_VIRTUAL_DISK_PARAMETERS structure that contains creation parameter data.

Overlapped [in]
An optional pointer to a valid OVERLAPPED structure if asynchronous operation is desired.

Handle [out]
A pointer to the handle object that represents the newly created virtual disk.
Return value:
If the function succeeds, the return value is ERROR_SUCCESS (0) and the Handle parameter contains a valid pointer to the new virtual disk object.
Usage:
nHandle = 0

nResult = CreateVirtualDisk(;
    @cVirtualStorageType,;
    STRCONV("d:\VDisks\vd002.vhd", 5),;
    VIRTUAL_DISK_ACCESS_ALL,;
    0,;
    CREATE_VIRTUAL_DISK_FLAG_FULL_PHYSICAL_ALLOCATION,;
    0,;
    @cVirtualDiskParameters,;
    0,;
    @nHandle;
    )
My comment:
Quote: SizeOf(CREATE_VIRTUAL_DISK_PARAMETERS) = 44 and I think it should be 48 since the Union is not anonymous...

Structures and unions are subject to alignment considerations...

(CREATE | OPEN) -> ATTACH -> USE -> DETACH

See also: OpenVirtualDisk, AttachVirtualDisk
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2010-11-02 08:21:20
Modified: 2010-11-02 08:52:16
Visited in last 7 days: 72
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.80.140.5)
15 sec.Function: 'GetBestRoute'
28 sec.Function: 'CeRapiFreeBuffer'
Function group: 'Remote Application Programming (RAPI)'
42 sec.
Function group: 'Dynamic-Link Library'
55 sec.
Function group: 'GDI+ ImageAttributes'
1.13 min.Function: 'CeOidGetInfoEx'
Function group: 'Remote Application Programming (RAPI)'
1.38 min.Function: 'CreateWindow'
1.62 min.
Function group: 'GDI+'
1.88 min.Function: 'GetPriorityClass'
Function group: 'Process and Thread'
2.1 min.Function: 'CeEnumDBVolumes'
Function group: 'Remote Application Programming (RAPI)'
2.35 min.Function: 'OpenProcess'
Function group: 'Process and Thread'
Google
Advertise here!