Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3426256
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:41:36+00:00 2026-05-18T06:41:36+00:00

I try to call a DllImport on the following Alsa function (from the documentation

  • 0

I try to call a DllImport on the following Alsa function (from the documentation:

#define snd_seq_client_info_alloca( ptr )  __snd_alloca(ptr, snd_seq_client_info)

allocate a snd_seq_client_info_t
container on stack

Here is an implementation that I have found in C++ while reading the code of an application similar to what I want to accomplish in Mono:

snd_seq_client_info_t* cinfo;
snd_seq_client_info_alloca(&cinfo);

And here is what I have so far, but it is not working:

[DllImport(libasound.so.2)]
private static extern void snd_seq_client_info_alloca(out IntPtr ptr);

internal static void MyFunction ()
{
    IntPtr clientInfo = IntPtr.Zero;
    snd_seq_client_info_alloca(out clientInfo);
    // and then some more ...
}

But I get the following exception:

System.EntryPointNotFoundException: snd_seq_client_info_alloca
at (wrapper managed-to-native)   
MonoMultiJack.ConnectionWrapper.Alsa.LibAsoundWrapper:snd_seq_client_info_alloca (intptr&)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:41:36+00:00Added an answer on May 18, 2026 at 6:41 am

    snd_seq_client_info_alloca is a pre-processor macro. You cannot P/Invoke pre-processor macros, only properly exported functions.

    snd_seq_client_info_alloca expands to __snd_alloca which is a preprocessor macro as well.

    __snd_alloca essentially expands to a call to alloca. You could try to rewrite this in C#. But I believe it doesn’t make a lot of sense to allocate memory in the stack frame of the caller if the caller is managed code.

    Just allocate some memory somewhere else (for example, using Marshal.AllocHGlobal).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I call C++ function from C# project: [System.Runtime.InteropServices.DllImport(C.dll)] public static extern int FillSlist(out string
I try to call a function which passed as function pointer with no argument,
whenever I try to call my ejb from a client, I get this error
I got a little problem. Sometimes, when I try to call the following code,
$(item).droppable({ drop: function(event, ui) { console.log(triggered); } }); I try to call drop by
When I call this function, everything works, as long as I don't try to
It's possible to call .NET from MATLAB, so I thought I would try to
I am trying to call a DLL function in my file.aspx.cs like this: [DllImport(the.dll)]
I try to call *100# with the adb.exe program. I type the following in
I am using DllImport to call method in c wrapper library from my own

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.