Leaked source code of windows server 2003
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.

50 lines
1.9 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. struct tagHOOKAPI;
  17. typedef struct tagHOOKAPIEX {
  18. DWORD dwShimID;
  19. struct tagHOOKAPI *pTopOfChain;
  20. struct tagHOOKAPI *pNext;
  21. } HOOKAPIEX, *PHOOKAPIEX;
  22. typedef struct tagHOOKAPI {
  23. char* pszModule; // the name of the module
  24. char* pszFunctionName; // the name of the API in the module
  25. PVOID pfnNew; // pointer to the new stub API
  26. PVOID pfnOld; // pointer to the old API
  27. DWORD dwFlags; // used internally - important info about status
  28. union {
  29. struct tagHOOKAPI *pNextHook; // used internally - (obsolete -- old mechanism)
  30. PHOOKAPIEX pHookEx; // used internally - pointer to an internal extended info struct
  31. };
  32. } HOOKAPI, *PHOOKAPI;
  33. /*
  34. * If the hook DLL ever patches LoadLibraryA/W it must call PatchNewModules
  35. * so that the shim knows to patch any new loaded DLLs
  36. */
  37. typedef VOID (*PFNPATCHNEWMODULES)(VOID);
  38. typedef PHOOKAPI (*PFNGETHOOKAPIS)(LPSTR pszCmdLine,
  39. PFNPATCHNEWMODULES pfnPatchNewModules,
  40. DWORD* pdwHooksCount);
  41. #define SHIM_COMMAND_LINE_MAX_BUFFER 1024
  42. #endif