Jump to content











Photo
* * - - - 1 votes

improving grubinst and grubinst_gui in Windows and Linux


  • Please log in to reply
329 replies to this topic

#26 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 04 January 2015 - 06:31 AM

I was able to download the code from the last link.

Well, just by comparing the original grldrstart.S/grubinst.c 1.2 with the patched ones and modifying grldrstart.S/grubinst.c 1.4 in the same places doesn't seem to work.
When I try to boot I get only an endless loop of Try's:

Clipboard03.png

Here are the patched 1.4 files:
 

Later edit: attachments removed, you can find a better version at the the end of the thread...



#27 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 04 January 2015 - 11:56 AM

The newer version of  grldrstart.S has this

. = _start1 + 0x06 + 2
.byte 0xff /* preferred boot drive number, 0xff for no-drive(i.e., drive not defined) */
.byte 0xff /* preferred partition number, 0xff for whole drive(a floppy that has no partition table) */
. = _start1 + 8 + 2

/* 2 bytes at offset 0x08 will be overwritten for storing the geometry
  * reported by INT 13/AH=8.

so the preferred boot drive and partition were at byte 6 but are now at byte 8  and geometry was stored at 8 but it should now be 8+2

 

Basically I searched for  0x02  0x03 0x04 0x06  0x08 and 0x09  to find what was missed.

 

 

so I found these were missed

3:
popal
cmpl %eax, (%bx)  /* helper loaded? */
jne Error_or_prev_MBR /* Missing helper */
/* Helper is loaded from floppy, so we set floppy as preferred. */
//call set_floppy_preferred
movw $0xff00, 0x06 /* preferred drive=0, partition=0xff */
andb $0xFE, 0x02 /* bit0=0, enable GRLDR search on floppy */
1:

also

movl $0x45435544, %eax
movb %cs:0x02, %al
andb $0x0C, %al
orb $0x40, %al
stosl
popw %es
1:
testb $0x80, %cs:0x02+2 /* boot previous MBR first? */
jnz 2f  /* no, continue to find GRLDR */
call sleep_5_seconds
jnc 3f
/* desired hot-key pressed */
andb $0x7F, %cs:0x02
call boot_prev_mbr //Error_modify
/* floppy search disabled ? */
#if 0
testb $1, 0x02  /* test bit0 of the third byte */
jz 1f   /* zero means floppy search enabled */
/* 0x1fd or below means disable floppy search */
decw (add_sub_si + 5 - _start1)
#else
movb 0x02, %al
andb $0x01, %al
subb %al, (add_sub_si + 5 - _start1)
#endif
2:
//movl -4(%si), %eax
//cmpl $0xfffffe00, %eax /* check the starting CHS */
//jb 1f   /* use normal CHS mode */
pushaw  /* <------ at least DL,SI need to be saved */
cmpw $0xFFFF, 0x08 /* geometry determined? */
jne 3f  /* yes, skip */
movw $0xFE3F, 0x08 /* use a default of H=255, S=63 */
movb %dh, %ch /* DH=Hmax */
movw %cx, 0x08 /* CL=Smax, CH=Hmax */
3:
/******************************************************************/
/* read the boot sectors once again using CHS translated from LBA */
/******************************************************************/
//addl $32, %ebx /* read sector 32 past the boot sector */
movw $0, %bp
movw 0x08, %ax
movw %ax, %dx
1:
movw $0xffff, 0x08
/* return with success */
movw %cs:(Smax_tuned - _start1), %cx
movb %cs:(Hmax_tuned - _start1), %dh
movb %cl, %cs:0x08 /* Smax */
movb %dh, %cs:0x09 /* Hmax */
movb $0, %ah  /* success */
ret
2:

also

movb $15, %cs:0x03  /* reset time out to 15 seconds */
//--------------------------------------------------------------------
/* floppy search disabled ? */
#if 0
testb $1, 0x02  /* test bit0 of the third byte */
jz 1f   /* zero means floppy search enabled */
/* 0x1fd or below means disable floppy search */
decw (add_sub_si + 5 - _start1)
#else
movb 0x02, %al
andb $0x01, %al
subb %al, (add_sub_si + 5 - _start1)
#endif
//--------------------------------------------------------------------
testb $0x08, 0x02 /* chs-no-tune */
jnz 2f
movw $0x3920, %cs:0x04+2 /* reset hot-key to space bar */
movb $15, %cs:0x03  /* reset time out to 15 seconds */
call print_message /* CS:SI points to message string */

New file attached  - NOT TESTED!

Attached Files



#28 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 04 January 2015 - 12:07 PM

