EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Problems with the "MountMedia() function

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#7773
Posted: 10/01/2008 10:13:06
by Lydia Vogel (Basic support level)
Joined: 10/01/2008
Posts: 4

Hey all,

this is my first time using Eldos' "Callback File System" and I hope, one of you can help me:

I'm using software version 2.0.39, released on 09/19/2008.
Furthermore I'm working with Visual Studio 2005, using the CPP Samples of ELDOS.


In order to get to know the "Mapper" samples, I tried to change them slightly. I didn't want to use the GUI, so due to this fact, I altered the WinMain - function like that:

Code
int APIENTRY WinMain(...){
  OnCallbackFsInstall();
  OnCallbackFsCreateStorage();
  OnCallbackAddPoint();
  OnCallbackFsMount();
return 0; }


All required user inputs I handled like this, e.g.
Code
TCHAR g_RootPath[_MAX_PATH];
wcscpy(g_RootPath,_T("C:\\1"));


Everything works fine until reaching
Code
g_CbFs.MountMedia(0)


Then, an unhandled axception( access violation writing) in fputwc.c occurs.
What am I doing wrong? I really don't know how to deal with this problem.
Please let me know, If you do need more code examples.

Thank you very much for your help!

Lydia





#7774
Posted: 10/01/2008 11:51:29
by Vladimir Cherniga (EldoS Corp.)

Hi,
as i see your WinMain() entry just return after 4 calls to the some functions. After that the application will be completed. If you don't want to use the GUI you could omit only the code that refferes to the dialog window creation in InitInstance() function.
#7777
Posted: 10/02/2008 03:23:48
by Lydia Vogel (Basic support level)
Joined: 10/01/2008
Posts: 4

Hi,

thank you for your quick answer.
Unfortunately, omitting only the code that reffers to the dialog window in
Code
InitInstance();
didn't work!

I'm still getting the same mistanke in
Code
fputwc.c


It is:

Code
        /* binary (Unicode) mode */
        if ( (str->_cnt -= sizeof(wchar_t)) >= 0 )
                return (wint_t) (0xffff & (*((wchar_t *)(str->_ptr))++ = (wchar_t)ch));
        else
                return (wint_t) _flswbuf(ch, str);
}


This is exactely, where the debugger stops!

So, what's the reason for it and how can I solve the problem?

Thank you very much again for your help!!
#7778
Posted: 10/02/2008 03:24:20
by Lydia Vogel (Basic support level)
Joined: 10/01/2008
Posts: 4

Quote
Lydia Vogel wrote:
Hi,

thank you for your quick answer.
Unfortunately, omitting only the code that reffers to the dialog window in
Code
InitInstance();
didn't work!

I'm still getting the same mistanke in
Code
fputwc.c


It is:

Code
        /* binary (Unicode) mode */
        if ( (str->_cnt -= sizeof(wchar_t)) >= 0 )
                return (wint_t) (0xffff & (*((wchar_t *)(str->_ptr))++ = (wchar_t)ch));
        else
                return (wint_t) _flswbuf(ch, str);
}


This is exactely, where the debugger stops!

So, what's the reason for it and how can I solve the problem?

Thank you very much again for your help!!
#7781
Posted: 10/02/2008 09:52:37
by Volodymyr Zinin (EldoS Corp.)

Hello,

I'll check it up and answer you a little later.
#7798
Posted: 10/03/2008 06:23:13
by Volodymyr Zinin (EldoS Corp.)

There is a small bug in our code and it'll be fixed in the next build. But the main reason of the problem is that the callback functions are not initialized by your code. The "Mapper" sample does it in the OnCallbackFsInitDialog function which is called when the main dialog window is being created.
And as Vladimir said above it's necessary to prevent WinMain from terminating.

Below is the callback functions initialization code (from the CPP "Mapper" sample):
g_CbFs.SetOnMount(CbFsMount);
g_CbFs.SetOnUnmount(CbFsUnmount);
g_CbFs.SetOnGetVolumeSize(CbFsGetVolumeSize);
g_CbFs.SetOnGetVolumeLabel(CbFsGetVolumeLabel);
g_CbFs.SetOnSetVolumeLabel(CbFsSetVolumeLabel);
g_CbFs.SetOnGetVolumeId(CbFsGetVolumeId);
g_CbFs.SetOnOpenVolume(CbFsOpenVolume);
g_CbFs.SetOnCloseVolume(CbFsCloseVolume);
g_CbFs.SetOnCreateFile(CbFsCreateFile);
g_CbFs.SetOnOpenFile(CbFsOpenFile);
g_CbFs.SetOnCloseFile(CbFsCloseFile);
g_CbFs.SetOnGetFileInfo(CbFsGetFileInfo);
g_CbFs.SetOnEnumerateDirectory(CbFsEnumerateDirectory);
g_CbFs.SetOnCloseEnumeration(CbFsCloseEnumeration);
g_CbFs.SetOnSetAllocationSize(CbFsSetAllocationSize);
g_CbFs.SetOnSetEndOfFile(CbFsSetEndOfFile);
g_CbFs.SetOnSetFileAttributes(CbFsSetFileAttributes);
g_CbFs.SetOnCanFileBeDeleted(CbFsCanFileBeDeleted);
g_CbFs.SetOnDeleteFile(CbFsDeleteFile);
g_CbFs.SetOnRenameOrMoveFile(CbFsRenameOrMoveFile);
g_CbFs.SetOnReadFile(CbFsReadFile);
g_CbFs.SetOnWriteFile(CbFsWriteFile);
g_CbFs.SetOnIsDirectoryEmpty(CbFsIsDirectoryEmpty);
g_CbFs.SetOnEnumerateNamedStreams(CbFsEnumerateNamedStreams);
#7838
Posted: 10/10/2008 08:40:55
by Lydia Vogel (Basic support level)
Joined: 10/01/2008
Posts: 4

Hi,

I know, it's a bit late, but, both of you, thank you for your help!
I really forgot to initialize the callback functions.

Thanks again, Lydia

#7839
Posted: 10/10/2008 09:08:20
by Volodymyr Zinin (EldoS Corp.)

No problem :)
If you have any questions, please don't hesitate to contact.
Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.

Reply

Statistics

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