Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

clhook.c File Reference

#include "precomp.h"

Go to the source code of this file.

Functions

HHOOK SetWindowsHookExAW (int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadID, DWORD dwFlags)
HHOOK WINAPI SetWindowsHookA (int nFilterType, HOOKPROC pfnFilterProc)
HHOOK WINAPI SetWindowsHookW (int nFilterType, HOOKPROC pfnFilterProc)
HHOOK WINAPI SetWindowsHookExA (int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId)
HHOOK WINAPI SetWindowsHookExW (int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId)


Function Documentation

HHOOK WINAPI SetWindowsHookA int  nFilterType,
HOOKPROC  pfnFilterProc
 

Definition at line 78 of file clhook.c.

References HF_ANSI, and NtUserSetWindowsHookAW().

00081 { 00082 return NtUserSetWindowsHookAW(nFilterType, pfnFilterProc, HF_ANSI); 00083 }

HHOOK WINAPI SetWindowsHookExA int  idHook,
HOOKPROC  lpfn,
HINSTANCE  hmod,
DWORD  dwThreadId
 

Definition at line 105 of file clhook.c.

References HF_ANSI, and SetWindowsHookExAW().

00110 { 00111 return SetWindowsHookExAW(idHook, lpfn, hmod, dwThreadId, HF_ANSI); 00112 }

HHOOK SetWindowsHookExAW int  idHook,
HOOKPROC  lpfn,
HINSTANCE  hmod,
DWORD  dwThreadID,
DWORD  dwFlags
 

Definition at line 26 of file clhook.c.

References _SetWindowsHookEx(), dwFlags, FALSE, HF_WX86KNOWNDLL, MAX_PATH, NULL, and RtlImageNtHeader().

Referenced by SetWindowsHookExA(), and SetWindowsHookExW().

00032 { 00033 WCHAR pwszLibFileName[MAX_PATH]; 00034 00035 /* 00036 * If we're passing an hmod, we need to grab the file name of the 00037 * module while we're still on the client since module handles 00038 * are NOT global. 00039 */ 00040 if (hmod != NULL) { 00041 if (GetModuleFileNameW(hmod, pwszLibFileName, 00042 sizeof(pwszLibFileName)/sizeof(TCHAR)) == 0) { 00043 00044 /* 00045 * hmod is bogus - return NULL. 00046 */ 00047 return NULL; 00048 } 00049 00050 #ifdef WX86 00051 try { 00052 if (RtlImageNtHeader(hmod)->FileHeader.Machine == IMAGE_FILE_MACHINE_I386) { 00053 dwFlags |= HF_WX86KNOWNDLL; 00054 } 00055 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00056 return NULL; 00057 } 00058 #endif 00059 } 00060 00061 return _SetWindowsHookEx(hmod, 00062 (hmod == NULL) ? NULL : pwszLibFileName, 00063 dwThreadID, idHook, (PROC)lpfn, dwFlags); 00064 }

HHOOK WINAPI SetWindowsHookExW int  idHook,
HOOKPROC  lpfn,
HINSTANCE  hmod,
DWORD  dwThreadId
 

Definition at line 114 of file clhook.c.

References SetWindowsHookExAW().

00119 { 00120 return SetWindowsHookExAW(idHook, lpfn, hmod, dwThreadId, 0); 00121 }

HHOOK WINAPI SetWindowsHookW int  nFilterType,
HOOKPROC  pfnFilterProc
 

Definition at line 87 of file clhook.c.

References NtUserSetWindowsHookAW().

00090 { 00091 return NtUserSetWindowsHookAW(nFilterType, pfnFilterProc, 0); 00092 }


Generated on Sat May 15 19:43:04 2004 for test by doxygen 1.3.7