Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeviceName for created storage unit #11

Open
martin-kudlicka opened this issue Apr 3, 2021 · 1 comment
Open

DeviceName for created storage unit #11

martin-kudlicka opened this issue Apr 3, 2021 · 1 comment

Comments

@martin-kudlicka
Copy link

Hello.
This is probably more question than issue.
I created in my project SpdStorageUnit and I can use it after format. I would like to format it myself (in C++) but I can't find any way how to find new disk or volume that was just created by WinSpd. I can enumerate volumes before storage unit is created and again after it's created - new one will be the one I am searching for. I am just looking for proper way using WinSpd API.
I found SpdIoctlGetDevicePath but it doesn't give me correct path, just prefix. I set ClassGuid to SPD_STORAGE_UNIT_PARAMS.Guid and DeviceName to nullptr.
Is there any way how to find \Device\Harddisk... for created Spd storage unit? Thanks.

@martin-kudlicka
Copy link
Author

I solved this (for now) by searching for SPD_STORAGE_UNIT_PARAMS::ProductId in VDS_DISK_PROP::pwszFriendlyName. Then I enumerate all volumes and search for mine by disk number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant