1// +build windows,cgo
2
3package main
4
5// #include <windows.h>
6// typedef void(*callmeBackFunc)();
7// static void bridgeCallback(callmeBackFunc callback) {
8//	callback();
9//}
10import "C"
11
12// CallMeBack call backs C code.
13//export CallMeBack
14func CallMeBack(callback C.callmeBackFunc) {
15	C.bridgeCallback(callback)
16}
17
18// Dummy is called by the C code before registering the exception/continue handlers simulating a debugger.
19// This makes sure that the Go runtime's lastcontinuehandler is reached before the C continue handler and thus,
20// validate that it does not crash the program before another handler could take an action.
21// The idea here is to reproduce what happens when you attach a debugger to a running program.
22// It also simulate the behavior of the .Net debugger, which register its exception/continue handlers lazily.
23//export Dummy
24func Dummy() int {
25	return 42
26}
27
28func main() {}
29