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

Consider an excerpt from code that can be found here : namespace WinSearchFile {
I have code that uses methods from the SSPI dll (security.dll) via P/Invoke, which
I'm writing an application that will need to reboot the Windows machine the code
I have a .NET Compact Framework app that can runs on three windows machines
I have a shim library (shared, C++) which calls functions in another shared library
I've been successfully creating a .net mutex like this: SingleIns = new Mutex(true, AppName);
I want to temporarily add a directory to the DLL search paths - is
This is probably a really easy question to answer, but for some reason I'm
I am trying to create an offline registry in memory using the offreg.dll provided
I have a DLL which contains a class with static members . I use

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.