"Attempted to read or write protected memory" with Winscard.dll

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nieve
    New Member
    • Feb 2008
    • 1

    "Attempted to read or write protected memory" with Winscard.dll

    Hello all,

    I'm working on a c# application using smart cards.
    I've been using vs2008 on an XP machine and everything was ok till I tried installing and running a demo on a vista machine. What happens is that when I get to call this method:
    [DllImport("WinS card.dll")]
    public static extern int SCardListReader Groups(int hContext, ref string cGroups, ref int nStringSize);
    I get the "Attempted to read or write protected memory" exception.
    I've tried editbin.exe /NXCOMPAT:NO myDllPath (as suggested here ) but that didn't help.

    Any ideas or suggestions would be highly appreciated!!
Working...