EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Problem open

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#33238
Posted: 05/06/2015 09:46:01
by lim kb (Basic support level)
Joined: 05/06/2015
Posts: 2

running environment : windows7 64bit VS2013

GetDriverStatus return ServiceStatus(dwCurrentState=4)
Open return error
my code
Code
CRawDisk::GetDriverStatus("RawDisk3", (LPBOOL)(&ServiceInstalled), (LPDWORD)(&FileVersionHigh), (LPDWORD)(&FileVersionLow), (LPSERVICE_STATUS)(&ServiceStatus));

HANDLE h = CRawDisk::Open((LPCWSTR)"\\\\.\\PHYSICALDRIVE1", GENERIC_READ | GENERIC_WRITE, license_key);

plz help


#33239
Posted: 05/06/2015 10:12:21
by Volodymyr Zinin (EldoS Corp.)

EDRError has the ErrorCode property which contains the real reason of the problem. But it seems the problem is in the DeviceName parameter of the CRawDisk::Open call. Try the following:
Code
HANDLE h = CRawDisk::Open((LPCWSTR)"\\??\\PHYSICALDRIVE1", GENERIC_READ | GENERIC_WRITE, license_key);

I.e. the name must be in the NT-format (not in the Win32-format).
For information about available storage names during development you can use WinObj from sysinternals.com. Run it elevated and see contents of the "GLOBAL??" folder (another name of this folder is "??").

Thanks.
#33254
Posted: 05/07/2015 10:07:42
by lim kb (Basic support level)
Joined: 05/06/2015
Posts: 2

I'm try change devicename \\??\\PHYSICALDRIVE1 but same result

call
HANDLE h = CreateFile("\\\\.\\PhysicalDrive1", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
is success

help
#33255
Posted: 05/07/2015 10:21:15
by Eugene Mayevski (EldoS Corp.)

Quote
Volodymyr Zinin wrote:
EDRError has the ErrorCode property which contains the real reason of the problem.


what is the value of this property in your case when the error happens?


Sincerely yours
Eugene Mayevski
#33256
Posted: 05/07/2015 10:51:40
by Volodymyr Zinin (EldoS Corp.)

CRawDisk::Open expects an unicode string to be passed. Please try the following:
Code
HANDLE h = CRawDisk::Open((LPCWSTR)L"\\??\\PHYSICALDRIVE1", GENERIC_READ | GENERIC_WRITE, license_key);
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 4916 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!