1.16.2 Installing a Filter Function

To install a filter function, an application must do the following:

1.Export the function in its module definition file.

2.Obtain the function's address by using the MakeProcInstance function.

3.Call the SetWindowsHook function, specifying the type of hook function (see Table 1.8, “System Hooks”) and the address of the function (returned by MakeProcInstance).

4.Store the return value from SetWindowsHook in a reserved location. This value is the address of the previous filter function.

NOTE:

Filter functions and the return value from SetWindowsHook must reside in fixed library code and data. This allows these hooks to operate in a large-frame EMS environment.