+ Reply to Thread
Results 1 to 2 of 2

Thread: Set Active Disk Partition from Managed Code (Or Get EasyBCD's Source)

  1. #1
    Join Date
    Mar 2010
    Posts
    1

    Default Set Active Disk Partition from Managed Code (Or Get EasyBCD's Source)

    This thread may be off topic or outside the scope of this forum.

    I'm writing a larger application that (will) set a particular partition active.
    It needs to generate the contents of a partition table for a disk and then
    set one of them active based on certain criteria. The application is
    written in C#, therefore it's managed code. It does something similar
    to what diskpart.exe does on Windows 7, with a little bit more logic.

    I've been trying to figure out how to get access to this information using
    APIs. It looks like IoReadPartitionInformationEx and IoSetPartitionInformationEx are on right track, but they seem to be a part of Windows Device Framework and NOT accessible via managed code. But EasyBCD seems to implement what I want.

    Can I obtain the EasyBCD source code? Is so, how? What's the license? Is it
    "commercial use" friendly?

    If that's the not kosher, I'm happy to write this myself. Must I really use the
    Win DDK? If so, can I use it from managed code? Is there a tutorial?

    Pl. advise. Thanks.

  2. #2
    Join Date
    Apr 2006
    Location
    Chicago
    Posts
    11,915

     

    Hi carifio, welcome to NeoSmart Technologies.

    EasyBCD is free but closed source. While you are correct and EasyBCD is written in C#, all the lowlevel components that are responsible for disk enumeration, modification, and management are written in C++ with the Windows DDK.

    Freebie tips:
    1. You can accomplish what you need in standard Win32 without the DDK, therefore, you can pull it off via P/Invoke instead of reverting to C++ like we did. Personally, it doesn't make any difference to me whether I'm writing in C++ or C#, so I just took the path of least resistance and wrote C++ libraries and binaries to do all the lowlevel stuff.
    2. You can script diskpart to do what you need, without having to resort any P/Invoke.

    Hope this helps, post back and let me know if you found this of any use and how it goes
    Mahmoud Al-Qudsi, Director



    I'm sorry but I do not accept support requests via IM, email, or personal messages

    Follow us on twitter @neosmart or on Facebook!
    NeoSmart Technologies: EasyBCD:

+ Reply to Thread

Similar Threads

  1. Recovering Inactive XP Partition alongside Active Vista
    By Simple Life in forum EasyBCD Support
    Replies: 6
    Last Post: March 16th, 2010, 08:12 AM
  2. Replies: 2
    Last Post: January 13th, 2010, 04:17 PM
  3. Replies: 0
    Last Post: April 29th, 2009, 02:03 AM
  4. Fake active partition?
    By zwaldowski in forum EasyBCD Support
    Replies: 5
    Last Post: September 29th, 2008, 07:37 PM
  5. (bcdedit/EasyBCD) hide any partition/disk?
    By TwL in forum Windows Support
    Replies: 13
    Last Post: May 30th, 2008, 03:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts