Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

C# code

what does the following line mean and does:
fixed (byte * buffPointer = dataBuffer)                              hllapi(&function, buffPointer, &dataLength, &returnCode);
0
vivekj2004
Asked:
vivekj2004
1 Solution
 
SStoryCommented:
see this: http://blog.dmbcllc.com/2009/01/05/csharp-fixed-keyword/

It looks like you are declaring a function call to hllapi
I'm guess the first part is the return type...
fixed fixes pointers and such, so that they aren't moved around.
buffpointer is a variable-- a pointer to a byte and it is being pointed to dataBuffer

Is this all one line of code or two?
0
 
Gururaj BadamCommented:
hllapi(&function, buffPointer, &dataLength, &returnCode);

hllapi is a function which takes

Param 1 -> Pointer to a function
Param 2 -> Pointer to a buffer
Param 3 -> May return the length of the data filled in Param 2 post execution
Param 4 -> The state of execution of function
0
 
Naman GoelCommented:
so its same as the below code where you are calling hllapi method
 
http://publib.boulder.ibm.com/infocenter/pcomhelp/v5r9/index.jsp?topic=/com.ibm.pcomm.doc/books/html/emulator_programming07.htm
 
EHLLAPI Call Format
The EHLLAPI entry point (hllapi) is always called with the following four parameters: EHLLAPI Function Number (input) Data Buffer (input/output) Buffer Length (input/output) Position (input); Return Code (output)

The prototype for IBM Standard EHLLAPI is: [long hllapi (LPWORD, LPSTR, LPWORD, LPWORD);
The prototype for IBM Enhanced EHLLAPI is: [long hllapi (LPINT, LPSTR, LPINT, LPINT);
Each parameter is passed by reference not by value. Thus each parameter to the function call must be a pointer to the value, not the value itself

fixed (byte * buffPointer = dataBuffer) 
{
 hllapi(&function, buffPointer, &dataLength, &returnCode); 
}

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now