c - Porting Unix to Windows, disks, partitions, EFI labels -
a unix program listing /dev/
, picking out diskx
, diskxsy
entries open , attempt read own "label" from. these disks/partitions not recognised windows, , not mounted. console app, pass paths kernel open (eventually).
so have setup test 5g disk use vm. gpt protected efi labelled disk. on osx see disk1
, disk1s1
, disk1s9
. program needs go through disks , partitions find label, in test case, jackpot disk1s1
.
i can use setupdienumdeviceinterfaces()
, list of \\?\physicaldrivex
. can open (createfile()
) , readfile()
those. on test machine, 2 of these. first 1 boot, second test disk.
i can iterate findfirstvolume()
, , open/read them (although, if delete trailing "\"
?), here 3 "volumes". 2 on first physicaldrive0
, 1 on physicaldrive1
. not seem able call functions read partitions method/path name.
if call ioctl_disk_get_drive_layout_ex
on \\.\physicaldrive1
see 4 partitions, , first partition of type 0xee
. (protected gpt).
what call able read partitions interested in?
should go
\\.\physicaldrivex
paths, sinceioctls
work there, or\\?\volume{}
findfirstvolume()
gets me?i starting think there no convenient device me open, refers single partition? opening
disk1s1
, reading "offset 0". supposed openphysicaldrive1
, , read "offset 0 + partition1.start" ? source examples use"\device\harddisk1\partition0"
promising, not open me.
i'm focused on windows 10x64.
i've started on windows, , still find "\\.\"
"\\?\"
(and on) quite confusing, apologies if got wrong way around.
Comments
Post a Comment