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 (Team)

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 (Team)

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 (Team)

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: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

Topic viewed 7321 times

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




|

Back to top

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

Got it!