EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Encryption Sample with network file drive

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#24628
Posted: 04/19/2013 06:43:27
by yc wu (Basic support level)
Joined: 04/19/2013
Posts: 6

The Encrypt sample works fine in local drive. But cause file hang in network drive.

What I do is: create a share folder in server (windows server 2008), in pc (win 7), map the share folder to network drive (for example Z:). Then run the Encrypt sample through Visual Studio 2010 (debug mode). create a new file abc.txt in Z: drive. Open the file: write "abc" and save the file. But the file fail to save. found the error is in EncryptContext.Write function:

If (!WriteFile(mHandle.DangerousgetHandle(), mBuffer, ToWrite, out completed, ref Overlapped)) {
Error = Marshal.GetLastWin32Error();
Win32Exception e = new Win32Exception(Error); ...
}

The Error = 31, Win32Exception: A device attached to the system is not functioning. The whole file/folder hang.

try to change pc setting to "disable offline files". repeat the above steps, this time Error = 87, Win32Exception: The parameter is incorrect.
#24629
Posted: 04/19/2013 07:05:29
by Vladimir Cherniga (EldoS Corp.)

Thank you for report. Please specify the version of CallbackFilter used for the tests.
#24636
Posted: 04/21/2013 19:58:40
by yc wu (Basic support level)
Joined: 04/19/2013
Posts: 6

CallbackFilter version: 2.3.57
#24651
Posted: 04/22/2013 11:52:07
by Vladimir Cherniga (EldoS Corp.)

We will check this problem a.s.a.p.
#24670
Posted: 04/24/2013 08:34:16
by Vladimir Cherniga (EldoS Corp.)

It seems that problem in mSectorSize variable that is not properly initialized in EcryptContext constructor. This value cannot be detected with a provided sample. One of the possible workaround for the problem is below:
Code
            ...
   if (mSectorSize == 0)
        mSectorSize = 0x200;
            ...    
#24676
Posted: 04/24/2013 21:32:39
by yc wu (Basic support level)
Joined: 04/19/2013
Posts: 6

The value is set corrected in constructor. Anyway, I add the two line at end of the constructor. Same error: WriteFile return error: 87, invalid parameter. In overlapped structure, IntervalLow = 259 after calling WriteFile, I search from internet, I/O error is: No more data is available. The parameter details: mBuffer: Size: 4, ToWrite: 3.
I also try to change Buffer, and BytesToWrite at the beginning of Write function (I find in local folder, BytesToWrite=4096):
Buffer = new byte[4096];
BytesToWrite = 4096;
Buffer[0] = 98;
Buffer[1] = 98;
Buffer[2] = 98;
for(int k=3;k<4096;k++)
Buffer[k] = 0;
but Same error: WriteFile return error 87, invalid parameter, Overlapped structure, IntervalLow = 259.

FYI, my computer is windows 7 32 bit, server use windows 2008 64 bit
#24768
Posted: 05/01/2013 20:07:40
by yc wu (Basic support level)
Joined: 04/19/2013
Posts: 6

Any updates on this? Can you duplicate the error?
#24863
Posted: 05/06/2013 08:37:42
by Vladimir Cherniga (EldoS Corp.)

Sorry for the delayed request. The problem is reproducible, we will add a workaround for the problem to the next build.
#25159
Posted: 06/03/2013 04:12:44
by yc wu (Basic support level)
Joined: 04/19/2013
Posts: 6

Just to check: if the new version 2.3.58 has fixed this issue? If not, can I know what is the schedule for next rebuild? Thanks!
#25165
Posted: 06/03/2013 08:08:56
by Vladimir Cherniga (EldoS Corp.)

Quote
Just to check: if the new version 2.3.58 has fixed this issue? If not, can I know what is the schedule for next rebuild? Thanks!

It was made some changes from the version 2.3.57 in order to make network disks working with encrypt sample. You'd better check this by own, some redirectors may not work with CallbackFilter.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

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