adamxp Posted May 19, 2010 Posted May 19, 2010 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
water Posted May 19, 2010 Posted May 19, 2010 This does some partition processing. Maybe a good starting point. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
adamxp Posted May 19, 2010 Author Posted May 19, 2010 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.
water Posted May 19, 2010 Posted May 19, 2010 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: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
adamxp Posted May 19, 2010 Author Posted May 19, 2010 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
water Posted May 20, 2010 Posted May 20, 2010 I've never done this before - I'm just searching the forum. But this thread is reading the MBR. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
adamxp Posted May 20, 2010 Author Posted May 20, 2010 (edited) 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 May 20, 2010 by adamxp
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now