I do think so, too. But I don't know how to reference to it.It's seemed I
can't reference to it by using the reference windows in my project.
BTW, APIs imported from User32 and Kenerl32 are worked well.
[DllImport("user32.dll", EntryPoint="MessageBox")]
public static extern int MsgBox(int hWnd, String text, String caption,
uint type);
above is right.
[DllImport("Advapi32", EntryPoint="CryptEnumProvidersW",
SetLastError=true, ExactSpelling=true,
CharSet=CharSet.Auto)]
static extern bool CryptEnumProviders(
[MarshalAs(UnmanagedType.U4)] int dwIndex,
[MarshalAs(UnmanagedType.U4)] ref int pdwReserved,
[MarshalAs(UnmanagedType.U4)] int dwFlags,
[MarshalAs(UnmanagedType.U4)] ref int pdwProvType,
StringBuilder pszProvName,
[MarshalAs(UnmanagedType.U4)] ref int pcbProvName);
above is wrong.
errcode=126 ERROR_MOD_NOT_FOUND
The specified module could not be found.
Nicholas Paldino said:
mRbEn,
What does the declaration in your code look like? You arent setting a
reference to advapi32.dll, are you?
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
mRbEn said:
one more question!
When I call the cryptenumproviders in my C# project. I got an error it's
said that the module could not be found. Why can't my project load
advapi32.dll and find the module CryptEnumProviders ? !!!