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

[NativeAOT] ILC: AOT analysis error IL1005 Vararg call not supported #67804

Closed
AhmedZero opened this issue Apr 9, 2022 · 4 comments
Closed

Comments

@AhmedZero
Copy link

AhmedZero commented Apr 9, 2022

Description

there is an error when building the driver

Reproduction Steps

        [MethodImpl(MethodImplOptions.InternalCall)]
        [RuntimeImport("ntoskrnl.exe", "DbgPrint")]
        public static extern ulong _DbgPrint(byte* Format, __arglist);

        static NTSTATUS DriverEntry()
        {
            _DbgPrint("%d".asstr(), __arglist(2));
            return NTSTATUS.Success;
        }
        public static byte* asstr(this string str)
        {
            fixed (char* wc = str)
            {
                var buf = ExAllocatePool(PoolType.NonPagedPool, (ulong)str.Length + 20);
                for (int i = 0; i < str.Length; i++)
                    buf[i] = (byte)wc[i];
                buf[str.Length] = (byte)0;
                return buf;
            }
        }

Expected behavior

build without any problems

Actual behavior

ILC: AOT analysis error IL1005: testdriver.Program.DriverEntry(): Method will always throw because: Vararg call to 'UInt64 testdriver.WDK._DbgPrint(Char*)' not supported

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Apr 9, 2022
@jkotas
Copy link
Member

jkotas commented Apr 9, 2022

varargs are supported only on Windows for C++/CLI compatibility. C++/CLI is not supported by NativeAOT.

More general support for varargs is tracked by #48796.

@jkotas
Copy link
Member

jkotas commented Apr 9, 2022

Listed in #69919

@jkotas jkotas closed this as completed Apr 9, 2022
@AhmedZero
Copy link
Author

I hope to support it soon. thanks.

@jeffhandley jeffhandley removed the untriaged New issue has not been triaged by the area owner label May 6, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants