ExylonFiber
Well-Known Member
- Joined
- Apr 25, 2020
- Messages
- 26
- Thread Author
-
- #1
I cannot open a handle to any of my storage devices.
I also tried copying the full path from WinObj: \GLOBAL??\PhysicalDrive0 and \\.\PhysicalDisk0 and \\\\?\\PhysicalDisk0
I also tried all CreateFile Variants (CreateFile, CreateFileA, CreateFileW)
What the heck is going on with it here?
Does it have to be a Kernel Mode Driver project in Visual Studio? CPP or C?
Any help would be much appreciated as I have read the documentation and answers on forums very carefully to be sure I am doing this right.
Thank you,
ExylonFiber (Xylianth)
Code:
HANDLE h = CreateFile(L"\\\\.\\PhysicalDisk0", GENERIC_READ | GENERIC_WRITE, FILE_READ_ACCESS | FILE_WRITE_ACCESS,
0, OPEN_EXISTING, 0, 0);
I also tried copying the full path from WinObj: \GLOBAL??\PhysicalDrive0 and \\.\PhysicalDisk0 and \\\\?\\PhysicalDisk0
I also tried all CreateFile Variants (CreateFile, CreateFileA, CreateFileW)
What the heck is going on with it here?
Does it have to be a Kernel Mode Driver project in Visual Studio? CPP or C?
Any help would be much appreciated as I have read the documentation and answers on forums very carefully to be sure I am doing this right.
Thank you,
ExylonFiber (Xylianth)
Solution
I found the solution to my problem:
I found my program in my filesystem (C:\Users\<username>\source\repos\<projectname>\x64\Debug) and right clicked on the program and in compatibility settings set it to run as administrator. Started Visual Studio up and voila! I now have a valid handle to my storage device!
I found my program in my filesystem (C:\Users\<username>\source\repos\<projectname>\x64\Debug) and right clicked on the program and in compatibility settings set it to run as administrator. Started Visual Studio up and voila! I now have a valid handle to my storage device!
- Joined
- Jul 4, 2015
- Messages
- 8,998
Should not need to be a kernel mode driver. Most common issues are documented here.
CreateFileA function (fileapi.h) - Win32 apps or createfilew
CreateFileA function (fileapi.h) - Win32 apps or createfilew
ExylonFiber
Well-Known Member
- Joined
- Apr 25, 2020
- Messages
- 26
- Thread Author
-
- #3
I'm afraid, as you said previously, the malware I'm infected with may be blocking requests to make a handle to the drive.Should not need to be a kernel mode driver. Most common issues are documented here.
CreateFileA function (fileapi.h) - Win32 apps or createfilew
ExylonFiber
Well-Known Member
- Joined
- Apr 25, 2020
- Messages
- 26
- Thread Author
-
- #4
I found the solution to my problem:
I found my program in my filesystem (C:\Users\<username>\source\repos\<projectname>\x64\Debug) and right clicked on the program and in compatibility settings set it to run as administrator. Started Visual Studio up and voila! I now have a valid handle to my storage device!
I found my program in my filesystem (C:\Users\<username>\source\repos\<projectname>\x64\Debug) and right clicked on the program and in compatibility settings set it to run as administrator. Started Visual Studio up and voila! I now have a valid handle to my storage device!
ExylonFiber
Well-Known Member
- Joined
- Apr 25, 2020
- Messages
- 26
- Thread Author
-
- #5
I found the solution to my problem:Should not need to be a kernel mode driver. Most common issues are documented here.
CreateFileA function (fileapi.h) - Win32 apps or createfilew
I found my program in my filesystem (C:\Users\<username>\source\repos\<projectname>\x64\Debug) and right clicked on the program and in compatibility settings set it to run as administrator. Started Visual Studio up and voila! I now have a valid handle to my storage device!
Similar threads
- Solved
- Replies
- 1
- Views
- 9K