EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Access violation in SSHBBOXCLI.DLL

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.
#357
Posted: 05/31/2006 13:22:09
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

I'm trying to write a test program in MFC using CElSSHClientX. So far I've been able to get as far as receiving the server key, then I get a message box "Access violation at address 011AE8F4 in module 'SSHBBO~1.DLL'. Read of address 20786568".

Can someone suggest how I can debug this problem. Thanks.
#358
Posted: 05/31/2006 14:07:57
by Ken Ivanov (EldoS Corp.)

Unfortunately, we cannot say anything without seeing your code. Would you be so kind to provide us the chunk of your code that deals with SecureBlackbox components? It would be excellent if you also specify the exact line that produces the error.
#359
Posted: 05/31/2006 14:32:30
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

It happens on return from my OnKeyValidate event handler. I just discovered that if I remove this event handler it works fine. This is the handler:

void CMainFrame::OnOnKeyValidateElsshclientx(LPDISPATCH ServerKey, BOOL FAR* Valid)
{
AfxMessageBox("Server key received");
*Valid = TRUE; // TRUE = valid, FALSE = invalid
}
#360
Posted: 05/31/2006 14:43:35
by Ken Ivanov (EldoS Corp.)

Hmm, the same code does work fine for us. Please try to commend out the *Valid = TRUE assignment and check if the error still appears.
#361
Posted: 05/31/2006 14:53:43
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

Yes that appears to fix it! It looks to me like 'Valid' is defined as a USHORT (2 bytes) in the dll. BOOL in MFC is defined as an int (4 bytes). Hence a storage overlay occurs for two bytes following 'Valid'. Is that a correct analysis?
#362
Posted: 05/31/2006 15:08:58
by Ken Ivanov (EldoS Corp.)

Quote
Hence a storage overlay occurs for two bytes following 'Valid'. Is that a correct analysis?

Exactly. It seems that Visual Studio IDE incorrectly generates event handler parameter types for VARIANT_BOOL OLE type. Please replace the line
*Valid = TRUE;
with the following line:
*((VARIANT_BOOL*)Valid) = TRUE;

This should solve the problem.
#363
Posted: 05/31/2006 15:17:32
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

Done! Thanks for the very quick resolution.
#365
Posted: 05/31/2006 16:54:13
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

I am now able to make a connection to the server. Now I want to add a tunnel so I added the ElShellSSHTunnelX ActiveX control to my project and now I'm getting a compiler error:

elsshtunnellistx.cpp
D:\Vcpp32\SSHClientTest\elsshtunnellistx.cpp(34) : error C2440: 'type cast' : cannot convert from 'struct IDispatch *' to 'class CElCustomSSHTunnelX'
No constructor could take the source type, or constructor overload resolution was ambiguous

Have I done something wrong?
#367
Posted: 06/01/2006 03:26:18
by Ken Ivanov (EldoS Corp.)

Unfortunately, this seems to be caused by a bug in the ActiveX Control Import Wizard. Please read the following conversation:

http://www.datadynamics.com/forums/Sh...stID=42130

This conversation also provides a solution for such kind of problems (please see the post of sbogus, 11-26-2003, 4:33 AM).
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

Topic viewed 5646 times

Number of guests: 2, 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!