EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TRawDisk.CreateFile() fails on locked file

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
Posted: 03/20/2009 12:12:14
by stephane  (Standard support level)
Joined: 03/17/2009
Posts: 39


I installed the Rawfilter evaluation package [On windows 2008], and got a test key.

I first used InstallDriver() and verify that driver is installed (thats ok).

But when I run this test in my delphi 7 ide (or directly outside IDE even if I do "run as administrator"):

if (h=0) or (h=INVALID_HANDLE_VALUE) then
ShowMessage('Failure !');

and I choose a locked file (I verified outside my app that this file is locked if I try to delete it), the test fails !

Even if I try only GENERIC_READ it fails ... I always obtain INVALID_HANDLE_VALUE for the handle

Am I missing something ?

Posted: 03/20/2009 12:51:19
by Volodymyr Zinin (Team)


Please call the win32 api GetLastError() right after the TRawDisk.CreateFile function failed. What an error does it return?
Also check whether the driver was successfully installed (by calling RawDisk.GetDriverStatus). Thanks.
Posted: 03/20/2009 14:39:46
by stephane  (Standard support level)
Joined: 03/17/2009
Posts: 39

TRawdisk.GetDriverStatus() returns true for "driverinstalled" flag.

Then if I try to open the file with standard CreateFile() I get GetLastError()=32 (ERROR_SHARING_VIOLATION 32 (0x20)).

And then after calling TRawDisk.CreateFile() GetLastError()=0 BUT the THandle is INVALID_HANDLE_VALUE

Concerning the licence key I have made i direct copy/paste so this should be ok, what error should I receive if licence key is invalid ?

Posted: 03/20/2009 14:57:08
by stephane  (Standard support level)
Joined: 03/17/2009
Posts: 39

Sorry I found my mistake !

Forgot the '\??\' before normal filename .... perhaps a special error code could help in this case instead of 0 ;)

Posted: 03/21/2009 05:28:10
by Volodymyr Zinin (Team)

stephane wrote:
perhaps a special error code could help in this case instead of 0 ;)
Thank you. We will check and fix it.
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.



Topic viewed 7532 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!