// madCodeHook.pas version: 2.0 ? date: 2003-08-10
// ----------
// API hooking, code hooking
// ----------
// Copyright (C) 1999 - 2003 www.madshi.net, All Rights Reserved
// **********
// 2003-08-10 2.0 (1) HookCode parameters changed -> only one flags parameter
// (2) (Un)InjectLibrary: user/session/system wide injection!
// (3) InjectLibrary2 replaced by InjectLibrary (auto detect)
// (4) static lib for Microsoft C++ added
// (5) CreateIpcQueue + SendIpcMessage + DestroyIpcQueue added
// (6) AmSystemProcess + AmUsingInputDesktop added
// (7) GetCurrentSessionId + GetInputSessionId added
// (8) GetCallingModule function added
// (9) ProcessIdToFileName added
// (a) Create/OpenGlobalMutex + Event + FileMapping added
// (b) WideToAnsi + AnsiToWide functions added
// (c) RenewHook function added
// (d) madCodeHook.dll -> madCHook.dll (8.3 dos name logic)
// (e) UnhookAPI added (= UnhookCode, added just for the look)
// (f) AddAccessForEveryone added
// 2002-10-17 1.3f InjectLibrary2(W) was not stdcall (dumb me)
// 2002-10-03 1.3e (1) InjectLibraryW added
// (2) InjectLibrary2(W) added for use in CreateProcess(W) hooks
// 2002-09-22 1.3d CreateProcessExW added
// 2002-03-24 1.3c CollectHooks/FlushHooks speed up mixture initialization
// 2002-02-24 1.3b LPSTARTUPINFO -> LPSTARTUPINFOA
// 2002-01-21 1.3a ProcessHandleToId exported
// 2001-07-08 1.3 new functions (1) AllocMemEx & FreeMemEx
// (2) CopyFunction
// (3) CreateRemoteThread and
// (4) InjectLibrary added
// 2001-04-20 1.2a you can now force HookCode/API to use the mixture mode
// 2001-04-16 1.2 new function CreateProcessEx -> dll injecting