Yashied

WinAPIVhd UDF (WinAPIEx UDF Extension)

10 posts in this topic




#2 ·  Posted (edited)

Hi Yashied, nicely done.
 
somehow your examples missing #include <WinAPIVhd.au3>, if running from scite.
But's fine from explorer.
 
You could add support for vhdx, if @OSBuild >= 9200.
Edited by JFX

Share this post


Link to post
Share on other sites

Thank you very much for this great UDF!

I tired it and created a virtual disk

Open: OK
Attach: OK
GUID: {XXXXXXXXXXXXXXXXXXXXXXXXX}
Size: 128 МБ
VHD (.PHYSICALDRIVE1) has been successfully opened and ready for use!

What I can't understand, when I am trying to access it from windows explorer it says : Can't access file because it is busy

How can I make it accessable?

Great thanx in advance!
 

Share this post


Link to post
Share on other sites

Thanks Yashield !

I was working on virtdisk.dll when i fall on your great work.

But something puzzles me, i'm on Win7 and my virtdisk.dll have only 12 functions :

 

AttachVirtualDisk
CompactVirtualDisk
CreateVirtualDisk
DetachVirtualDisk
ExpandVirtualDisk
GetStorageDependencyInformation
GetVirtualDiskInformation
GetVirtualDiskOperationProgress
GetVirtualDiskPhysicalPath
MergeVirtualDisk
OpenVirtualDisk
SetVirtualDiskInformation
 
instead of the 20 of your UDF  :huh2:

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

@topten

I think the reason may be some kind of third-party programs such as antivirus or something like that. Always works fine for me.

@wakillon

Look more carefully at the functions. Some functions (_WinAPI_Create*VirtualDiskParameters*()) is auxiliary and not included in the dll.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

@wakillon

Look more carefully at the functions. Some functions (_WinAPI_Create*VirtualDiskParameters*()) is auxiliary and not included in the dll.

 

AddVirtualDiskParent
BreakMirrorVirtualDisk
DeleteVirtualDiskMetadata
EnumerateVirtualDiskMetadata
GetVirtualDiskMetadata
MirrorVirtualDisk
ResizeVirtualDisk
SetVirtualDiskMetadata
 
This 8 functions names are not auxiliary and are not displayed in "Dll Export Viewer" for my virtdisk.dll.
 
Is there different versions of this dll ?
 
Edit1 : Same result with "DllExportFinder"
 
Edit2 : As i'm under windows 7 family premium, may be it's different on Windows 7 Enterprise and Windows 7 Ultimate.
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

AddVirtualDiskParent

BreakMirrorVirtualDisk

DeleteVirtualDiskMetadata

EnumerateVirtualDiskMetadata

GetVirtualDiskMetadata

MirrorVirtualDisk

ResizeVirtualDisk

SetVirtualDiskMetadata

 

This 8 functions names are not auxiliary and are not displayed in "Dll Export Viewer" for my virtdisk.dll.

These functions require Windows 8 or later.

https://msdn.microsoft.com/en-us/library/windows/desktop/dd323699(v=vs.85).aspx

Share this post


Link to post
Share on other sites

These functions require Windows 8 or later.

 

Yes.

I have just look for a Win7 Ultimate version and it's same result.

Thanks to precise this difference in your first post.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Hi,

i try to play with this udf.

The initialize step should format the virtual drive but it doesn't on my computer (win 7 pro).

I tried to change partition type with $PARTITION_FAT_32 but same result.

I saw some GPT[x] name but ...

The result of initialize is ok but windows ask for formatting, if i accept, windows show an error : he can't format

What must i change to obtain a formated drive by script?

If i open and close one vhd of mine, it's ok.

 

 

 

Edited by kaz

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

after asking google and looking in detail the initialize function i i found something interesting.

Then offset must of one partition is most commun 64 KB (with  sector size 512-byte sectors ) or a multiple of.

So, i modified the line :

DllStructSetData($tPIEX, 'StartingOffset', 0) 

by

DllStructSetData($tPIEX, 'StartingOffset', 64 * 2 *  DllStructGetData($tDG, 'BytesPerSector'))

and the line :

DllStructSetData($tVI, 'StartingOffset', 0)

by

DllStructSetData($tVI, 'StartingOffset', DllStructGetData($tPIEX, 'StartingOffset'))

The script create a valide partition now. When it mounted the first time, windows ask for formatting. No error obtain now.

i didn't find solution to avoid this external step.

 

Edited by kaz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now