Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Windows Crypto API is not working on 64 bit

Windows Crypto API is not working on 64 bit

Scheduled Pinned Locked Moved Visual Basic
helpcryptographyjsonannouncementlounge
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sri_0099
    wrote on last edited by
    #1

    Hello All, My application is using CryptGenRandom() API to get random numbers. This API is working in all 32-bit computers. I recently installed my application in windows-7 64-bit computer. On this machine CryptGenRandom() API is throwing below error. Problem Event Name: APPCRASH Application Timestamp: 4b84b933 Fault Module Name: StackHash_6299 Fault Module Version: 0.0.0.0 Fault Module Timestamp: 00000000 Exception Code: c0000005 Exception Offset: 000007ff005880cb OS Version: 6.1.7600.2.0.0.256.48 Locale ID: 1033 Additional Information 1: 6299 Additional Information 2: 6299b6a70d20c6215a02ce0a4291f9cc Additional Information 3: 7130 Additional Information 4: 71302fa4a91436747a963f67bb2f095e Sample Code: ReDim bChallengeArray(127) lres = CryptGenRandom(lhcsp, 128, bChallengeArray(0)) lres = CryptEncrypt(lhkey, 0, 1, 0, bCryptBufferArray(0), ldatalength, lBufferLength) Please don't ask me to use managed code, because this is maintanance project client will not agree to change the code. If anybody have any idea, please let me know the solution. Thnaks in advance. Sri

    modified on Friday, February 26, 2010 5:16 AM

    D T 2 Replies Last reply
    0
    • S sri_0099

      Hello All, My application is using CryptGenRandom() API to get random numbers. This API is working in all 32-bit computers. I recently installed my application in windows-7 64-bit computer. On this machine CryptGenRandom() API is throwing below error. Problem Event Name: APPCRASH Application Timestamp: 4b84b933 Fault Module Name: StackHash_6299 Fault Module Version: 0.0.0.0 Fault Module Timestamp: 00000000 Exception Code: c0000005 Exception Offset: 000007ff005880cb OS Version: 6.1.7600.2.0.0.256.48 Locale ID: 1033 Additional Information 1: 6299 Additional Information 2: 6299b6a70d20c6215a02ce0a4291f9cc Additional Information 3: 7130 Additional Information 4: 71302fa4a91436747a963f67bb2f095e Sample Code: ReDim bChallengeArray(127) lres = CryptGenRandom(lhcsp, 128, bChallengeArray(0)) lres = CryptEncrypt(lhkey, 0, 1, 0, bCryptBufferArray(0), ldatalength, lBufferLength) Please don't ask me to use managed code, because this is maintanance project client will not agree to change the code. If anybody have any idea, please let me know the solution. Thnaks in advance. Sri

      modified on Friday, February 26, 2010 5:16 AM

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The error you posted is useless. It doesn't provide any details that can be used to diagnose the problem. You need the error from GetLastError to have any meaningful error code. We'd also need to see your PInvoke headers for these two functions. It's possible the wrong datatypes have been used to declare the parameters passed into the functions.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008
      But no longer in 2009...

      1 Reply Last reply
      0
      • S sri_0099

        Hello All, My application is using CryptGenRandom() API to get random numbers. This API is working in all 32-bit computers. I recently installed my application in windows-7 64-bit computer. On this machine CryptGenRandom() API is throwing below error. Problem Event Name: APPCRASH Application Timestamp: 4b84b933 Fault Module Name: StackHash_6299 Fault Module Version: 0.0.0.0 Fault Module Timestamp: 00000000 Exception Code: c0000005 Exception Offset: 000007ff005880cb OS Version: 6.1.7600.2.0.0.256.48 Locale ID: 1033 Additional Information 1: 6299 Additional Information 2: 6299b6a70d20c6215a02ce0a4291f9cc Additional Information 3: 7130 Additional Information 4: 71302fa4a91436747a963f67bb2f095e Sample Code: ReDim bChallengeArray(127) lres = CryptGenRandom(lhcsp, 128, bChallengeArray(0)) lres = CryptEncrypt(lhkey, 0, 1, 0, bCryptBufferArray(0), ldatalength, lBufferLength) Please don't ask me to use managed code, because this is maintanance project client will not agree to change the code. If anybody have any idea, please let me know the solution. Thnaks in advance. Sri

        modified on Friday, February 26, 2010 5:16 AM

        T Offline
        T Offline
        TheComputerMan
        wrote on last edited by
        #3

        Just a thought as I had something similar. Did you compile for 32 bit? I had to specifically compile for 32 bit before an app would run on Windows 7 64 bit.

        S 1 Reply Last reply
        0
        • T TheComputerMan

          Just a thought as I had something similar. Did you compile for 32 bit? I had to specifically compile for 32 bit before an app would run on Windows 7 64 bit.

          S Offline
          S Offline
          sri_0099
          wrote on last edited by
          #4

          Thanks for the help. I had compiled all the solution for 32 bit. Now it is working great. Thanks, Sri

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups