The information in this article applies to:
SUMMARY
A technique for aliasing procedure names in Windows allows procedure
calls to be transparently intercepted. You can use this technique to
monitor activities such as checking arguments for validity.
Next write the definitions file for the library above as follows:
You can obtain the ordinal numbers for the KERNEL routines (or for any
other routine) by using the LIB.EXE program to list the contents of
SLIBW or MLIBW.
Build a dynamic link library (DLL) by running IMPLIB BOO.DEF as follows:
Build the library executable by using the following table:
Next dynamically link to BOO.EXE by linking to BOO.LIB as follows:
Any calls to GlobalAlloc() are routed to MyGlobalAlloc() first because of
the name aliasing. This technique is very powerful and can be used to
implement any type of monitoring function. In the case of GlobalAlloc(),
the monitoring is transparent in the sense that it is not necessary to
recompile the application to remove error checking; simply link to
MLIBW.LIB instead of to BOO.LIB MLIBW.LIB.
Additional query words: 3.00 3.10
Keywords : kb16bitonly |
Last Reviewed: November 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |