Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DllImportAttribute , SetLastError is ignored #225

Open
NN--- opened this issue Jan 5, 2012 · 0 comments
Open

DllImportAttribute , SetLastError is ignored #225

NN--- opened this issue Jan 5, 2012 · 0 comments

Comments

@NN---
Copy link
Member

NN--- commented Jan 5, 2012

using System;
using System.Console;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Reflection;

namespace test2
{
    module Program
    {
      [DllImport("a.dll", SetLastError=true)]
      public extern F() : void;

      Main() : void
      {          
        def t = Type.GetType("test2.Program");
        def f = t.GetMethod("F");

        foreach (at in f.GetCustomAttributes(false))
        {
          | dat is DllImportAttribute => WriteLine(dat.SetLastError);
          | _ => ()
        }
      }
   }
}

Output is false , not true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant