dcsimg
Results 1 to 13 of 13

Thread: CryptoAPI Not Working on Windows 10

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2014
    Posts
    58

    CryptoAPI Not Working on Windows 10

    Good Day All,

    Running VB6 on Windows 7. Code below works perfectly on my machine, but not on a client's Windows 10 64-bit machine. Any ideas why below isn't working in Windows 10?

    Code:
    Public Const CON_KEY_ENCRYPT = "MyEncryptionKey"
    
    Private Const SERVICE_PROVIDER As String = "Microsoft Base Cryptographic Provider v1.0"
    Private Const KEY_CONTAINER As String = "jhaFj339fFhHHEiapw"
    Private Const PROV_RSA_FULL As Long = 1
    Private Const PP_NAME As Long = 4
    Private Const PP_CONTAINER As Long = 6
    Private Const CRYPT_NEWKEYSET As Long = 8
    Private Const ALG_CLASS_DATA_ENCRYPT As Long = 24576
    Private Const ALG_CLASS_HASH As Long = 32768
    Private Const ALG_TYPE_ANY As Long = 0
    Private Const ALG_TYPE_STREAM As Long = 2048
    Private Const ALG_SID_RC4 As Long = 1
    Private Const ALG_SID_MD5 As Long = 3
    Private Const CALG_MD5 As Long = ((ALG_CLASS_HASH Or ALG_TYPE_ANY) Or ALG_SID_MD5)
    Private Const CALG_RC4 As Long = ((ALG_CLASS_DATA_ENCRYPT Or ALG_TYPE_STREAM) Or ALG_SID_RC4)
    Private Const ENCRYPT_ALGORITHM As Long = CALG_RC4
    Private Const NUMBER_ENCRYPT_PASSWORD As String = "osPQ]"
    Private hCryptProv As Long
    
    Private Declare Function CryptAcquireContext Lib "advapi32.dll" Alias "CryptAcquireContextA" _
        (ByRef phProv As Long, _
        ByVal pszContainer As String, _
        ByVal pszProvider As String, _
        ByVal dwProvType As Long, _
        ByVal dwFlags As Long) As Long
    
    Private Declare Function CryptGetProvParam Lib "advapi32.dll" _
        (ByVal hProv As Long, _
        ByVal dwParam As Long, _
        ByRef pbData As Any, _
        ByRef pdwDataLen As Long, _
        ByVal dwFlags As Long) As Long
    
    Private Declare Function CryptCreateHash Lib "advapi32.dll" _
        (ByVal hProv As Long, _
        ByVal Algid As Long, _
        ByVal hKey As Long, _
        ByVal dwFlags As Long, _
        ByRef phHash As Long) As Long
    
    Private Declare Function CryptHashData Lib "advapi32.dll" _
        (ByVal hHash As Long, _
        ByVal pbData As String, _
        ByVal dwDataLen As Long, _
        ByVal dwFlags As Long) As Long
    
    Private Declare Function CryptDeriveKey Lib "advapi32.dll" _
        (ByVal hProv As Long, _
        ByVal Algid As Long, _
        ByVal hBaseData As Long, _
        ByVal dwFlags As Long, _
        ByRef phKey As Long) As Long
    
    Private Declare Function CryptDestroyHash Lib "advapi32.dll" _
        (ByVal hHash As Long) As Long
    
    Private Declare Function CryptEncrypt Lib "advapi32.dll" _
        (ByVal hKey As Long, _
        ByVal hHash As Long, _
        ByVal Final As Long, _
        ByVal dwFlags As Long, _
        ByVal pbData As String, _
        ByRef pdwDataLen As Long, _
        ByVal dwBufLen As Long) As Long
    
    Private Declare Function CryptDestroyKey Lib "advapi32.dll" _
        (ByVal hKey As Long) As Long
    
    Private Declare Function CryptReleaseContext Lib "advapi32.dll" _
        (ByVal hProv As Long, _
        ByVal dwFlags As Long) As Long
    
    Private Declare Function CryptDecrypt Lib "advapi32.dll" _
        (ByVal hKey As Long, _
        ByVal hHash As Long, _
        ByVal Final As Long, _
        ByVal dwFlags As Long, _
        ByVal pbData As String, _
        ByRef pdwDataLen As Long) As Long
    
    Public Function AutoDecryptData(ByVal Data As String, ByVal Key As String) As String
        EncryptionCSPConnect
        AutoDecryptData = DecryptData(Data, Key)
        EncryptionCSPDisconnect
    End Function
    
    Public Function AutoEncryptData(ByVal Data As String, ByVal Key As String) As String
        EncryptionCSPConnect
        AutoEncryptData = EncryptData(Data, Key)
        EncryptionCSPDisconnect
    End Function
    
    Private Function ByteToStr(ByRef ByteArray() As Byte, ByVal lLength As Long) As String
        Dim i           As Long
        For i = LBound(ByteArray) To (LBound(ByteArray) + lLength)
            ByteToStr = ByteToStr & Chr$(ByteArray(i))
        Next i
    End Function
    
    Public Function DecryptData(ByVal Data As String, ByVal Key As String) As String
        Dim lEncCount As Long, sDecrypted As String, sTempPW As String
        lEncCount = DecryptNumber(Mid$(Data, 1, 8))
        sTempPW = Key & lEncCount
        sDecrypted = EncryptDecrypt(Mid$(Data, 9), sTempPW, False)
        DecryptData = sDecrypted
    End Function
    
    Private Function DecryptNumber(ByVal sNumber As Variant) As Long
        On Error Resume Next
        Dim i           As Long
        For i = 1 To 8
            DecryptNumber = (10 * DecryptNumber) + (Asc(Mid$(sNumber, i, 1)) - Asc(Mid$(sNumber, i, 1)))
        Next i
    End Function
    
    Public Function EncryptData(ByVal Data As String, ByVal Key As String) As String
        Dim sEncrypted  As String
        Dim lEncCount   As Long
        Dim sTempPW     As String
        lEncCount = 0
        sTempPW = Key & lEncCount
        sEncrypted = EncryptDecrypt(Data, sTempPW, True)
        Do While (InStr(1, sEncrypted, vbCr) > 0) Or (InStr(1, sEncrypted, vbLf) > 0) Or (InStr(1, sEncrypted, Chr$(0)) > 0) Or (InStr(1, sEncrypted, vbTab) > 0)
            lEncCount = lEncCount + 1
            sTempPW = Key & lEncCount
            sEncrypted = EncryptDecrypt(Data, sTempPW, True)
            If lEncCount = 99999999 Then
                Err.Raise _
                vbObjectError + 999, "EncryptData", _
                "There was an error encountered while encrypting the data."
                EncryptData = ""
                Exit Function
            End If
        Loop
        EncryptData = EncryptNumber(lEncCount) & sEncrypted
    End Function
    
    Private Function EncryptDecrypt(ByVal Data As String, ByVal Key As String, ByVal Encrypt As Boolean) As String
        Dim lLength     As Long
        Dim sTemp       As String
        Dim hHash       As Long
        Dim hKey        As Long
        If hCryptProv = 0 Then
            HandleError "Not Connected To Cryptography Service Provider"
            Exit Function
        End If
        If CryptCreateHash(hCryptProv, CALG_MD5, 0, 0, hHash) = 0 Then
            HandleError "Error encountered during CryptCreateHash!"
        End If
        If CryptHashData(hHash, Key, Len(Key), 0) = 0 Then
            HandleError "Error encountered during CryptHashData!"
        End If
        If CryptDeriveKey(hCryptProv, ENCRYPT_ALGORITHM, hHash, 0, hKey) = 0 Then
            HandleError "Error encountered during CryptDeriveKey!"
        End If
        sTemp = Data
        lLength = Len(Data)
        If Encrypt Then
            If CryptEncrypt(hKey, 0, 1, 0, sTemp, lLength, lLength) = 0 Then
                HandleError "Error encountered during CryptEncrypt!"
            End If
        Else
            If CryptDecrypt(hKey, 0, 1, 0, sTemp, lLength) = 0 Then
                HandleError "Error encountered during CryptDecrypt!"
            End If
        End If
        EncryptDecrypt = Mid$(sTemp, 1, lLength)
        If hKey <> 0 Then
            CryptDestroyKey hKey
        End If
        If hHash <> 0 Then
            CryptDestroyHash hHash
        End If
    End Function
    
    Public Function EncryptionCSPConnect() As Boolean
        If CryptAcquireContext(hCryptProv, KEY_CONTAINER, SERVICE_PROVIDER, PROV_RSA_FULL, CRYPT_NEWKEYSET) = 0 Then
            If CryptAcquireContext(hCryptProv, KEY_CONTAINER, SERVICE_PROVIDER, PROV_RSA_FULL, 0) = 0 Then
                HandleError _
                "Error encountered during CryptAcquireContext!" & _
                vbCrLf & _
                "A Key Container with this name already exists."
                EncryptionCSPConnect = False
                Exit Function
            End If
        End If
        EncryptionCSPConnect = True
    End Function
    
    Public Sub EncryptionCSPDisconnect()
        If hCryptProv <> 0 Then
            CryptReleaseContext hCryptProv, 0
        End If
    End Sub
    
    Private Function EncryptNumber(ByVal lNumber As Long) As String
        Dim i As Long
        Dim sNumber As String
        sNumber = Format$(lNumber, "00000000")
        For i = 1 To 8
            EncryptNumber = EncryptNumber & Chr$(Asc(Mid$(BuildRandomData(8, False, False), i, 1)) + Val(Mid$(sNumber, i, 1)))
        Next i
    End Function
    
    Public Function GetCSPDetails() As String
        Dim lLength     As Long
        Dim yContainer() As Byte
        If hCryptProv = 0 Then
            GetCSPDetails = "Not Connected To Cryptography Service Provider"
            Exit Function
        End If
        lLength = 1000
        ReDim yContainer(lLength)
        If CryptGetProvParam(hCryptProv, PP_NAME, yContainer(0), lLength, 0) <> 0 Then
            GetCSPDetails = "Cryptographic Service Provider Name: " & ByteToStr(yContainer, lLength)
        End If
        lLength = 1000
        ReDim yContainer(lLength)
        If CryptGetProvParam(hCryptProv, PP_CONTAINER, yContainer(0), lLength, 0) <> 0 Then
            GetCSPDetails = GetCSPDetails & vbCrLf & "Key Container Name: " & ByteToStr(yContainer, lLength)
        End If
    End Function
    
    Private Sub HandleError(ByVal Error As String)
        Debug.Print Error
    End Sub
    I call the encryption functions as follows:

    Code:
    sData = AutoEncryptData(sValue, CON_KEY_ENCRYPT)
    And decrypt as follows:

    Code:
    sValue = AutoDecryptData(sData, CON_KEY_ENCRYPT)
    The value being returned by AutoDecryptData is incorrect. Weird thing is it works on many other Windows 10 machines. Any assistance is greatly appreciated!

    Best Regards
    Brad

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,234

    Re: CryptoAPI Not Working on Windows 10

    Not extremely familiar with those APIs, but whenever I see string parameters, I opt for the W (wide char) version of the API. Since we know VB does string conversions when strings are sent to A (ANSI char) versions, why use them unless you have no choice. Converting existing code for W-version is typically super easy, with few exceptions.

    Another thing to consider is to double check all of your parameters against the MSDN documentation to validate the parameter vartype. When "As Any" is used for parameters, ensure you are passing the value correctly, either ByRef or ByVal.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,322

    Re: CryptoAPI Not Working on Windows 10

    People also get tangled up in their underwear using a String where they should use a Byte array. With care it can work fine, but it is very easy to end up tripping over conversion to/from ANSI and scrambling a byte here and there. Such a program will work great up until it fails on different data. Doing this along with ANSI entrypoint Declares is like pulling the pin out of the grenade, sticking it in your pocket, and hoping it doesn't go off as you jump on the trampoline.

  4. #4

    Thread Starter
    Member
    Join Date
    Mar 2014
    Posts
    58

    Re: CryptoAPI Not Working on Windows 10

    Thanks to you both, greatly appreciate the insight. Terribly sorry to ask, but could you be more specific as to what I should change? This library wasn't written by me but unfortunately I'm tasked with fixing it.

    Thanks in advance!

  5. #5
    Addicted Member
    Join Date
    Nov 2011
    Posts
    130

    Re: CryptoAPI Not Working on Windows 10

    do you have the sub BuildRandomData as not in snippet you gave

  6. #6

    Thread Starter
    Member
    Join Date
    Mar 2014
    Posts
    58

    Re: CryptoAPI Not Working on Windows 10

    Hi k_zeon,

    Apologies, forgot that part.

    Code:
    Private Declare Function GetTickCount Lib "kernel32" () As Long
        
    Private Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" _
        (ByVal lpRootPathName As String, _
        ByVal lpVolumeNameBuffer As String, _
        ByVal nVolumeNameSize As Long, _
        lpVolumeSerialNumber As Long, _
        lpMaximumComponentLength As Long, _
        lpFileSystemFlags As Long, _
        ByVal lpFileSystemNameBuffer As String, _
        ByVal nFileSystemNameSize As Long) As Long
    
    Private Function BuildOutputString(sInput() As String) As String
        Dim lIndex      As Long
        Dim lMax        As Long
        Dim sTemp       As String
        Dim sOutput     As String
        sOutput = ""
        sTemp = ""
        lMax = UBound(sInput) - 1
        If lMax < 0 Then
            BuildOutputString = ""
            Exit Function
        End If
        For lIndex = 0 To lMax
            sTemp = sTemp & sInput(lIndex)
            If Len(sTemp) Mod 1024 = 0 Then
                sOutput = sOutput & sTemp
                sTemp = ""
            End If
        Next
        BuildOutputString = sOutput & sTemp
        sOutput = String(250, 0)
        sTemp = String(250, 0)
    End Function
    
    Public Function BuildRandomData(lDataLength As Long, Optional bUseHexChars As Boolean = False, Optional bUseKeyboardChars As Boolean = False, Optional bConvertAllData As Boolean = False) As String
        Dim lIndex      As Long
        Dim lMax        As Long
        Dim bByte()     As Byte
        Dim sString()   As String
        Dim sTemp       As String
        Dim iChoice     As Integer
        Erase bByte()
        Erase sString()
        sTemp = ""
        If lDataLength = 0 Then
            Exit Function
        Else
            ReDim bByte(lDataLength)
        End If
        For lIndex = 1 To 10
            iChoice = CInt(RND2(1, 3))
        Next
        Select Case iChoice
            Case 1:    SeedRandomGenerator1
            Case 2:    SeedRandomGenerator2
            Case Else: SeedRandomGenerator1
        End Select
        bByte = CreateCharData(bUseKeyboardChars, lDataLength)
        bByte = MixData(bByte())
        If bUseHexChars Then
            lMax = lDataLength * 2
            ReDim sString(lIndex)
            For lIndex = 0 To lDataLength - 1
                sString(lIndex) = Right$("00" & Hex(bByte(lIndex)), 2)
            Next
        Else
            ReDim sString(lDataLength)
            For lIndex = 0 To lDataLength - 1
                sString(lIndex) = Chr$(bByte(lIndex))
            Next
        End If
        sTemp = BuildOutputString(sString())
        If bUseHexChars Then
            If bConvertAllData Then
                BuildRandomData = Replace(sTemp, Chr(34), "A")
            Else
                BuildRandomData = Replace(Left$(sTemp, lDataLength), Chr(34), "A")
            End If
        Else
            BuildRandomData = Replace(sTemp, Chr(34), "A")
        End If
        sTemp = vbNullString
        Erase bByte()
        ReDim bByte(0)
        Erase sString()
        ReDim sString(0)
    End Function
    
    Private Function CreateCharData(bKeyboardChars As Boolean, Optional lDataLength As Long = 50) As Variant
        Dim lIndex      As Long
        Dim iChar       As Integer
        Dim bByte()     As Byte
        Erase bByte()
        ReDim bByte(lDataLength)
        For lIndex = 0 To lDataLength - 1
            If bKeyboardChars Then
                Do
                    iChar = Int(RND2(33, 126))
                Loop Until (iChar > 32 And iChar < 127)
            Else
                iChar = Int(Rnd * 255)
            End If
            bByte(lIndex) = iChar
        Next
        CreateCharData = bByte()
        iChar = 0
        Erase bByte()
        ReDim bByte(0)
    End Function
    
    Private Function MixData(bByte() As Byte) As Variant
        Dim lIndex1     As Long
        Dim lIndex2     As Long
        Dim lNewIndex   As Long
        Dim lMax        As Long
        Dim bTemp       As Byte
        Dim iOuterLoop  As Integer
        lMax = UBound(bByte)
        If lMax <= 0 Then
            MixData = bByte()
            Exit Function
        End If
        iOuterLoop = Int(RND2(5, 10))
        For lIndex1 = 1 To iOuterLoop
            Randomize CDbl(Now()) + Timer
            For lIndex2 = 0 To lMax - 1
                Do
                    lNewIndex = Int(Rnd * (lMax - 1))
                Loop Until lNewIndex <> lIndex2
                bTemp = bByte(lIndex2)
                bByte(lIndex2) = bByte(lNewIndex)
                bByte(lNewIndex) = bTemp
            Next
        Next
        MixData = bByte()
    End Function
    
    Private Function RND2(snLow As Single, snHigh As Single) As Single
        DoEvents
        Randomize (CDbl(Now()) + Timer)
        RND2 = (Rnd * (snHigh - snLow)) + snLow
    End Function
    
    Private Sub SeedRandomGenerator1()
        Dim lRetVal     As Long
        Dim lVolSn      As Long
        Dim lTickCnt    As Long
        Dim dPi         As Double
        Dim vRndSeed    As Variant
        Dim vDecimal    As Variant
        lVolSn = 0
        lTickCnt = 0
        vRndSeed = 0
        vDecimal = 0
        dPi = Atn(1) * 4
        lTickCnt = GetTickCount()
        Randomize lTickCnt + dPi
        lRetVal = GetVolumeInformation("C:\", "", 0, lVolSn, 0, 0, "", 0)
        vRndSeed = CDbl(Now()) + (Rnd * dPi)
        vRndSeed = vRndSeed + CDbl((Rnd * lTickCnt) + lVolSn)
        vRndSeed = vRndSeed + (Rnd * lVolSn) + dPi
        vDecimal = Mid(vRndSeed, InStr(vRndSeed, "."))
        vDecimal = CDec((vDecimal + dPi) * (Rnd * 1))
        vRndSeed = vRndSeed + vDecimal
        Randomize vRndSeed
        lVolSn = 0
        vRndSeed = Empty
        vDecimal = Empty
    End Sub
    
    Private Sub SeedRandomGenerator2()
        Dim snMultiplier As Single
        Dim lFinish     As Long
        Dim lIndex      As Long
        Dim lRetVal     As Long
        Dim lVolSn      As Long
        Dim lTickCnt    As Long
        Dim dPi         As Double
        Dim vRndSeed    As Variant
        Dim vDecimal    As Variant
        snMultiplier = 1.321
        vRndSeed = 0
        vDecimal = 0
        lVolSn = 0
        dPi = Atn(1) * 4
        lTickCnt = GetTickCount()
        Randomize lTickCnt + dPi
        lRetVal = GetVolumeInformation("C:\", "", 0, lVolSn, 0, 0, "", 0)
        lFinish = Int(RND2(5, 15))
        For lIndex = 1 To lFinish
            vRndSeed = CDbl(Now()) + lTickCnt
            vRndSeed = Sqr(vRndSeed) + dPi + lVolSn
            vRndSeed = CDbl((Timer + vRndSeed) * snMultiplier)
            vRndSeed = vRndSeed + lTickCnt + lVolSn
            vRndSeed = (vRndSeed / (lIndex + 1))
            If lIndex Mod 3 = 0 Then
                snMultiplier = snMultiplier * 0.5
                vRndSeed = vRndSeed * dPi
            Else
                snMultiplier = snMultiplier * 0.5
                vRndSeed = vRndSeed * snMultiplier
            End If
            vDecimal = Mid(vRndSeed, InStr(vRndSeed, "."))
            vDecimal = CDec(vDecimal + dPi)
            vRndSeed = vRndSeed + vDecimal + (Rnd * 1)
            DoEvents
        Next
        Randomize vRndSeed
        lVolSn = 0
        snMultiplier = 0
        vRndSeed = Empty
        vDecimal = Empty
    End Sub

  7. #7
    Addicted Member
    Join Date
    Nov 2011
    Posts
    130

    Re: CryptoAPI Not Working on Windows 10

    very strange. i am on Win10 Pro 1903 64 bit. When i run code , sometimes it works sometime it doesn't.
    If i put a few words and encrypt it works, then i add another line and it does not. take that line out and it works.
    Then i add a few more lines to encrypt & then decrypt and it works again.
    add a few returns and it still works. I then add some letters in the gaps and it fails to decrypt again.
    Maybe something in the BuildRandomData function is causing issue.
    But i am not expert on encyption.

  8. #8

    Thread Starter
    Member
    Join Date
    Mar 2014
    Posts
    58

    Re: CryptoAPI Not Working on Windows 10

    Hi k_zeon,

    When you say add a few returns/lines, in this particular case it would not matter. The value we are trying to decrypt has no spaces or multiple lines. Any further ideas?

  9. #9

    Thread Starter
    Member
    Join Date
    Mar 2014
    Posts
    58

    Re: CryptoAPI Not Working on Windows 10

    Hi All,

    So it appears k_zeon was right, the issue definitely lies within the BuildRandomData function as removing it from code in testing results in the value decrypting properly. Stripping this out of our encryption library however will cause major issues in production. Any ideas from anyone on what's wrong with this function and how to fix?

    Thanks in advance!

  10. #10
    Lively Member
    Join Date
    Jan 2018
    Posts
    65

    Re: CryptoAPI Not Working on Windows 10

    I didn't look at it too closely, but that function doesn't seem to be designed to generate reproducible results, so I don't see how it could ever be used for decryption without storing the result somewhere. Luckily the DecryptNumber function always returns a zero as written, so in many cases the EncryptData function happens to work. I would just not encrypt the first 8 characters of the result string at all: EncryptNumber = Format$(lNumber, "00000000") DecryptNumber = Mid$(sNumber,1,8)

    Or if you can, abandon the terrible numeric prefix idea and just convert the encrypted results to hex or escape out the values that cause problems.

  11. #11
    Fanatic Member
    Join Date
    Dec 2012
    Posts
    753

    Re: CryptoAPI Not Working on Windows 10

    I ran into problems with the Crypto API doing modern Cryptography long ago on Win 7+, so I abandoned it in favor of CNG (Cryptography Next Generation). CNG has it's own set of problems, but at least MS is keeping it up to date (sort of).

    J.A. Coutts

  12. #12
    Frenzied Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    1,653

    Re: CryptoAPI Not Working on Windows 10

    I use CAPICOM2 (CryptoAPI COM v.2) with success in any Windows version.

    Download Platform SDK Redistributable: CAPICOM from Official Microsoft Download Center (v. 2.1.0.2 - 9/26/2016)
    https://www.microsoft.com/en-us/down....aspx?id=25281

    Encrypting a Message in CAPICOM - Windows applications | Microsoft Docs
    https://docs.microsoft.com/en-us/win...age-in-capicom

    Getting Ready to Use CAPICOM - Windows applications | Microsoft Docs
    https://docs.microsoft.com/it-it/win...to-use-capicom

  13. #13
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,322

    Re: CryptoAPI Not Working on Windows 10

    CAPICOM works but it does need to be deployed on later versions of Windows and is considered unsupported. It has a limited range of useful operations, but it still seems to work for me.

    CNG is only a partial replacement for the CryptoAPI. The things CNG doesn't have today might not ever be ported over.

    They all work within their limitations.


    But we already know this thread was mistaken and the problem was not the API but a problem creating the data being fed to the API calls. I still suspect the problem comes from generating Unicode characters that don't map to an ANSI character (and back).

    The code is quite a rat's nest though and since we don't know what it is trying to accomplish it can be hard to help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width