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

  • Home
  • SEARCH
  • 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 930413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:19:48+00:00 2026-05-15T20:19:48+00:00

I use C#.net. These is my method now: [DllImport(DLLPath, CallingConvention = CallingConvention.Cdecl)] unsafe public

  • 0

I use C#.net.

These is my method now:

    [DllImport(DLLPath, CallingConvention = CallingConvention.Cdecl)]
    unsafe public extern static int AMRecoveryModeDeviceReboot(AMRecoveryDevice device, byte[] paramByte, int u1, int u2, int u3)

I must have a Pointer in it, the AMRecoveryDevice is a struct:

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
internal struct AMRecoveryDevice
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
    public byte[] unknown0;      /* 0 */
    public DeviceRestoreNotificationCallback callback;    /* 8 */
    public IntPtr user_info;      /* 12 */
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
    public byte[] unknown1;      /* 16 */
    public uint readwrite_pipe;    /* 28 */
    public byte read_pipe;          /* 32 */
    public byte write_ctrl_pipe;    /* 33 */
    public byte read_unknown_pipe;  /* 34 */
    public byte write_file_pipe;    /* 35 */
    public byte write_input_pipe;   /* 36 */
};

Now I must have AMRecoveryDevice as a Pointer in the first method, but then it gives an error.
Is it impossible?

  • 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-15T20:19:48+00:00Added an answer on May 15, 2026 at 8:19 pm

    Use ref in method declaration:

    [DllImport(DLLPath, CallingConvention = CallingConvention.Cdecl)]
    public extern static int AMRecoveryModeDeviceReboot(
        ref AMRecoveryDevice device,
        byte[] paramByte,
        int u1,
        int u2,
        int u3)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What encryption method does the .NET FormsAuthentication.Encrypt() method use? There's no mention in the
Using ASP.Net MVC 2, is there any way to use the RedirectToAction() method of
I have an android.graphics.bitmap and an android.net.Uri both of these I can use anyway
Is it possible to use the equivalent for .NET method attributes in PHP, or
We primarily use an ASP.NET environment at work. Right now I'm building an application
Is there a way to use ASP.NET in browsers that javascript is not enabled?
QUESTION: Re use of .NET Backgroundworker, is there not a way to let exceptions
Are there any way to do so? I prefer to use VB.NET or Java
Is there a .NET data structure I could use for bidirectional lookup? Here's the
There's a standard pattern for events in .NET - they use a delegate type

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.