Thank you, I will test.


Something else:
Until now I always compiled grub4dos in Linux. But I thought trying MinGW in Windows.
So I used your tutorial, Steve (thank you btw).
But there are a few problems:
"svn checkout http://grub4dos-chen....com/svn/trunk/ grubnew" link doesn't exist.
"./configure --enable-preset-menu=preset_menu.lst" and "make" stop at the same error:

./build
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... (cached) gcc
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking dependency style of gcc... (cached) gcc3
checking for ranlib... ranlib
checking whether optimization for size works... yes
checking whether gcc has -fno-stack-protector... yes
checking whether gcc has -fno-reorder-functions... yes
checking whether -Wundef works... yes
checking whether -falign-loops works... yes
checking whether linker accepts `--build-id=none'... no
checking for objcopy... objcopy
checking if C symbols get an underscore after compilation... yes
checking whether objcopy works for absolute addresses... no
configure: error: GRUB requires a working absolute objcopy; upgrade your binutils
make: *** [build_default] Error 1

With the same binutils I compiled until now grubinst and grubinst_gui.

#29 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 04 January 2015 - 12:41 PM

With your grldrstart.S seems to boot fine.
But it needs more testing...

 

Later edit: attachments removed, you can find a better version at the the end of the thread...



#30 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 04 January 2015 - 04:17 PM

Regarding that grub4dos compiling error: I solved it but now I got another:



....
asm.S:10164: Error: can't resolve `.text' {.text section} - `USB2DRI' {*UND* sec
tion}
asm.S:10197: Error: can't resolve `.text' {.text section} - `USB2DRI' {*UND* sec
tion}
asm.S:10220: Error: can't resolve `.text' {.text section} - `USB2DRI' {*UND* sec
tion}
asm.S:10230: Error: can't resolve `.text' {.text section} - `USB2DRI' {*UND* sec
tion}
asm.S:10241: Error: can't resolve `.text' {.text section} - `USB2DRI' {*UND* sec
tion}
asm.S:10270: Error: can't resolve `.text' {.text section} - `USB2DRI' {*UND* sec
tion}
asm.S:10307: Error: can't resolve `.text' {.text section} - `USB2DRI' {*UND* sec
tion}
asm.S:10309: Error: can't resolve `.text' {.text section} - `USB2DRI' {*UND* sec
tion}
make[2]: *** [pre_stage2_exec-asm.o] Error 1
make[2]: Leaving directory `/home/Administrator/grubnew/stage2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/Administrator/grubnew'
make: *** [all] Error 2

This time Pete's blog couldn't help me..



#31 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 04 January 2015 - 08:48 PM

Later edit: attachments removed, you can find a better version at the the end of the thread...



#32 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 11 January 2015 - 07:52 PM

What's new: just some small improvements.

I know the topic is for Windows version but I think it can be used also for the Linux version.
I started working on it in Lazarus. It's not finished but it can be already used:

snapshot1.png

 

snapshot2.png

 

snapshot3.png

 

 

Later edit: attachments removed, you can find a better version at the the end of the thread...



#33 ambralivio

ambralivio

    Frequent Member

  • Advanced user
  • 195 posts
  •  
    Italy

Posted 11 January 2015 - 10:48 PM

DavidB,

 

Avira Avast 2015 is blocking the Windows binaries.7z download, due to a "suspected" virus (Win32:Evo-gen).   

 

Just FYI.

 

ambralivio



#34 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 12 January 2015 - 12:07 AM

Yes, I knew that before uploading the file here.
It's a false positive.
Freeware AV's like Avast are "famous" for their high rate of false positives. Specifically their engine is designed to "shoot before asking". That's why a "fresh" exe file (like the ones from 7z) is automatically considered dangerous.
If you scan the file at virustotal , only 1/56 says it's infected. And it's not Avast + the name of the virus is "generic", meaning "potential" not "sure" danger.
That's one crappy AV  :rolleyes: 

Here is the scan: https://www.virustot...sis/1421019008/

 

 

Later edit:

Well, since adding the false positive to the AV's database may take a while, I recompiled the binaries and reuploaded the 7zip file. Let's hope it won't be tagged again  :rolleyes:



#35 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 12 January 2015 - 09:25 AM

Another thing:

Everybody knows the grub4dos MBR/grldr patcher for removing the unnecessary grub4dos boot messages, made by Steve.
It's a very good patcher, thank you Steve.
However, there is another way to remove them: to edit the grub4dos sources and deactivate/remove them, then recompile.
It has the advantage of been a little more accurate.
But manually editing the sources every time a new version is released (almost daily) could be not so much "fun", since it's a lot of work.
So I've made a small app to patch them:

 

