Hi Piotr,

 

> The func argument should probably use CDECL calling convention (not that

> it really matters in case of no-arguments function).

 

I did it like MSVCRT__crt_atexit did it, first pass the func like this and then cast to MSVCRT__onexit_t. Should I make it MSVCRT__onexit_t right away?

 

> Also it's probably better to return -1 (error) in stub.

 

Sure can do, although it doesn't matter too much since I later replace it anyways.

 

Regards,

Fabian Maurer