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.
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:
"First off, the dude at that address only wants to know 2 things, and they have to be in order:
"Ok, that's easy"
I'll assert what I want him to do:
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)