vricosti / libwindevblk Goto Github PK
View Code? Open in Web Editor NEWWindows API to detect and read/write partitions
License: Apache License 2.0
Windows API to detect and read/write partitions
License: Apache License 2.0
Drive 2 (\.\PhysicalDrive2) is a newly initialized disk, which doesn't contain any partition at all, but the test exe reports that disk has 4 partitions.
PS C:\Users\Administrator> get-disk
Number Friendly Name Serial Number HealthStatus OperationalStatus Total Size Partition
Style
------ ------------- ------------- ------------ ----------------- ---------- ----------
0 VBOX HARDDISK VB0fd0b492-e16ac651 Healthy Online 50 GB GPT
1 VBOX HARDDISK VB5d6967dd-87d0fa5b Healthy Online 25 GB RAW
2 VBOX HARDDISK VB4dd4fce2-2c11a706 Healthy Online 15 GB MBR
PS C:\Users\Administrator> get-partition -DiskNumber 2
Get-Partition : No MSFT_Partition objects found with property 'DiskNumber' equal to '2'. Verify the value of the property and retry.
At line:1 char:1
+ get-partition -DiskNumber 2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (2:UInt32) [Get-Partition], CimJobException
+ FullyQualifiedErrorId : CmdletizationQuery_NotFound_DiskNumber,Get-Partition
Drive 0:
SerialNumber: VB0fd0b492-e16ac651
ModelNumber: VBOX HARDDISK
VendorId:
ProductRevision: 1.0
DevicePath: \\?\scsi#disk&ven_vbox&prod_harddisk#4&2617aeae&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
ShortDevicePath: \\.\PhysicalDrive0
canBePartitioned: 1
PartitionStyle: 1
PartitionCount: 4
Gpt.DiskId: {FF508A7C-71A2-4268-9F4C-CEB9AACE6D68}
Gpt.StartingUsableOffset: 17408
Gpt.UsableLength: 53687056896
Gpt.MaxPartitionCount: 128
*Partition 0 (PosixPath = /dev/sda):
PartitionLength: 53687091200
StartingOffset: 0
EndingOffset: 53687091200
szFileSystemName:
szRootPathName:
szVolumeName:
szVolumePathName:
*Partition 1 (PosixPath = /dev/sda1):
PartitionLength: 104857600
StartingOffset: 1048576
EndingOffset: 105906176
Gpt.PartitionType: {C12A7328-F81F-11D2-BA4B-00A0C93EC93B}
Gpt.PartitionId: {D297DA11-75C0-4D9A-A08B-EA426FF98DB1}
szFileSystemName: FAT32
szRootPathName: \\?\Volume{d297da11-75c0-4d9a-a08b-ea426ff98db1}\
szVolumeName:
szVolumePathName:
*Partition 2 (PosixPath = /dev/sda2):
PartitionLength: 16777216
StartingOffset: 105906176
EndingOffset: 122683392
Gpt.PartitionType: {E3C9E316-0B5C-4DB8-817D-F92DF00215AE}
Gpt.PartitionId: {F4E82308-4691-4E74-BE49-44B8205D063B}
szFileSystemName:
szRootPathName:
szVolumeName:
szVolumePathName:
*Partition 3 (PosixPath = /dev/sda3):
PartitionLength: 52963463168
StartingOffset: 122683392
EndingOffset: 53086146560
Gpt.PartitionType: {EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}
Gpt.PartitionId: {B6472378-6D6F-4934-9D97-5796A8B39145}
szFileSystemName: NTFS
szRootPathName: \\?\Volume{b6472378-6d6f-4934-9d97-5796a8b39145}\
szVolumeName:
szVolumePathName: C:\
*Partition 4 (PosixPath = /dev/sda4):
PartitionLength: 598736896
StartingOffset: 53086257152
EndingOffset: 53684994048
Gpt.PartitionType: {DE94BBA4-06D1-4D40-A16A-BFD50179D6AC}
Gpt.PartitionId: {62D027E5-5D0A-4AE1-8797-7254990BC06D}
szFileSystemName: NTFS
szRootPathName: \\?\Volume{62d027e5-5d0a-4ae1-8797-7254990bc06d}\
szVolumeName:
szVolumePathName:
Drive 1:
SerialNumber: VB5d6967dd-87d0fa5b
ModelNumber: VBOX HARDDISK
VendorId:
ProductRevision: 1.0
DevicePath: \\?\scsi#disk&ven_vbox&prod_harddisk#4&2617aeae&0&020000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
ShortDevicePath: \\.\PhysicalDrive1
canBePartitioned: 1
PartitionStyle: 0
PartitionCount: 0
Mbr.CheckSum: 0x0
Mbr.Signature: 0x0
*Partition 0 (PosixPath = /dev/sdb):
PartitionLength: 26843545600
StartingOffset: 0
EndingOffset: 26843545600
szFileSystemName:
szRootPathName:
szVolumeName:
szVolumePathName:
Drive 2:
SerialNumber: VB4dd4fce2-2c11a706
ModelNumber: VBOX HARDDISK
VendorId:
ProductRevision: 1.0
DevicePath: \\?\scsi#disk&ven_vbox&prod_harddisk#4&2617aeae&0&030000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
ShortDevicePath: \\.\PhysicalDrive2
canBePartitioned: 1
PartitionStyle: 0
PartitionCount: 4
Mbr.CheckSum: 0xcdd8e482
Mbr.Signature: 0x87d21b7e
*Partition 0 (PosixPath = /dev/sdc):
PartitionLength: 16106127360
StartingOffset: 0
EndingOffset: 16106127360
szFileSystemName:
szRootPathName:
szVolumeName:
szVolumePathName:
Press a key to exit
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.