OK, I've tracked it down a little further. It works on normal Windows (tested Win2k and XP), but it does NOT work on BartPE. On normal Windows, TC calls FsFindFirst
twice (which is strange to me anyway, but whatever). On BartPE, TC calls FsFindFirst only once and doesn't open the plugin.
This is the code I used (just for testing):
Code: Select all
function FsFindFirstW(...)
begin
Result:= INVALID_HANDLE_VALUE;
MessageBox(0, 'one', '', MB_OK);
Result:= StartupMgr.StartupCount;
if Result > 0 then begin
//...
end else begin
MessageBox(0, 'two', '', MB_OK);
Result:= INVALID_HANDLE_VALUE;
SetLastError(ERROR_NO_MORE_FILES);
end;
end;
I get both message boxes only once on BartPE but twice on regular Windows systems.
Any hint on why TC behaves like this?
[EDIT]
Seems like there's more to it. It has something to do with the debugging my plugin does by using the OutputDebugString function. When using
SimpleProgramDebugger to catch these messages, the issue is reproducible on normal Windows systems, too; but unfortunately not on all systems. I can't reproduce it using
Sysinternals DebugView.
And now comes the really strange part: when using DebugView on BartPE, TC behaves just like on regular Windows systems! When I disable the use of OutputDebugString, TC behaves normally on BartPE, too.
[/EDIT]
Regards
Dalai