Before:

before.png

 

After:

after.png

 

Attached File  Grub4DosSourcePatcher binary.7z   176.03KB   552 downloads

Attached File  Grub4DosSourcePatcher sources (Delphi 7).7z   7.86KB   521 downloads

Usage: simply add the grub4dos uncompressed sources in a Sources folder near the exe file and start the app.
It works with untouched grub4dos sources. So far I tested with more than 10 grub4dos source versions and there were no problems.
However, if you try to use it and some of the checkboxes are not enabled or are disabled after checking them, please send me those sources so I can implement their structure into the app.

Right now I'm trying to find a way to patch them so they can detect the --silent-boot option added to the latest grub4dos installer.
But it's not thay easy, since the grub4dos code is so big and so complex.

Any ideas/help would be appreciated.

Regards,
David



#36 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 12 January 2015 - 02:22 PM

Solved a small problem with grubinst command line utility:

Found a way to get the partition filesystem type in Linux:
 

Later edit: attachments removed, you can find a better version at the the end of the thread...



#37 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 13 January 2015 - 02:02 PM

Just like in Windows, grubinst_gui for Linux needs to be started as administrator (root).
As some of you may already know, not many Linux users will accept apps asking for the root password in an app's window  :rolleyes: 
So, now when grubinst_gui is detecting no elevated privileges, is starting the console with "sudo" command asking for the user password instead.

 

 

Later edit: attachments removed, you can find a better version at the the end of the thread...



#38 Zoso

Zoso

    Silver Member

  • Advanced user
  • 640 posts
  •  
    Isle of Man

Posted 13 January 2015 - 09:03 PM

HNY DavidB! great to see you working on this. VMBUSB is onw of my favs still so I cant wait to try this out too.

good work as always! thanks

#39 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 14 January 2015 - 06:16 AM

Thank you, Zoso.

But the credits goes to Bean, TinyBit and Chenall. They did most of the work, I just made some small improvements...



#40 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 14 January 2015 - 06:57 AM

it is possible for add an fs rw for different fs ?

because, if grub on an linuxpartition, maybe manipulating/configuring this include an Grub-Skin ? :)

maybe an Grub-skin editor or something .. if it's possible.. and by the way, DavidB,

like i know, has he written "delete my account" which reason behind was, don't know..

maybe can you write him an mail..

 

best regards

Blacky



#41 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 14 January 2015 - 06:00 PM

In Linux I found a way to retrieve the informations about the partitions on image files too.
Plus, these informations are now exactly in the same format as in Windows.

I think the Linux version is almost finished:

 

 

 

 

Later edit: attachments removed, you can find a better version at the the end of the thread...
 



#42 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 14 January 2015 - 08:07 PM

heey, he's there :) *wave* :) i did really think, you has postet on the DMA ..

 

&& really cool, thank you !

In this way can you managing the Linux grub like the WinNT/Dos Grub2, it's a fine thing !

to have an possible for managing it also in WinNT :))))))))

This goes to an big thing, because the possible for configuring and select at the next boot the next System it's very well, because it's nomore depended on Linux only , with this possible can you tell, boot the next boot in Linux and if be exist linuxbinary for an "Grubb-Manager" in linux also, in deb or rpm (btw, i be in OpenMandriva Linux ;) ) it is possible for hve an starter who can call like grob-manager --next win and this maybe as link in both systems ..

 

and i bet, it's more used as the VM-USB-Boot if this speaks around, use the whole open source world  use your program, i bet ..

maybe it's nit bad to go in https://github.com/and use there the as the "homepage" because in https://github.com/ be the most developers.. where can help you also ..

 

best regards

blacky



#43 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 15 January 2015 - 11:42 AM

These are the final versions:

Attached File  grubinst-1.4 Windows binaries.7z   66.66KB   667 downloads

Attached File  grubinst-1.4 Linux binaries.7z   983.77KB   612 downloads

Attached File  grubinst 1.4 sources.7z   155.44KB   612 downloads

Changes:
1. Solved a bug in grubinst command line utility which did not allow the correct save of the --silent-boot switch in the 5th byte of the grldr.mbr (3rd byte in the unpatched original version).
2. A few small problems solved in grubinst_gui in Windows.
3. grubinst_gui in Linux is with 15 pixels longer, because the partition list combobox was too shorter and the text was sometimes "cut" at the end. The ELF file is now a little smaller. Plus a few other small improvements.

