ApiHooks 3.1: Tips.txt

*) If you have (bad) impression that ApiHooks hasn't hooked wanted
   module(s) do this:
   A) In Hooks_DLL source specify UnhookAddresses with enough (~128)
      ADDR_CONTENTS structures.
   B) After Hooks_DLL application let AH debugging support display
      information: enter !ahm Hooks_DLLBase or .iahm Hooks_DLLBase 
      in the debugger or
      print ADDR_CONTENTS structures directly from Hooks_DLL.
   If you will not find ReturnWhere belonging to wanted module(s)
   (except Win9X modules above 2GB if you haven't specified HOOK_HARD)
   in UnhookAddresses then find the bug in your strategy or ApiHookChain.

*) You don't have to hook exported functions only. You can change also
   exported data directly. Anything can be changed indirectly (in situ).

*) Don't forget to save (after original API call) and restore (after post
   orginal API call action(s)) LastError value:

   ResultType CallType MyApi(Par0, Par1,...) {
     ResultType result;
        // pre-orig-call actions: modify parameters, bufers
        result = OrigApi(Par0, Par1,...);  // optional
        lasterr = GetLastError(); 
        // post-orig-call actions: modify parameters, buffers, result
        SetLastError(lasterr); 
        return(result);
   }

*) Source code compile with structure alignment <= 8.
   API_HOOK structure must have size 0x18.
   ADDR_CONTENTS structure must have size 8.

*) Hooks_DLL can be packed/encrypted (static ApiHookChain is restored
   during Hooks_DLL initialization. Static ApiHookChain can be always
   created/modified during Hooks_DLL initialization (= before hooks
   application), of course it should lie within writeable section. ShowAH
   will fail with such a packed/encrypted module.

*) Don't forget that you can hook (here better implement) APIs which have no
   useful implementation in Win9X (APIs are exported but GetLastError() returns
   ERROR_CALL_NOT_IMPLEMENTED). See HDK\DOC\dwFlags.txt|9X abnormalities: B),
   Examples\ASM\VAllocFreeEx9x (VirtualAllocEx and VirtualFreeEx implementation)
   and Examples\C\CapConsole\CapConsole.c (WriteConsoleW implementation).

*) AH functions are reentrant - support multithreading. But you must ensure
   that two or more threads do not call AH functions with the ProcessId or
   hProcess representing the same process (except the current process) in one 
   time. If two or more threads are inside AH functions, AH_LAST_STATUS structure
   content is undefined.