Jump to content

Recommended Posts

Posted

Need some help importing the Dllcalls to get the partition type and set the partition type. I already have a function to get the correct volume ID that requires the change, but need an example how how to use the deviceiocontrol.

IOCTL_DISK_GET_PARTITION_INFO_EX

http://msdn.microsoft.com/en-us/library/aa365180(v=VS.85).aspx

IOCTL_DISK_SET_PARTITION_INFO_EX

http://msdn.microsoft.com/en-us/library/aa365191(v=VS.85).aspx

Posted
This does some partition processing. Maybe a good starting point.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

  On 5/19/2010 at 2:34 PM, 'water said:

This does some partition processing. Maybe a good starting point.

Thanks water, I did check out that project already but the project is abandoned?? (no update since 07) and no longer works. Also the XP (vista/server 08/Windows 7 do) version of diskpart does not have the set id command required to change the partition type.

Posted

Another thing to try is the WinAPIEx UDF. It contains some _WinAPI_GetDrive* functions that - at least - show how to call the DeviceIoControl API.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

I found the post below:

http://www.autoitscript.com/forum/index.php?showtopic=105701

But the code does not appear to return the mbr data even when $tpix is change to point to the MBR dll structure constaint.

code modified:

Local $tPIX = DllStructCreate($tagPARTITION_INFORMATION_EX_MBR)

ConsoleWrite(@TAB & "PartitionType: " & DllStructGetData($tPIX, "PartitionType") & @CRLF)

returns zero each time

Posted

I've never done this before - I'm just searching the forum. But this thread is reading the MBR.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)

  On 5/20/2010 at 5:46 AM, 'water said:

I've never done this before - I'm just searching the forum. But this thread is reading the MBR.

Got the code working by making these changes:

Local Const $tagPARTITION_INFORMATION_MBR = "uint PartitionType;ubyte BootIndicator;ubyte RecognizedPartition;uint HiddenSectors;"

ConsoleWrite(@TAB & "PartitionType: " & "0x" & Hex(DllStructGetData($tPIX, "PartitionType"),2) & @CRLF)

Thanks for the help

Edited by adamxp

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...