Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>That function should work fine on 64-bit windows if you change your pointers to be the same size at the platform using <a href="http://msdn.microsoft.com/en-us/library/system.intptr.aspx" rel="nofollow"><code>IntPtr</code></a>. Your pointers are fixed at 32-bits, which may (most likely) cause problems in a 64-bit environments. For example:</p> <pre><code> Friend Declare Function CryptAcquireContext Lib "advapi32.dll" Alias "CryptAcquireContextA" (ByRef phProv As IntPtr, ByVal pszContainer As String, ByVal pszProvider As String, ByVal dwProvType As Integer, ByVal dwFlags As Integer) As IntPtr </code></pre> <p>And that's it. The <code>dwFlags</code> and <code>dwProvType</code> stay Integer because they are 32-bit regardless of platform (DWORD). You will have to fix <em>all</em> platform invoke calls to use <code>IntPtr</code>. For example, your call to <code>CryptReleaseContext</code> should also take an <code>IntPtr</code> as the first parameter rather than Integer.</p> <p>Alternatively, you can change your application to always target the x86 platform instead of Any CPU and just let WOW64 handle it. Then, no code changes are needed.</p> <p>If you can explain what you need this function for, there might be a more straight forward .NET implementation of what you are trying to do. For instance, if you are trying to work with x509 certificates, you may be more interested in the <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509certificate2.aspx" rel="nofollow"><code>X509Certificate2</code></a> class.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload