VB6: Capicom crash on WinXP

Any suggestions for clearing up this glitch?

Below code breaks with error between logging <part>14

and logging <part>15

. Plaintext

- this is a path string (in this case "C:\Documents and Settings\Brian\Desktop\Joy\"

, despite the apparent lack of such joy. I have a feeling of tone, this is a symptom of some evil memory problem. I tried both with Capicom 2.1.0.1 and 2.1.0.2, both of which are abnormal, the last gives a standard error message, the former dies silently (ie the program exits by itself) I tested it on another XP machine with the same problem, although it worked fine on Vista.

Const curMthd = "EncryptStringWrap"
Dim Message As CAPICOM.EncryptedData
Set Message = New CAPICOM.EncryptedData
Dim oUtil As CAPICOM.Utilities
Set oUtil = New CAPICOM.Utilities
E.ErrorLog "<PART>14"
Message.Content = plaintext
E.ErrorLog "<PART>15"

      

Edit: This is not the data that is causing the problem. I manually passed data to check this; it works just fine. Annoyingly, the error went away when I put the test code into initialization. Evil heisenbug :( Possibly a memory issue :(

Edit 2: rewritten and something else here and closed. Not exactly the same question as in itself, but this question was based on a serious misunderstanding of the problem.

0


source to share


1 answer


Slashes can cause the CAPICOM to not handle strings correctly. By placing the code in a loop where you feed different lines, you can find out what the sequence of problems is.

Given that CAPICOM is a wrapper around cryptoAPI, this might give you a different path in which you run a test project that accesses the Crypto API directly using the same sequence of calls of the same type. There is a thin wrapper around reading online.

MSDN has some sample code here It's also available there.



I have faced many problems with various "wrapper" DLLs. Find the data that is causing the problem. Write a test project using Win API directly using the same data. Then rate.

The results usually either implement my own wrapper. Or find I am missing a step or misconfiguration.

Note that this works with wrapper assemblies in .NET, and with the added benefit of using a reflector to see what the wrapper is doing.

0


source







All Articles