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 7846099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:27:56+00:00 2026-06-02T17:27:56+00:00

I am using JNA to call methods of user32.dll and kernel32.dll. It is working

  • 0

I am using JNA to call methods of user32.dll and kernel32.dll. It is working fine as of now. I got stuck in some issue, and I got to know that I have to call this method.

void SendCommandToConsole( char* Cmd )
{
    DWORD dwCall = 0x004C1030;
    __asm
    {
        push Cmd;
        push 0;
        call dwCall;
    }
}

SendCommandToConsole ( "rp 2000" );

But I am not even getting it what it is? What this __asm is doing ?

Please add appropriate tags, if the tags I have used are not correct. 🙂

Edit
Added .Net and C# tags as suggested. Above code is in either C# or .NET, may be someone with the knowledge of this language can tell us what actually it is, and how can we do this in java.

  • 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-06-02T17:27:57+00:00Added an answer on June 2, 2026 at 5:27 pm

    Just to show what is happening under the hood:

    Your call:

    SendCommandToConsole ( “rp 2000” );

    Is calling the function (SendCommandToConsole) with a parameter of type (char* Cmd).

    In the case above, (char* Cmd) equates to the character string (sic) of “rp 2000”.

    Now what happens under the covers is that higher level languages (Java in your example) need to tell lower level languages how to interpret their instructions in a language that they understand.

    So to take the example above of (“I want to call the function “SendCommandToConsole” with the string parameter of “rp 2000”), means that we need to communicate to the lower level language:

    • The “uppity-ups want us to run a command”. “Oh yea, which one?”
    • “They’re telling me ‘SendCommandToConsole'”
    • “Oh, that dude? He lives at the address ‘0x004C1030’ down here.”
    • “Oh, you know the dude’s address? Can you deliver this package that
      the uppity-ups want delivered?”
    • “Sure thing, but he only accepts packages in a certain order, and
      only of a certain type.”
    • “No problem, I have their manifest right here… let’s see if it
      matches the dude’s requirements.”

    “First off, the dude at that address only wants to know 2 things, and they have to be in order:

    • What do you want me do do,
    • and who do I report the results to?”

    “Ok, that’s easy”

    I’ll assert what I want him to do:

    • “Cmd”
    • Now I’ll assert who I want him to report the results to: “No one (0)”

    All right, I’ll ring him up… you can go on with your day now.

    (Because it is a “void” return, which means you don’t care about the result of the transaction)

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

Sidebar

Related Questions

I am trying to call OpenEvent of kernel32.dll using JNA and it fails with
I'm using JNA to access a dll and everything work fine ... while i'm
I'm working on wrapping a C DLL library to Java using JNA. The library
I'm trying to call a function in a delphi dll using JNA . the
using java and jna I call a fonction : trace(potrace_ bitmap_s) struct potrace_bitmap_s {
I'm using a native c++ dll out of an Java application with the JNA
I only started to experiment with JNA, and stuck trying to call this function
I'm using JNA to call Carbon APIs. The particular API call that I want
Right now I'm using JNA for Java-native communication and am pleased with its simplicity.
What is the Java type for *short using JNA I have in my dll

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.