Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.4 KiB

  1. ////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // File: shim.h
  4. //
  5. // History: May-99 clupu Created.
  6. // Aug-99 v-johnwh Various bug fixes.
  7. // 23-Nov-99 markder Support for multiple shim DLLs, chaining
  8. // of hooks. General clean-up.
  9. // 11-Feb-00 markder Reverted to W2K shipped shim structures.
  10. //
  11. // Desc: Contains all structure and function definitions for the shim mechanism.
  12. //
  13. ////////////////////////////////////////////////////////////////////////////////////
  14. #ifndef __SHIM_H__
  15. #define __SHIM_H__
  16. typedef struct tagHOOKAPI {
  17. char* pszModule; // the name of the module
  18. char* pszFunctionName; // the name of the API in the module
  19. PVOID pfnNew; // pointer to the new stub API
  20. PVOID pfnOld; // pointer to the old API
  21. DWORD dwIndex; // used internally
  22. char* pszModToPatch; // list of modules to hook. NULL means all.
  23. } HOOKAPI, *PHOOKAPI;
  24. /*
  25. * If the hook DLL ever patches LoadLibraryA/W it must call PatchNewModules
  26. * so that the shim knows to patch any new loaded DLLs
  27. */
  28. typedef VOID (*PFNPATCHNEWMODULES)(VOID);
  29. typedef PHOOKAPI (*PFNGETHOOKAPIS)(LPSTR pszCmdLine,
  30. PFNPATCHNEWMODULES pfnPatchNewModules,
  31. DWORD* pdwHooksCount);
  32. #endif