Thank you for your answer.
I didn't plan to intercept the call on the return way, but before the former GetLocalString is called. So I think it should be possible.
What I have in mind is to avoid calling the original functions when NWNX is targeted:
SetLocalString would only be used to set a record into the database, wouldn't be used to really change anything in NWNServer memory space if the command targets NWNX (used for SQL commands like 'INSERT', 'UPDATE'... all orders that don't need return values)
GetLocalString would be used to retreive datas from the database (or other structures). Like for SetLocalString, if NWNX is the target of the GetLocalString call, then the original function would not even need to be called.
Also, still with optimization in mind, I consider to directly use MySQL api, instead of ODBC. Seems that ODBC layer is quite time consuming... and MySQL seems to be the most widely used database.
Or... maybe I won't do anything at all, as one could say it's working and it wouldn't save much CPU time (and so much other things to do for my mod and server). Who knows
BTW, don't you fear that those first 8 bytes may change in some future release of NWN Server ?