internal class CryptoAPI {
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptAcquireContextA (ref IntPtr phProv, string pszContainer, string pszProvider, int dwProvType, uint dwFlags);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptCreateHash (IntPtr hProv, uint Algid, IntPtr hKey, uint dwFlags, ref IntPtr phHash);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptDecrypt (IntPtr hKey, IntPtr hHash, bool Final, uint dwFlags, byte[] pbData, ref uint pdwDataLen);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptDestroyHash (IntPtr hHash);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptDestroyKey (IntPtr hKey);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptEncrypt (IntPtr hKey, IntPtr hHash, bool Final, uint dwFlags, byte[] pbData, ref uint pdwDataLen, uint dwBufLen);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptGenKey (IntPtr hProv, uint Algid, uint dwFlags, ref IntPtr phKey);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptGenRandom (IntPtr hProv, uint dwLen, byte[] pbBuffer);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptGetHashParam (IntPtr hHash, uint dwParam, byte[] pbData, ref uint pdwDataLen, uint dwFlags);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptHashData (IntPtr hHash, byte[] pbData, uint dwDataLen, uint dwFlags);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptImportKey (IntPtr hProv, byte[] pbData, uint dwDataLen, IntPtr hPubKey, uint dwFlags, ref IntPtr phKey);
- [DllImport ("advapi32.dll", SetLastError=true)]
+ [DllImport ("advapi32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)]
public static extern bool CryptReleaseContext (IntPtr hProv, uint dwFlags);
public static readonly uint CRYPT_VERIFYCONTEXT = 0xF0000000;