Today I tried to modify the assembler code from grldrstart.S (who generates grldr.mbr) so it could use the --silent-boot switch saved in the 5th byte. The idea was making the code not show the unnecessary messages in the first place instead of replacing the text of the messages with \0\0 (like it does now), which will be a little more professional...
I had a partial success. But there is still much work to be done.

Does anybody have an idea where I can find, in grub4dos sources, the section in which the assembler code from grldr.mbr "communicates" with the code from the grldr file? Or where the grldr file reads the MBR and gets the switches from the 3rd/5th byte?



#44 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 15 January 2015 - 12:31 PM

grldr can be called from Windows BCD or syslinux with no stage 1 loader in MBR or PBR, so I thought it was independent?

What parameters do you think are passed to grldr currently?

 

Maybe you could have a 'silent' parameter in the  internal  menu.lst that is inside the grldr file (can be edited using BootIce easily)?

 

e.g.

write xxx xxxx

or

set gsilent=1

 

or maybe set

debug 0

 

in the pre-config menu, and edit code in grldr so that startup messages are only displayed if debug>0 ?



#45 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 15 January 2015 - 12:59 PM

grldr can be called from Windows BCD or syslinux with no stage 1 loader in MBR or PBR, so I thought it was independent?

 

 

I knew it can be called this way but there is a chance it will "talk" to MBR/PBR when it is loaded by them

 

 

 

What parameters do you think are passed to grldr currently?

 

 

Not sure but could be some of these (the code is from grubinst.c):

 

#define GFG_DISABLE_FLOPPY 1
#define GFG_DISABLE_OSBR 2
#define GFG_DUCE 4
#define CFG_CHS_NO_TUNE 8 /*--chs-no-tune add by chenall* 2008-12-15*/
#define GFG_PREVMBR_LAST 128

 

 

 

Maybe you could have a 'silent' parameter in the  internal  menu.lst that is inside the grldr file (can be edited using BootIce easily)?

 

e.g.

write xxx xxxx

or

set gsilent=1

 

or maybe set

debug 0

 

in the pre-config menu, and edit code in grldr so that startup messages are only displayed if debug>0 ?

 

Good idea, but I was thinking adding both: the --silent-boot as a "general" switch and the command - changing the showing of the messages from the moment it's used.

Each one has its ups and downs, so using both of them will help the user more.



#46 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 15 January 2015 - 08:08 PM

it is possible for "search on the whole installed partitions/harddisk's where be the Grub-installation where managed the boot (?check the mbr for grub-path ?)

-> found -> edit the files and make it possible to change/configuring/reinstalling the grub

(as possibility if you have reinstall the WinNT and have install the grub in Linux(partition))

search&& reinstall/reactivate .. and/or change the Skin.. / install Skin on the grub-folder (ext4/xfs/ntfs and so on)

in both Systems ..

 

an Grub&Grub2 Managing-Gui for install, search and managing the grub in both systems/both partions in ext4/xfs and in ntfs

 

in winnt/dos, if you need an grub or on usb-stick as Systemstarter or grubrestorer for reinstall grub comfortable in WinNT for linux-grub2

 

as suggestion ..

 

best regards

Blacky



#47 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 16 January 2015 - 08:38 AM

it is possible for "search on the whole installed partitions/harddisk's where be the Grub-installation where managed the boot (?check the mbr for grub-path ?)

-> found -> edit the files and make it possible to change/configuring/reinstalling the grub

(as possibility if you have reinstall the WinNT and have install the grub in Linux(partition))

search&& reinstall/reactivate .. and/or change the Skin.. / install Skin on the grub-folder (ext4/xfs/ntfs and so on)

in both Systems ..

 

an Grub&Grub2 Managing-Gui for install, search and managing the grub in both systems/both partions in ext4/xfs and in ntfs

 

in winnt/dos, if you need an grub or on usb-stick as Systemstarter or grubrestorer for reinstall grub comfortable in WinNT for linux-grub2

 

as suggestion ..

 

best regards

Blacky

 

 

That's an interesting suggestion.

Like it says in readme, this utility is used to install GRUB4DOS (not Grub/Grub2) boot code to the MBR or partition
boot sector of hard disk or image file.
Does not copy grldr or g2ldr and, more important, does not search/edit/change the menu configuration files.
Implementing this suggestion will require substantial changes and a lot of work...
If there are others interested too, we could talk about it...



#48 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 16 January 2015 - 08:53 AM

:cheerleader:

 

it would be an profound program, where Linux and Reactos would profit world from it

 

would certainly then be passed around, in the whole world .. :whistling:

 

best regards

Blacky
 



#49 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 16 January 2015 - 12:50 PM

:cheerleader:

 

