dELTA
February 3rd, 2007, 07:36
Hey Blabberer, great work! I'm really looking forward to your custom logging hook too! That will make it much faster and useful in several ways (bypass GUI update/animation, optimized disk writing etc).
But, as mentioned before, this will be so much more powerful with a custom GUI. I understand though that you feel this could be a boring pain. So, I created one for you.

See the attached DLL file, and the included demo host application.
The DLL exports one function (Delphi notation, feel free to reverse the simple demo host app if you feel it's easier, that's partly what it's for anyway

):
Code:
function ShowPluginSettingsModal(current_app_handle : DWORD;
used_config_data_ptr_ptr : config_data_ptr_ptr) : DWORD; stdcall;
The possible return codes are:
1 = The user pressed the OK button
2 = The user pressed the Cancel button
-1 = Error (invalid pointer given as parameter to function e.g.)
The parameter "current_app_handle" can be ignored and set to 0 if you like. If you set it to the handle of your application, the dialog will integrate better with its main window, like minimize with it etc.
The parameter "used_config_data_ptr_ptr" should be a pointer to a pointer for the following struct (if it is a pointer to a pointer with value null, this pointer will be set to point to an internally created struct of this type when the function returns instead (if the user pressed the ok button), so you don't have to create this struct yourself the first time if you don't want, but it could be good if you e.g. want to include a suggested default range that covers the entire application, which would be quite nice):
Code:
config_data = record
noof_logged_ranges : DWORD;
logged_ranges : logging_range_ptr;
noof_excluded_ranges : DWORD;
excluded_ranges : logging_range_ptr;
log_file_path : pchar; //Pointer to null terminated string, but null if empty!
end;
The "logged_ranges" and "excluded_ranges" fields are pointers to vectors of pointers to the following structs:
Code:
logging_range = record
r_start : DWORD;
r_end : DWORD;
desc : pchar; //Pointer to null terminated string, but null if empty!
end;
Please ask if something is unclear, and also take a look at the very minimal demo application, which was made just for studying and reversing for understanding purposes.
So, aside from the GUI, for the disk log writing I'd suggest a pure memory queue, much like Kayaker suggests, and dumping it in its entirety each time it reaches say 100,000 entries or so. That'll be really fast.
Finally, maybe it's time to name the plugin somwthing else than "Plugin Template"?

I named it "Jump Logger" in the GUI, sounds ok to you?
Just let me know if you want me to change/add anything, and I will!
Looking forward to the next release now, with GUI and other improvements!
EDIT:
Version 2 (fixed bug + added save/load of settings)