2 * Misc Toolhelp functions
4 * Copyright 1996 Marcus Meissner
19 /* FIXME: to make this working, we have to callback all these registered
20 * functions from all over the WINE code. Someone with more knowledge than
21 * me please do that. -Marcus
26 FARPROC16 lpfnCallback
;
30 static int nrofnotifys
= 0;
32 static FARPROC16 HookNotify
= NULL
;
34 BOOL16 WINAPI
NotifyRegister( HTASK16 htask
, FARPROC16 lpfnCallback
,
39 dprintf_toolhelp( stddeb
, "NotifyRegister(%x,%lx,%x) called.\n",
40 htask
, (DWORD
)lpfnCallback
, wFlags
);
41 if (!htask
) htask
= GetCurrentTask();
42 for (i
=0;i
<nrofnotifys
;i
++)
43 if (notifys
[i
].htask
==htask
)
47 notifys
=(struct notify
*)HeapAlloc( SystemHeap
, 0,
48 sizeof(struct notify
) );
50 notifys
=(struct notify
*)HeapReAlloc( SystemHeap
, 0, notifys
,
51 sizeof(struct notify
)*(nrofnotifys
+1));
52 if (!notifys
) return FALSE
;
55 notifys
[i
].htask
=htask
;
56 notifys
[i
].lpfnCallback
=lpfnCallback
;
57 notifys
[i
].wFlags
=wFlags
;
61 BOOL16 WINAPI
NotifyUnregister( HTASK16 htask
)
65 dprintf_toolhelp( stddeb
, "NotifyUnregister(%x) called.\n", htask
);
66 if (!htask
) htask
= GetCurrentTask();
67 for (i
=nrofnotifys
;i
--;)
68 if (notifys
[i
].htask
==htask
)
72 memcpy(notifys
+i
,notifys
+(i
+1),sizeof(struct notify
)*(nrofnotifys
-i
-1));
73 notifys
=(struct notify
*)HeapReAlloc( SystemHeap
, 0, notifys
,
74 (nrofnotifys
-1)*sizeof(struct notify
));
79 BOOL16 WINAPI
StackTraceCSIPFirst(STACKTRACEENTRY
*ste
, WORD wSS
, WORD wCS
, WORD wIP
, WORD wBP
)
84 BOOL16 WINAPI
StackTraceFirst(STACKTRACEENTRY
*ste
, HTASK16 Task
)
89 BOOL16 WINAPI
StackTraceNext(STACKTRACEENTRY
*ste
)
94 /***********************************************************************
95 * ToolHelpHook (KERNEL.341)
96 * see "Undocumented Windows"
98 FARPROC16 WINAPI
ToolHelpHook(FARPROC16 lpfnNotifyHandler
)
102 HookNotify
= lpfnNotifyHandler
;
103 /* just return previously installed notification function */