it would be an profound program, where Linux and Reactos would profit world from it

 

would certainly then be passed around, in the whole world .. :whistling:

 

best regards

Blacky
 

 

Actually I was reffering to the people here on reboot.
I wanna hear their opinions too...



Something else: I noticed a small problem in grubinst_gui for Windows. All disks in the first combobox show too low sizes.
For example my 500 GB internal HDD: the Linux version shows 465 correctly (500 / (3 * 1.024)) while the Windows version shows 417 GB (!).

Bean/TinyBit used this function:



void RefreshDisk(HWND hWnd)
{
  char dn[24] = "\\\\.\\PhysicalDrive/",nn[20];
  int i;

  SendDlgItemMessage(hWnd,IDC_DISKS,CB_RESETCONTENT,0,0);
//  strcpy(dn,"\\\\.\\PhysicalDrive0");
  for (i=0;i<MAX_DISKS;i++)
    {
      HANDLE hd;
      DISK_GEOMETRY ge;
      DWORD rs;
      if (i < 10)
			++dn[17];
		else if (i > 10)
			++dn[18];
		else
			*(unsigned short *)&dn[17]=0x3031;//or use dn[17]='1',dn[18]='0',dn[19]=0;

      hd=CreateFile (dn,GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,OPEN_EXISTING, 0, NULL);
      if (hd==INVALID_HANDLE_VALUE)
        continue;

      if (DeviceIoControl(hd,IOCTL_DISK_GET_DRIVE_GEOMETRY,NULL,0,&ge,sizeof(ge),&rs,NULL))
        {
          DWORD dd,mm;

          dd=ge.TracksPerCylinder*ge.SectorsPerTrack*ge.BytesPerSector;
          mm=dd % 0xFFFFF;
          dd>>=20;
          dd*=ge.Cylinders.LowPart;
          mm*=ge.Cylinders.LowPart;
          dd+=(mm >> 20);
          sprintf(nn,"(hd%d) [%u MB]",i,dd);
        }
      else
        sprintf(nn,"(hd%d)",i);
      SendDlgItemMessage(hWnd,IDC_DISKS,CB_ADDSTRING,0,(LPARAM)&nn);
      CloseHandle(hd);
    }
  if (GetDriveType("A:\\")==DRIVE_REMOVABLE)
    SendDlgItemMessage(hWnd,IDC_DISKS,CB_ADDSTRING,0,(LPARAM)"(fd0)");
  if (GetDriveType("B:\\")==DRIVE_REMOVABLE)
    SendDlgItemMessage(hWnd,IDC_DISKS,CB_ADDSTRING,0,(LPARAM)"(fd1)");
}

In Linux I read the value from the kernel output in /proc.

In VMUB I use this (with correct result):



function GetDriveSize(const Drive: Byte): Int64;
var
   hDrive: THandle;
   dwBytesReturned: DWORD;
   LengthInformation: TGetLengthInformation;
begin
   try
      hDrive := CreateFile(PAnsiChar('\\.\PHYSICALDRIVE' + IntToStr(Drive)), GENERIC_READ,
         FILE_SHARE_READ or FILE_SHARE_WRITE, nil, OPEN_EXISTING, 0, 0);
   except
      hDrive := INVALID_HANDLE_VALUE;
   end;
   if hDrive <> INVALID_HANDLE_VALUE then
   begin
      try
         if DeviceIoControl(hDrive, IOCTL_DISK_GET_LENGTH_INFO, nil, 0, @LengthInformation, SizeOf(TGetLengthInformation), dwBytesReturned, nil) then
            Result := LengthInformation.Length
         else
            Result := -1;
      except
         Result := -1;
      end;
      try
         CloseHandle(hDrive);
      except
      end;
   end
   else
      Result := -1;
end;

Question: is calculating the size from the geometry of the drive preferable to directly reading the size (using IOCTL_DISK_GET_LENGTH_INFO)? Bean/TinyBit must had a reason for using it...



#50 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 17 January 2015 - 02:48 PM

Well, I implemented DeviceIoControl(IOCTL_DISK_GET_LENGTH_INFO) and so far I don't see any problems.
Also, now it shows the drives/partitions size in MB/GB/TB with 3 significant digits.

Clipboard01.png

Clipboard02.png

Now I'm working on displaying also the vendor ID and the model number of the drive in that combobox:

Clipboard03.png

But, as you notice, the text is way too long...
The obvious solution is to add 70..80 pixels to the width of the window. And to make the other editboxes/comboboxes longer (to be symmetrical).
But I'm not sure it will look good...

Does anybody have a better idea?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users