<div dir="ltr">Hi PANDAs,<div><br></div><div>I&#39;m trying to write a plugin to use alongside syscalls2 to handle NtUserCreateWindowEx.</div><div><br></div><div>In the panda_plugins folder I&#39;ve created a folder called &#39;usercreatewin&#39;.</div><div>In that folder I have usercreatewin.cpp and Makefile.</div><div>I&#39;ve added &#39;usercreatewin&#39; to config.panda.</div><div><br></div><div>My init function looks like this:</div><div><div>bool init_plugin(void *self) {</div><div>    PPP_REG_CB(&quot;syscalls2&quot;, on_NtUserCreateWindowEx_enter, my_NtUserCreateWindowEx_enter);</div><div>    return true;</div><div>}</div></div><div><br></div><div>The corresponding &#39;my_NtUserCreateWindowEx_enter&#39; function is in my cpp file as well.</div><div><br></div><div>When I issue &#39;make&#39; I get:</div><div>--SNIP--</div><div><div>make[2]: Nothing to be done for &#39;all&#39;.</div><div>  CXX   /home/btg/src/panda/qemu/x86_64-softmmu/panda_plugins/usercreatewin.o</div><div>In file included from usercreatewin.cpp:5:0:</div><div>usercreatewin.cpp: In function ‘bool init_plugin(void*)’:</div><div>usercreatewin.cpp:29:29: error: ‘on_NtUserCreateWindowEx_enter_t’ was not declared in this scope</div><div>     PPP_REG_CB(&quot;syscalls2&quot;, on_NtUserCreateWindowEx_enter, my_NtUserCreateWindowEx_enter);</div><div>                             ^</div><div>/home/btg/src/panda/qemu/panda_plugin_plugin.h:120:20: note: in definition of macro ‘PPP_REG_CB’</div><div>     void (*add_cb)(cb_name##_t fptr) = (void (*)(cb_name##_t)) dlsym(op, &quot;ppp_add_cb_&quot; #cb_name); \</div><div>                    ^</div><div>/home/btg/src/panda/qemu/panda_plugin_plugin.h:120:38: error: expected ‘,’ or ‘;’ before ‘=’ token</div><div>     void (*add_cb)(cb_name##_t fptr) = (void (*)(cb_name##_t)) dlsym(op, &quot;ppp_add_cb_&quot; #cb_name); \</div><div>                                      ^</div><div>usercreatewin.cpp:29:5: note: in expansion of macro ‘PPP_REG_CB’</div><div>     PPP_REG_CB(&quot;syscalls2&quot;, on_NtUserCreateWindowEx_enter, my_NtUserCreateWindowEx_enter);</div><div>     ^</div><div>/home/btg/src/panda/qemu/panda_plugin_plugin.h:122:20: error: ‘add_cb’ cannot be used as a function</div><div>     add_cb (cb_func);       \</div><div>                    ^</div><div>usercreatewin.cpp:29:5: note: in expansion of macro ‘PPP_REG_CB’</div><div>     PPP_REG_CB(&quot;syscalls2&quot;, on_NtUserCreateWindowEx_enter, my_NtUserCreateWindowEx_enter);</div><div>     ^</div><div>../panda.mak:42: recipe for target &#39;/home/btg/src/panda/qemu/x86_64-softmmu/panda_plugins/usercreatewin.o&#39; failed</div></div><div>--SNIP--</div><div><br></div><div>It feels like I&#39;ve forgotten something. Any help gratefully received!</div><div><br></div><div>Thanks,</div><div>Adam</div></div>