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.

55 lines
1.8 KiB

  1. #ifndef _HOOKS_H_
  2. #define _HOOKS_H_
  3. //
  4. // Constant declarations
  5. //
  6. #define HAF_RESOLVED 0x0001
  7. #define HAF_BOTTOM_OF_CHAIN 0x0002
  8. #define MAX_MODULES 512
  9. #define SHIM_GETHOOKAPIS "GetHookAPIs"
  10. typedef PHOOKAPI (*PFNNEWGETHOOKAPIS)(DWORD dwGetProcAddress, DWORD dwLoadLibraryA, DWORD dwFreeLibrary, DWORD* pdwHookAPICount);
  11. typedef LPSTR (*PFNGETCOMMANDLINEA)(VOID);
  12. typedef LPWSTR (*PFNGETCOMMANDLINEW)(VOID);
  13. typedef PVOID (*PFNGETPROCADDRESS)(HMODULE hMod, char* pszProc);
  14. typedef HINSTANCE (*PFNLOADLIBRARYA)(LPCSTR lpLibFileName);
  15. typedef HINSTANCE (*PFNLOADLIBRARYW)(LPCWSTR lpLibFileName);
  16. typedef HINSTANCE (*PFNLOADLIBRARYEXA)(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
  17. typedef HINSTANCE (*PFNLOADLIBRARYEXW)(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
  18. typedef BOOL (*PFNFREELIBRARY)(HMODULE hLibModule);
  19. typedef VOID (*PFNEXITPROCESS)(UINT uExitCode);
  20. typedef HANDLE (*PFNCREATETHREAD)(LPSECURITY_ATTRIBUTES lpThreadAttributes, DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId);
  21. //number of the base hook apis used by init.c and shim2.c
  22. #define SHIM_BASE_APIHOOK_COUNT 8
  23. enum
  24. {
  25. hookGetProcAddress,
  26. hookLoadLibraryA,
  27. hookLoadLibraryW,
  28. hookLoadLibraryExA,
  29. hookLoadLibraryExW,
  30. hookFreeLibrary,
  31. hookExitProcess,
  32. hookCreateThread,
  33. };
  34. extern PHOOKAPI ConstructChain( PVOID pfnOld ,DWORD* DllListIndex);
  35. extern void __stdcall Shim2PatchNewModules( VOID );
  36. extern void AddHookAPIs( HMODULE hShimDll, PHOOKAPI pHookAPIs, DWORD dwCount,LPTSTR szIncExclDllList);
  37. //
  38. // Structure definitions
  39. //
  40. //
  41. // Function definitions
  42. //
  43. VOID
  44. InitializeBaseHooks(HINSTANCE hInstance);
  45. #endif //_HOOKS_H_