Link to home
Create AccountLog in
Avatar of purplesoup
purplesoupFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Calling the 64 bit advapi32.dll in C#

In my C# assembly I reference the advapi32.dll, like this:

[DllImport("advapi32.dll", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
private static extern bool CryptCreateHash(int hProv, int algid, int hkey, int dwFlags, ref int phHash);

I'm finding that my web app won't run in 64 bit mode (i.e. it requires 'Enable 32-Bit Applications'), and I'm wondering if the C# is somehow referencing the 32 bit advapi32.dl instead of the 64 bit advapi32.dl.

Is they any way to make sure the right version of advapi32.dl is being referenced?


ASKER CERTIFIED SOLUTION
Avatar of Todd Gerbert
Todd Gerbert
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of purplesoup

ASKER

OK thanks for your help - I'll look at this again in the New Year, but this is all very helpful - thanks!
Have a good holiday, thanks again.