Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QM handling of C declarations
#5
yes, i supposed that, without seeing the aim of it

IIRC (i'm at work, so can't test in real)

int u=3

int* p=&u

p=memory address of u
*p=value of u = 3
&p=memory address of p

int**y =&p
&y = memoruy adress of y
y=memory address of p
*y = memory address of u
**y=value of u = 3

So i don't get the meaning of using str*&...

in the example from external site, there is still something confusing:

the callback function

static void WINAPI InterfaceChangeCallback(PVOID callerContext,
PMIB_IPINTERFACE_ROW row,
MIB_NOTIFICATION_TYPE notificationType)

is only declared on the beginning of code, and used in main procedure.
i understand that it fills on its own the parameters, the PMIB_IPINTERFACE_ROW row variable which must be filled is not declared anywhere.

Usually, functions are used with declared variables, even uninitialized, and filled later when a function use them.

1. How this work?
2. in the code in the site, Row is neither reference nor pointer (PMIB_IPINTERFACE_ROW row), which seems logical as from point 1., it is unavailable to code as not declared or initialized.

So the callback function can't find memory address for it (not a pointer) and can't pass it (reference).

But in QM headers, you state it as
Callback: function !*CallerContext MIB_IPINTERFACE_ROW*Row NotificationType

Where Row is a pointer

3. If so, how must I call Row as pointer or reference in code later? in your example, seems by reference as you use Row.family in your answer above.

Sorry to bore you, but i'd really like to understand...


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)